Calculating results with CASE | Computer Programming | Khan Academy

preview_player
Показать описание
Created by: pamela (KA teacher)

Computer Programming on Khan Academy: Learn how to program drawings, animations, and games using JavaScript & ProcessingJS, or learn how to create webpages with HTML & CSS. You can share whatever you create, explore what others have created and learn from each other!

For free. For everyone. Forever. #YouCanLearnAnything

Рекомендации по теме
Комментарии
Автор

If any case you can not solve this :
you can see this

SELECT name, number_grade, ROUND(fraction_completed *100) AS percent_completed FROM student_grades ;

SELECT COUNT(*),
CASE
WHEN number_grade > 90 THEN "A"
WHEN number_grade > 80 THEN "B"
WHEN number_grade > 70 THEN "C"
ELSE "F"
END AS "letter_grade"
FROM student_grades GROUP BY letter_grade;

priyansurout
Автор

how to resolve step 2 of the activity book challenge.

SELECT COUNT (*),
     CASE
         WHEN number_grade> = 90 THEN "A"
         WHEN number_grade> = 80 AND number_grade <90 THEN "B"
         WHEN number_grade> = 70 and number_grade <80 then "C"
         else "F"
         END the "letter_grade"
     FROM student_grades
group by letter_grade;

assiseciaax
Автор

I don't usually comment on videos, but the pun at the end of this one has invoked a poignant anguish within me to such great of an extent that I'm writing this to impulsively say: "Boo! Shame on you", however, I'm also inclined to thank those behind Khan academy for making these videos, because they are helpful, if not repugnantly cheesy at times.

Calm
Автор

Replayed it & found you explained the concept very well. Thanks

mirzahir
Автор

You don't have any examples of this in your video, but if you had an "above target" result, the third case statement would also include this (note that this is the same for "above max")... how is this handled in SQL?

alphasierrabravoyt
Автор

I just want to know how to round the entire column to percentage...

sandhyaharipriya
Автор

cant find column hr_zone is a error for me

shaluranidj
Автор

Looks like I've done everything correctly and it shows the right results, but it doesn't take me to the next step.

SELECT number_grade,
CASE
WHEN number_grade>90 THEN "A"
WHEN number_grade>80 and number_grade <= 90 THEN "B"
WHEN number_grade>70 and number_grade <= 80 THEN "C"
ELSE "F"
END AS "letter_grade"
FROM student_grades;

SELECT count(name) as number_of_students,
CASE
WHEN number_grade>90 THEN "A"
WHEN number_grade>80 and number_grade <= 90 THEN "B"
WHEN number_grade>70 and number_grade <= 80 THEN "C"
ELSE "F"
END AS "letter_grade"
FROM student_grades
GROUP BY letter_grade

edlewis
visit shbcf.ru