Complete the code to select all columns from a table named employees.
SELECT [1] FROM employees;In SQL, * means select all columns from the table.
Complete the code to filter employees with salary greater than 50000.
SELECT * FROM employees WHERE salary [1] 50000;
The symbol > means 'greater than' in SQL conditions.
Fix the error in the code to count employees in each department.
SELECT department, COUNT([1]) FROM employees GROUP BY department;Using COUNT(*) counts all rows in each group, which is standard for counting employees.
Fill both blanks to create a table named products with id as primary key.
CREATE TABLE products (id [1] PRIMARY KEY, name [2] NOT NULL);
SERIAL creates an auto-incrementing integer for id. VARCHAR(100) defines a text column with max 100 characters for name.
Fill all three blanks to update the salary of employee with id 10 to 60000.
UPDATE employees SET salary = [1] WHERE id [2] [3];
We set salary to 60000, and use = to match employee with id 10.
