Complete the code to select all columns from the users table.
SELECT [1] FROM users;The asterisk (*) selects all columns from the table, which is the simplest way to retrieve all data.
Complete the code to filter users with age greater than 30.
SELECT * FROM users WHERE age [1] 30;
The '>' operator filters rows where age is greater than 30, which matches the requirement.
Fix the error in the query to count users grouped by country.
SELECT country, COUNT(*) [1] users GROUP BY country;The FROM keyword specifies the table to select data from, which is required before GROUP BY.
Fill both blanks to optimize the query by indexing the age column and filtering efficiently.
CREATE INDEX [1] ON users([2]);
Creating an index named 'idx_users_age' on the 'age' column speeds up queries filtering by age.
Fill all three blanks to write a query that selects user names, filters by age greater than 25, and orders results by name ascending.
SELECT [1] FROM users WHERE age [2] 25 ORDER BY [3] ASC;
Selecting 'name', filtering with '>' for age, and ordering by 'name' ascending produces the desired result efficiently.