Complete the code to create a view named 'active_users' that shows users with status 'active'.
CREATE VIEW active_users AS SELECT * FROM users WHERE status = '[1]';
The view filters users with status 'active'. So the condition must be 'active'.
Complete the code to select all columns from the view 'active_users'.
SELECT [1] FROM active_users;Using '*' selects all columns from the view.
Fix the error in the code to drop the view named 'active_users'.
DROP [1] active_users;To remove a view, use 'DROP VIEW'. Using 'DROP TABLE' or others causes errors.
Fill both blanks to create a view named 'high_salary' showing employees with salary greater than 50000.
CREATE [1] high_salary AS SELECT * FROM employees WHERE salary [2] 50000;
The keyword to create a view is 'VIEW'. The condition to filter salaries greater than 50000 uses '>'.
Fill all three blanks to select employee names and salaries from the 'high_salary' view where salary is less than 70000.
SELECT [1], [2] FROM high_salary WHERE salary [3] 70000;
Select 'name' and 'salary' columns, and filter salaries less than 70000 using '<'.