Complete the code to rename the column 'price' as 'cost' in the output.
SELECT price [1] cost FROM products;In SQL, the keyword AS is used to give a column a new name (alias) in the result.
Complete the code to rename the result of the expression 'price * quantity' as 'total_cost'.
SELECT price * quantity [1] total_cost FROM sales;The AS keyword is used to assign an alias to the expression result.
Fix the error in the code to correctly alias the column 'name' as 'product_name'.
SELECT name [1] product_name FROM inventory;The correct alias keyword is AS. Also, the query needs a semicolon at the end, but the task focuses on the alias keyword.
Fill both blanks to rename the column 'salary' as 'monthly_salary' and filter rows where salary is greater than 3000.
SELECT salary [1] monthly_salary FROM employees WHERE salary [2] 3000;
Use AS to alias the column and > to filter salaries greater than 3000.
Fill all three blanks to select the column 'age' aliased as 'user_age', filter users older than 18, and order the results by 'user_age' ascending.
SELECT age [1] user_age FROM users WHERE age [2] 18 ORDER BY [3] ASC;
Use AS to alias, > to filter ages greater than 18, and order by the alias user_age.