课程: Intermediate SQL for Data Scientists

今天就学习课程吧!

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

Multiple table common table expressions

Multiple table common table expressions - SQL教程

课程: Intermediate SQL for Data Scientists

Multiple table common table expressions

- [Instructor] Okay, I want to do some analysis on salaries across regions. Now in particular, I want to know how much do we pay in salaries in each region? And actually what I really want to know is which of the regions are above the average for what we pay in a region for salary? So this is kind of a multi-step analysis I want to do. So I'm going to start with kind of a high level approach, and I'm just going to kind of think this one through. I want to select all of the attributes associated with a relation that I'm going to call region salaries. Now, I haven't defined that yet and that's okay. I'm just kind of thinking at a high level here what my logic is. And I want to pull from this list of region salaries, only those regions where the region ID is in the list are in a set of regions where they're above average. So I want to be able to create a list of regions that have above average salaries. Well, I'll figure out how to do that later. And so for now, I'm just going to call it…

内容