Loading

Quipoin Menu

Learn • Practice • Grow

sql / Updating Views
mcq
Direction: Choose the correct option

Q1.

Can all views be updated?
A. Yes, all views
B. Only indexed views
C. Only with CHECK OPTION
D. No, only simple views
Direction: Choose the correct option

Q2.

CREATE VIEW emp_basic AS SELECT id, name, salary FROM employees; UPDATE emp_basic SET salary = 75000 WHERE id = 101;
Will this update work?
A. Error
B. Yes, updates underlying table
C. Only SELECT allowed
D. No, view not updatable
Direction: Choose the correct option

Q3.

INSERT INTO emp_basic (id, name, salary) VALUES (110, 'New Emp', 50000);
What happens with updatable view?
A. Creates new view
B. No action
C. Error
D. Inserts into employees table
Direction: Choose the correct option

Q4.

DELETE FROM emp_basic WHERE id = 110;
What does this do with updatable view?
A. Removes view definition
B. Deletes from employees table
C. Error
D. Deletes view
Direction: Choose the correct option

Q5.

CREATE VIEW dept_stats AS SELECT dept_id, COUNT(*) FROM employees GROUP BY dept_id; UPDATE dept_stats SET ...
Will this update work?
A. Depends on database
B. Only SELECT works
C. Yes, updates work
D. No, view not updatable