Skip to main content

Exam 4: Shaping Results

Difficulty: Beginner+

Topics covered: DISTINCT, ORDER BY, LIMIT, AS, computed columns

Each question shows the target output. Write a SQL query that produces exactly those columns and rows.


Question 1

Retrieve a unique list of countries from the customers table. Return just the country column.

⌘ / Ctrl + Enter to run

Question 2

Get the 3 most expensive products by price (highest first). Return all columns.

⌘ / Ctrl + Enter to run

Question 3

Get the 3 most recent orders by order_date. Return all columns.

⌘ / Ctrl + Enter to run

Question 4

Retrieve the product_id, name, and price of products in the 'Furniture' category. Return only those two columns plus product_id.

⌘ / Ctrl + Enter to run

Question 5

List all unique product_id values that appear in the orders table. Return just the product_id column.

⌘ / Ctrl + Enter to run
Donate to this project