From the course: SQL for Non-Programmers
Unlock the full course today
Join today to access over 23,400 courses taught by industry experts.
Solution: Advanced commands solved - SQL Tutorial
From the course: SQL for Non-Programmers
Solution: Advanced commands solved
How do you feel after completing the advanced command's challenge? This was not an easy endeavor. Let's see how you did. To kick it off, you are tasked with providing a sales report for a few of the top selling product lines offered by Two Trees Olive Oil. Both the total sales and price per item sold should be listed for each product line, and all other product lines should be excluded. The report should be ordered from largest to smallest sales so that we can easily see the ranking. Your query should look something like this. We can begin with SELECT CASE. We need to use a CASE statement to categorize the product lines. Onto the next line. WHEN product name LIKE lemon percent symbol, THEN lemon. We can list out each grouping here and use the wildcard percent symbol to partially match product names with their associated product line, which is always listed at the beginning of the product name. Onto the next line. WHEN product name LIKE rosemary percent, THEN rosemary. On the next…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
(Locked)
Categorize data with CASE8m 51s
-
(Locked)
Beyond basic CASE statements7m 9s
-
(Locked)
Creating Calculated Fields7m 33s
-
(Locked)
Matching data with wildcards7m 57s
-
(Locked)
Combining data with UNION6m 57s
-
(Locked)
Challenge: Practice with advanced commands2m 1s
-
(Locked)
Solution: Advanced commands solved6m 10s
-
(Locked)
-