Complete the code to create a simple 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 correct value is '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 view definition by completing the missing keyword.
CREATE [1] active_users AS SELECT * FROM users WHERE status = 'active';
The keyword 'VIEW' is required to create a view in PostgreSQL.
Fill both blanks to create a view that shows orders with amount greater than 100.
CREATE [1] high_value_orders AS SELECT * FROM orders WHERE amount [2] 100;
We create a VIEW named 'high_value_orders' and filter orders where amount is greater than 100 using '>'.
Fill all three blanks to create a view that shows product names and prices where price is less than 50.
CREATE [1] affordable_products AS SELECT [2], price FROM products WHERE price [3] 50;
We create a VIEW named 'affordable_products', select 'name' and 'price' columns, and filter where price is less than 50 using '<'.