![]() ![]() Being able to break a problem down into the necessary tables and finding a solution using the resulting table is very useful in practice. Arguably, the advanced features of Subqueries and CTEs are the most widely used in an analytics role within a company. #Recap This lesson was the first of the more advanced sequence in writing SQL. How many accounts had more total purchases than the account name which has bought the most standard_qty paper throughout their lifetime as a customer?įor the customer that spent the most (in total over their lifetime as a customer) total_amt_usd, how many web_events did they have for each channel? Provide the name of the sales_rep in each region with the largest amount of total_amt_usd sales.įor the region with the largest sales total_amt_usd, how many total orders were placed? Try to perform each of the earlier queries again, but using a WITH instead of a subquery. ![]() Therefore, you can write any of the queries we worked with in the “Subquery Mania” using a WITH. The quiz at the bottom will assure you are catching all of the necessary components of these new queries.Įssentially a WITH statement performs the same task as a Subquery. You can add more and more tables using the WITH statement in the same way.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |