Complete the code to select unique city names from the customers table.
SELECT [1] city FROM customers;The DISTINCT keyword returns only unique values in the result set.
Complete the code to count how many unique product names are in the products table.
SELECT COUNT([1]) FROM products;Using COUNT(DISTINCT column) counts only unique values in that column.
Fix the error in the query to select unique customer IDs from orders.
SELECT [1] customer_id FROM orders;DISTINCT is the correct SQL keyword to get unique values. UNIQUE is not valid here.
Complete the code to select unique combinations of first and last names from employees.
SELECT [1] first_name, last_name FROM employees;DISTINCT is placed after SELECT and applies to all listed columns, returning only unique combinations of first_name and last_name.
Fill all three blanks to select unique department names and count employees in each department.
SELECT [1] department_name, COUNT([2]) FROM employees GROUP BY [3];
Use DISTINCT to get unique department names. COUNT(*) counts all employees per group. GROUP BY department_name groups rows by department.