Complete the code to create a simple updatable view showing employee names and salaries.
CREATE VIEW employee_salaries AS SELECT name, [1] FROM employees;The view should select the salary column to show employee salaries.
Complete the code to update the salary of an employee through the view.
UPDATE employee_salaries SET [1] = 60000 WHERE name = 'John';
To update the salary, set the salary column in the view.
Fix the error in the view definition to make it updatable by removing the aggregate function.
CREATE VIEW avg_salary AS SELECT department, [1] FROM employees;Aggregate functions like AVG make views non-updatable. Use the raw column salary instead.
Fill both blanks to create an updatable view that filters employees by department.
CREATE VIEW [1] AS SELECT name, salary FROM employees WHERE [2] = 'Sales';
The view name should reflect its content, like sales_employees. The filter column is department.
Fill all three blanks to create an updatable view that shows employee names in uppercase and filters by salary.
CREATE VIEW [1] AS SELECT [2](name) AS name_upper, salary FROM employees WHERE salary [3] 50000;
The view is named high_earners to reflect the salary filter. Use UPPER to convert names to uppercase. The filter uses > to select salaries above 50000.