课程: Coding Exercises: SQL Data Science

今天就学习课程吧!

今天就开通帐号,24,700 门业界名师课程任您挑!

Using CASE and WHEN statements

Using CASE and WHEN statements

(techno gaming music) - [Instructor] Lara Thomson, who is one of the authors in the sports division is doing a research to study BMI's of athletes across different sports. She has asked you to classify athletes from each sport into three different buckets of BMI. And she needs a count of all the athletes in that bucket. So the challenge here becomes that you have to classify the athletes based on their BMI across different sports. (air whooshing) And to break it down, you will first have to join the GameStats table with the Athletes table to get data about sport, weight, and height of athlete. And then you'll use that to calculate the BMI, which is defined as weight divided by height squared multiplied by a hundred. Then you will create three buckets of this calculation or the BMI. And those three buckets would be less than 0.25, between 0.25 and 0.30 and greater than 0.30. Lastly, you will use case and when statements…

内容