0
0
SQLquery~10 mins

MIN and MAX functions in SQL - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to find the highest salary from the employees table.

SQL
SELECT [1](salary) FROM employees;
Drag options to blanks, or click blank then click option'
AMIN
BMAX
CCOUNT
DSUM
Attempts:
3 left
💡 Hint
Common Mistakes
Using MIN instead of MAX.
Using SUM or COUNT which do different calculations.
2fill in blank
medium

Complete the code to find the lowest price in the products table.

SQL
SELECT [1](price) FROM products;
Drag options to blanks, or click blank then click option'
AAVG
BSUM
CMAX
DMIN
Attempts:
3 left
💡 Hint
Common Mistakes
Using MAX instead of MIN.
Using AVG or SUM which calculate averages or totals.
3fill in blank
hard

Fix the error in the code to get the maximum age from the users table.

SQL
SELECT [1](age) FROM users;
Drag options to blanks, or click blank then click option'
AMAX
BMIN
CMAX)
DMAX(
Attempts:
3 left
💡 Hint
Common Mistakes
Leaving unbalanced parentheses.
Using MIN instead of MAX.
4fill in blank
hard

Fill both blanks to find the minimum and maximum scores from the tests table.

SQL
SELECT [1](score) AS min_score, [2](score) AS max_score FROM tests;
Drag options to blanks, or click blank then click option'
AMIN
BSUM
CMAX
DCOUNT
Attempts:
3 left
💡 Hint
Common Mistakes
Using SUM or COUNT instead of MIN or MAX.
Swapping MIN and MAX functions.
5fill in blank
hard

Fill all three blanks to select the maximum price, minimum price, and average price from the items table.

SQL
SELECT [1](price) AS max_price, [2](price) AS min_price, [3](price) AS avg_price FROM items;
Drag options to blanks, or click blank then click option'
AMAX
BMIN
CAVG
DSUM
Attempts:
3 left
💡 Hint
Common Mistakes
Using SUM instead of AVG for average price.
Mixing up MIN and MAX functions.