课程: Coding Exercises: SQL Data Science
今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Using OVER and PARTITION BY statements - SQL教程
课程: Coding Exercises: SQL Data Science
Using OVER and PARTITION BY statements
- [Instructor] The sports division of your company needs you to help them out with an analysis on countries and their athletes. Megan, who is a sports editor has sent you an email and she needs to review the GDP of every country for each year. But, she wants the data in such a way that she could study the GDP of a single country for all the years, and then move on to the next country. So, you are required to partition the data by country and display the GDP of each country for all the years, one after another. So, here's an image that will give you a better understanding of what you're required to do here. So in the left, this is the original data, you have country ID 1, 2, 3, 4, 5 in this way for every year. So for every country, we have date as first, January, 2000. And you need to get it into this format on the right where you have country ID 1. And you have the GDP for all the years where you have first, January, 2010,…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。