UGC-NET Dec 2013 · Relational Algebra

MCQ · 2 marks · Problem DBMS-RELM-0012

Consider the following schemas: Branch=(Branch-name, Assets, Branch-city) Customer = (Customer-name, Bank name, Customer-city) Borrow = (Branch-name, Loan number, Customer account-number) Deposit = (Branch-name, Account-number, Customer-name, Balance) Using relational Algebra, the Query that finds customers who have balance more than 10,000 is
  1. A
    $\pi_{customer-name} (\sigma_{balance > 10000^{(Deposit)}}$)
  2. B
    $\sigma_{customer-name} (\sigma_{balance > 10000^{(Deposit)}}$)
  3. C
    $\pi_{customer-name} (\sigma_{balance > 10000^{(Borrow)}}$)
  4. D
    $\sigma_{customer-name} (\pi_{balance > 10000^{(Borrow)}}$)

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

Show the worked solutionBalances are stored in Deposit, so select the rows with balance over 10000 and project the customer names:\[\pi_{\text{customer-name}}\big(\sigma_{\text{balance}>10000}(\text{Deposit})\big).\](B) and (D) Selection \(\sigma\) takes a condition, not an attribute list, so they are ill-formed — incorrect.(C) Borrow has no balance attribute — incorrect.Answer: A

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