Complete the code to create a view named 'employee_view' that shows only the 'name' and 'salary' columns from the 'employees' table.
CREATE VIEW employee_view AS SELECT [1] FROM employees;The view should include only the 'name' and 'salary' columns, so the SELECT statement must specify these columns.
Complete the code to select all data from the view named 'employee_view'.
SELECT [1] FROM employee_view;Using '*' selects all columns available in the view.
Fix the error in the code that tries to create a view with a WHERE clause filtering salary greater than 50000.
CREATE VIEW high_salary_view AS SELECT name, salary FROM employees WHERE salary [1] 50000;
The condition should filter salaries greater than 50000, so the operator must be '>'.
Fill both blanks to create a view named 'dept_view' that shows 'name' and 'department' columns only for employees in the 'Sales' department.
CREATE VIEW dept_view AS SELECT [1] FROM employees WHERE [2] = 'Sales';
The view should show 'name' and 'department' columns, and filter rows where 'department' equals 'Sales'.
Fill all three blanks to create a view named 'secure_view' that shows uppercase employee names, their salary, and filters salaries greater than 60000.
CREATE VIEW secure_view AS SELECT [1] AS name_upper, [2] FROM employees WHERE [3] > 60000;
The view selects the uppercase version of 'name' as 'name_upper', includes 'salary', and filters salaries greater than 60000.