SELECT
Filtering Data
Sorting Data
SQL Basics & Commands
SQL Real-World Challenges
100

What command retrieves all data from a table?

SELECT * FROM table_name;

100

What keyword is used to filter results?

WHERE

100

What keyword is used to sort results?

ORDER BY

100

What does FROM do?

Specifies which table to retrieve data from

100

What is a way that SQL could be used in real life.

Many correct answers.

200

How do you retrieve only the ProductName column from Products?

SELECT ProductName FROM Products;

200

How do you find customers from Mexico?

SELECT * FROM Customers WHERE Country = 'Mexico';

200

How do you sort products from lowest to highest price?

ORDER BY Price ASC;

200

What does WHERE do?

Filters results based on a condition

200

How do you find the lowest-priced product?

ORDER BY Price ASC

300

What does DISTINCT do?

Removes duplicate values

300

How do you find products that cost more than $50?

SELECT * FROM Products WHERE Price > 50;

300

How do you sort customers alphabetically?

ORDER BY CustomerName ASC;

300

What does ORDER BY ColumnName ASC do?

Sorts in ascending order

300

How do you find all employees hired before 1990?

SELECT * FROM Employees WHERE HireDate < '1990-01-01';

400

What does ORDER BY do?

Sorts the results

400

How do you find employees hired before 2000?

SELECT * FROM Employees WHERE HireDate < '2000-01-01';

400

How do you sort employees by last name in reverse order?

ORDER BY LastName DESC;

400

What does ORDER BY ColumnName DESC do?

Sorts in descending order

400

How do you find all customers from France and Germany?

SELECT * FROM Customers WHERE Country = 'France' OR Country = 'Germany';

500

What happens if you run SELECT * FROM Customers; with no WHERE clause?

It returns all customers

500

How do you find customers from the USA or Canada?

SELECT * FROM Customers WHERE Country = 'USA' OR Country = 'Canada';

500

How do you sort orders by date, newest first?

ORDER BY OrderDate DESC;

500

What does DISTINCT do?

Shows only unique values

500

How would a store owner use SQL to find the most expensive product?

ORDER BY Price DESC