Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to select all columns from the table named 'employees'.
SQL
SELECT [1] FROM employees; Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'ALL' instead of '*'
Writing 'COLUMNS' which is not valid SQL syntax
✗ Incorrect
The asterisk (*) means select all columns from the table.
2fill in blank
mediumComplete the code to select the 'name' column from the 'employees' table.
SQL
SELECT [1] FROM employees; Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using plural 'names' instead of 'name'
Using a different column name not in the table
✗ Incorrect
The column name is 'name' exactly as in the table schema.
3fill in blank
hardFix the error in the SELECT statement to retrieve 'salary' from 'employees'.
SQL
SELECT salary FROM [1]; Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Misspelling the table name
Using singular form instead of plural
✗ Incorrect
The correct table name is 'employees'. Misspelling it causes an error.
4fill in blank
hardFill both blanks to select 'name' and 'salary' columns from 'employees'.
SQL
SELECT [1], [2] FROM employees;
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Selecting wrong columns like 'age' or 'department'
Swapping the order of columns (order matters for output)
✗ Incorrect
We select the columns 'name' and 'salary' as requested.
5fill in blank
hardFill all three blanks to select 'name' and 'salary' from 'employees' where salary is greater than 50000.
SQL
SELECT [1], [2] FROM [3] WHERE salary > 50000;
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong table name like 'salaries'
Selecting columns not requested
Omitting the WHERE clause (not asked here but important)
✗ Incorrect
The query selects 'name' and 'salary' columns from the 'employees' table with a condition on salary.