From the course: SQL for Non-Programmers

Unlock the full course today

Join today to access over 23,100 courses taught by industry experts.

Challenge: Practice with basic commands

Challenge: Practice with basic commands - SQL Tutorial

From the course: SQL for Non-Programmers

Challenge: Practice with basic commands

It's your turn now to put your skills to the test. Management has asked us to provide the top 20 orders in the states of Georgia and North Carolina from our sales table. Along with order number, they need order type, customer type, and order total. They are also curious to know how many of the top 20 orders were purchased by individuals, rather than wholesale business orders. Let's break this down into a step-by-step approach. First, query the different customer type options available in the olive oil sales table. What distinct values are available in this column of data? Or in other words, what are the different customer types available? Next, add multiple columns to retrieve the order number, order type, customer type, and order total. Sort this data by largest to smallest order total. Do you see any pattern? What types of orders and customers have the largest order totals? Keeping the same base query, filter for only those orders made in the states of North Carolina and Georgia…

Contents