Complete the SQL query to select only the 'name' column from the 'students' table.
SELECT [1] FROM students;The projection operation in SQL is done using the SELECT statement with the column names you want to retrieve. Here, selecting 'name' returns only that column.
Complete the SQL query to select the 'id' and 'email' columns from the 'users' table.
SELECT id, [1] FROM users;To project multiple columns, list them separated by commas after SELECT. Here, 'email' is the second column to select.
Fix the error in the SQL query to select the 'title' column from the 'books' table.
SELECT [1] FROM booksSQL statements must end with a semicolon. Adding ';' after 'title' fixes the syntax error.
Fill both blanks to select the 'first_name' and 'last_name' columns from the 'employees' table.
SELECT [1], [2] FROM employees;
To project multiple columns, list their names separated by commas after SELECT. Here, 'first_name' and 'last_name' are the correct columns.
Fill all three blanks to select the uppercase 'city' name, the 'population', and only cities with population greater than 100000 from the 'cities' table.
SELECT [1](city) AS city_upper, [2] FROM cities WHERE population [3] 100000;
The UPPER function converts city names to uppercase. We select 'population' as the second column. The WHERE clause filters cities with population greater than 100000 using '>'.