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 (*) selects all columns from the table.
2fill in blank
mediumComplete the code to select only the 'name' column from the 'students' table.
SQL
SELECT [1] FROM students; Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'names' which is plural and may not exist
Using 'student_name' which is a different column
✗ Incorrect
Use the exact column name 'name' to select that column.
3fill in blank
hardFix the error in the code to select the 'age' column from the 'persons' table.
SQL
SELECT [1] FROM persons; Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using plural form 'ages'
Using a different column name like 'person_age'
✗ Incorrect
The column name is 'age'. Using 'ages' or other variants causes errors.
4fill in blank
hardFill both blanks to select the 'id' and 'email' columns from the 'contacts' table.
SQL
SELECT [1], [2] FROM contacts;
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using columns not in the table like 'name' or 'phone'
Forgetting the comma between column names
✗ Incorrect
To select multiple columns, list them separated by commas.
5fill in blank
hardFill all three blanks to select 'first_name', 'last_name', and 'age' columns from the 'users' table.
SQL
SELECT [1], [2], [3] FROM users;
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Including columns not asked for like 'email'
Missing commas between column names
✗ Incorrect
List all desired columns separated by commas to select them.