CS FundamentalsHardGATE CS · Product placement
Which view is generally updatable in standard SQL (an UPDATE through it maps to exactly one base row)?
- A. CREATE VIEW v AS SELECT dept, AVG(salary) FROM Emp GROUP BY dept
- B. CREATE VIEW v AS SELECT e.id, d.city FROM Emp e, Dept d WHERE e.dept = d.name
- C. CREATE VIEW v AS SELECT DISTINCT dept FROM Emp
- D. CREATE VIEW v AS SELECT id, name FROM Emp WHERE dept = 'IT'
Correct answer: D. CREATE VIEW v AS SELECT id, name FROM Emp WHERE dept = 'IT'
A view over one table with no DISTINCT, aggregation or grouping lets each view row map to a unique base row. Aggregates and DISTINCT collapse rows, and join views are generally not updatable.
More DBMS and SQL questions
- A B+ tree has at most 7 children per internal node and at most 6 keys per leaf. A non-root internal node must have at least ⌈7/2⌉…
- Consider the schedule W2(A), W2(B), R3(A), R3(B), W1(A), R1(B). Which statement is correct?
- R(A, B, C, D) has functional dependencies AC → D, A → D, CD → A, C → A, AB → CD. What is the highest normal form R satisfies?
- Extendible hashing uses the LOWEST-order bits of a key's binary value, bucket capacity 2, and starts with global depth 0 and one empty…
- Table Staff(id, name, dept, pay, boss) rows: (1, 'Anu', 'Ops', 40, NULL), (2, 'Bala', 'Ops', 55, 1), (3, 'Chitra', 'Tech', 70, 1), (4…
- R(A, B, C, D, E) with functional dependencies AB → C, BD → CE, A → B is decomposed into R1(C, D), R2(A, B, E). Which statement is correct?