0
0
SQLquery~10 mins

SELECT specific columns 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 select only the 'name' column from the 'employees' table.

SQL
SELECT [1] FROM employees;
Drag options to blanks, or click blank then click option'
Aname
B*
Csalary
Demployees
Attempts:
3 left
💡 Hint
Common Mistakes
Using '*' selects all columns instead of just 'name'.
Writing the table name instead of the column name.
2fill in blank
medium

Complete the code to select the 'id' and 'email' columns from the 'users' table.

SQL
SELECT id, [1] FROM users;
Drag options to blanks, or click blank then click option'
Aemail
Baddress
Cusername
Dpassword
Attempts:
3 left
💡 Hint
Common Mistakes
Selecting unrelated columns like 'password' or 'address'.
Forgetting the comma between column names.
3fill in blank
hard

Fix the error in the code to select the 'product_name' column from the 'products' table.

SQL
SELECT [1] FROM products;
Drag options to blanks, or click blank then click option'
A*;
Bproduct_name;
Cproduct_name
Dproducts;
Attempts:
3 left
💡 Hint
Common Mistakes
Leaving out the semicolon at the end.
Putting the semicolon in the wrong place.
4fill in blank
hard

Fill both blanks to select 'first_name' and 'last_name' columns from the 'customers' table.

SQL
SELECT [1], [2] FROM customers;
Drag options to blanks, or click blank then click option'
Afirst_name
Bemail
Clast_name
Dphone
Attempts:
3 left
💡 Hint
Common Mistakes
Selecting unrelated columns like 'email' or 'phone'.
Forgetting the comma between column names.
5fill in blank
hard

Fill all three blanks to select 'title', 'author', and 'year' columns from the 'books' table.

SQL
SELECT [1], [2], [3] FROM books;
Drag options to blanks, or click blank then click option'
Aauthor
Btitle
Cyear
Dpublisher
Attempts:
3 left
💡 Hint
Common Mistakes
Selecting columns in the wrong order.
Including columns not asked for like 'publisher'.