UGC-NET Dec 2014 · SQL Queries

MCQ · 2 marks · Problem DBMS-SQL-0010

Division operation is ideally suited to handle queries of the type :
  1. A
    Customers who have no account in any of the branches in Delhi.
  2. B
    Customers who have an account at all branches in Delhi.
  3. C
    Customers who have an account in atleast one branch in Delhi.
  4. D
    Customers who have only joint account in any one branch in Delhi

Solve it on GATE DA practice →More Relational Model & SQL problems

Show the worked solution\[\boxed{R\div S=\{t\mid t\times S\subseteq R\}}\]Division answers "for all" queries. Here Account(customer, branch) \(\div\) \(\pi_{\text{branch}}(\sigma_{\text{city=Delhi}}(\text{Branch}))\) gives the customers who have an account at every Delhi branch.(A) "No account" needs set difference — incorrect.(C) "At least one" needs only a join or selection — incorrect.(D) is not a "for all" query either — incorrect.Answer: B

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com