CS FundamentalsVery hardGATE CS (PYQ pattern)
The owner O of a table issues, in this order (with GRANT OPTION each time): 1) O grants SELECT to A; 2) O grants SELECT to B; 3) A grants to C; 4) B grants to C; 5) C grants to D; 6) A grants to E. Then O executes REVOKE SELECT FROM A with cascade. Using the usual rule that a privilege survives only if it can be derived from the owner through a chain of earlier grants, which users still hold SELECT afterwards?
- A. B, C, D
- B. B and C only
- C. B, C, D and E
- D. B only
Correct answer: A. B, C, D
A and E lose it (E's only source was A). C also received it from B at step 4, before granting to D at step 5, so C keeps it and D's grant stays valid: B, C and D remain.
More DBMS and SQL questions
- ACC(id, bal): (1,100), (2,200), (3,300), (4,400). A row-level trigger AFTER UPDATE ON ACC FOR EACH ROW WHEN NEW.bal > 250 inserts (NEW.id…
- K(a UNIQUE, b CHECK (b > 0)) is empty. These rows are inserted one by one, ignoring any row that violates a constraint: (1,5), (1,6)…
- G(g, x): (a,5), (a,7), (b,4), (b,4), (b,4), (c,20), (d,NULL), (d,1). How many groups does SELECT g FROM G GROUP BY g HAVING SUM(x) >…
- SALE(r, q, amt): (n,1,10), (n,2,30), (s,1,5), (s,2,5), (s,3,5), (e,1,50). View V is SELECT r, SUM(amt) AS tot, COUNT() AS c FROM SALE…
- A Grace hash join partitions both inputs into B - 1 partitions using one input page per partition plus one input buffer; in the probe…
- A table has 1,000,000 rows in 10,000 pages. An unclustered B+ tree index of height 3 costs 3 page reads to reach the first matching entry…