0
0
SQLquery~10 mins

MySQL vs PostgreSQL vs SQL Server overview - Interactive Practice

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

Complete the code to select all columns from a table named 'employees'.

SQL
SELECT [1] FROM employees;
Drag options to blanks, or click blank then click option'
AALL
B*
CEVERY
DCOLUMNS
Attempts:
3 left
💡 Hint
Common Mistakes
Using keywords like ALL or COLUMNS which are not valid in this context.
Trying to write column names instead of using the wildcard.
2fill in blank
medium

Complete the code to filter rows where the 'age' column is greater than 30.

SQL
SELECT * FROM users WHERE age [1] 30;
Drag options to blanks, or click blank then click option'
A<
B<=
C=
D>
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' instead of '>' which filters the wrong rows.
Using '=' which only matches exactly 30.
3fill in blank
hard

Fix the error in the SQL query to count the number of rows in the 'orders' table.

SQL
SELECT COUNT([1]) FROM orders;
Drag options to blanks, or click blank then click option'
A*
Border_id
Call
Drows
Attempts:
3 left
💡 Hint
Common Mistakes
Using COUNT(all) or COUNT(rows) which are invalid.
Using COUNT(column) which may miss rows with NULL in that column.
4fill in blank
hard

Fill both blanks to create a query that selects the 'name' and 'salary' columns from 'employees' where salary is at least 50000.

SQL
SELECT [1], [2] FROM employees WHERE salary [3] 50000;
Drag options to blanks, or click blank then click option'
Aname
Bsalary
C>=
D<
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' instead of '>=' which filters wrong rows.
Selecting wrong column names.
5fill in blank
hard

Fill all three blanks to create a query that counts how many employees have a department ID less than 10.

SQL
SELECT COUNT([1]) FROM employees WHERE department_id [2] [3];
Drag options to blanks, or click blank then click option'
A*
B<
C10
Ddepartment_id
Attempts:
3 left
💡 Hint
Common Mistakes
Using COUNT(department_id) which misses NULLs.
Using wrong comparison operators or values.