Complete the code to create a view named 'active_users' that selects all columns from the 'users' table.
CREATE VIEW active_users AS SELECT * FROM [1];The view 'active_users' should select data from the 'users' table, so the correct table name is 'users'.
Complete the code to create a view named 'high_salary_employees' that selects employees with salary greater than 50000.
CREATE VIEW high_salary_employees AS SELECT * FROM employees WHERE salary [1] 50000;
The view should include employees with salary greater than 50000, so the correct operator is >.
Fix the error in the code to create a view named 'customer_emails' that selects only the email column from customers.
CREATE VIEW customer_emails AS SELECT [1] FROM customers;The column name is 'email', so selecting 'email' returns only that column. '*' selects all columns, which is not the goal.
Fill both blanks to create a view named 'recent_orders' that selects order_id and order_date from orders placed after 2023-01-01.
CREATE VIEW recent_orders AS SELECT [1], [2] FROM orders WHERE order_date > '2023-01-01';
The view should include 'order_id' and 'order_date' columns, so these are the correct selections.
Fill all three blanks to create a view named 'top_products' that selects product_name and price from products where price is greater than 100.
CREATE VIEW top_products AS SELECT [1], [2] FROM products WHERE [3] > 100;
The view selects 'product_name' and 'price' columns, and filters where 'price' is greater than 100.