1,046 views
0 0 votes

Let Depositor and Lender be relational schemas such that Depositor = {a/c number, cname , balance, branch} and Lender ={loan_number ,cname, amount , branch}. 

Now consider the following queries on the database :

Query 1 : ( t | ∃D ∈Depositor ( t.cname = D.cname ) ∧  ∃L ∈Lender ( t.cname = L.cname ) ) 

Query 2 : ( ( πcname Depositor )  ∩ ( πcname  Lender ) ) 

Query 3 : Select cname from Depositor d where exists ( select * from Lender l where l.cname = d.cname ) ;

Which of the following is a false statement ?

  1. Query 1 and Query 2 gives same result 
  2. Query 2 and Query 3 gives same result 
  3. Query 1 and Query 3 gives same result 
  4. Query 1, Query 2 and Query 3 gives different results

Ans: 4
Doubt:
What will be the output of query 1
I think it will return only the tuples with only cname as column where D.cname  = L.cname(with no duplicates)
Output of query 2
Single column table containing cname where D.cname = L.cname(No duplicates)
Output of Query 3
Single column table containing cname where D.cname = L.cname(Containing duplicates)



PS: I’ll merge this with the original question when my doubts are cleared

Please log in or register to answer this question.

Position:
Show:

Related questions

0 0 votes
1 1 answer
97
97 views
GO Classes asked Sep 29
97 views
Consider the relation $\mathrm{Sailors}(\mathrm{sid},\mathrm{sname},\mathrm{rating},\mathrm{age})$ and the following TRC expression: $$\{S\mid \neg(S\in \mathrm{Sailors})...
0 0 votes
1 1 answer
72
72 views
GO Classes asked Sep 29
72 views
Consider $\mathrm{Student}(\mathrm{sid},\mathrm{name},\mathrm{univ}),\mathrm{Enrollment}(\mathrm{sid},\mathrm{cid}).$Using the above schema, which condition correctly cha...
0 0 votes
1 1 answer
76
76 views
GO Classes asked Sep 29
76 views
Consider$\mathrm{Course}(\mathrm{cid},\mathrm{name},\mathrm{year},\mathrm{duration})$$\mathrm{Student}(\mathrm{sid},\mathrm{name},\mathrm{univ})$$\mathrm{Instructor}(\mat...
1 1 vote
1 1 answer
78
78 views
GO Classes asked Sep 29
78 views
Using the same $\mathrm{Manager}$, $\mathrm{Stores}$, $\mathrm{Sales}$, and $\mathrm{Products}$ schema from the exam, define:$\mathrm{NailSale}(S)$ = store $S$ sold more ...