课程: SQL Hands-On Practice: Solve Business Problems

免费学习该课程!

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

Solution: Pull descriptive statistics with a CTE

Solution: Pull descriptive statistics with a CTE - SQL教程

课程: SQL Hands-On Practice: Solve Business Problems

Solution: Pull descriptive statistics with a CTE

- [Instructor] Welcome back! How'd that go for you? Now that the business problem has been defined and you have a clear goal in front of you, you're ready to pull descriptive stats for both products' monthly revenues. Let's first start with finding the monthly revenue by product, since we know we're going to need that. And let's pull in the product name from the products table instead of just using the product ID field from the subscriptions table. Using the product name will be much more understood and stakeholder friendly in the output. Stakeholders think in words, not IDs. So in our CoderPad environment, we'll start out with select star. Select star is also the same as saying select all the columns. And then we're going to pull from the subscriptions table. And we're going to call it S for short, using an alias. You can use the word as here, but you don't have to. And then we're going to join the products table. And…

内容