Complete the code to select all records from the users table.
SELECT * FROM [1];The table name is users. Using SELECT * FROM users; retrieves all records.
Complete the code to find users with age greater than 30.
SELECT * FROM users WHERE age [1] 30;
The operator > means 'greater than'. So, age > 30 finds users older than 30.
Fix the error in the query to count users by city.
SELECT city, COUNT(*) AS user_count FROM users GROUP BY [1];Grouping by city counts users per city. Grouping by other columns won't group correctly.
Fill both blanks to find users whose name starts with 'A' and order by age descending.
SELECT * FROM users WHERE name [1] 'A%' ORDER BY age [2];
Use LIKE 'A%' to find names starting with 'A'. Use ORDER BY age DESC to sort from oldest to youngest.
Fill all three blanks to create a new table named 'employees' with columns 'id' (integer primary key), 'name' (text), and 'salary' (decimal).
CREATE TABLE [1] (id [2] PRIMARY KEY, name [3], salary DECIMAL(10,2));
The table name is employees. The id column is an INTEGER primary key. The name column is VARCHAR(100) type.