search
Log In
0 votes
238 views

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

in Databases 238 views
0
mention that original question link too in your question itself !
0

@Shaik Masthan i came through quite a lot of problems as  similar to Query3  but i never considered that duplicate ; 

but i think that the query will return duplicates too as it is sql query and moreover "Select distinct" is not used Here.

I want your opinion on this question

1

this question was duplicate of https://gateoverflow.in/147567

i written answer there @newdreamz a1-z0

0
invalid link

Please log in or register to answer this question.

Related questions

1 vote
0 answers
1
213 views
Consider the employee database shown here. Give expressions in tuple relational calculus and domain relational calculus for each of the following queries: a. Find the names of all employees who work for First Bank Corporation . b. Find the names and cities of residence of ... street, city ) works (person name, company name, salary) company (company name, city) manages (person name, manager name)
asked Mar 26, 2019 in Databases ajaysoni1924 213 views
1 vote
1 answer
2
366 views
Consider the relational database given below where the primary keys are underlined. Give an expression in tuple relational calculus for each of the following queries: a. Find all employees who work directly for Jones. b. Find all cities of residence of all employees who ... street, city ) works (person name, company name, salary) company (company name, city) manages (person name, manager name)
asked Mar 26, 2019 in Databases ajaysoni1924 366 views
0 votes
1 answer
3
388 views
According to me it should be – “Retrieve the names of all students with a lower rank, than all students with age < 18 ”
asked Dec 24, 2018 in Databases Shubhanshu 388 views
0 votes
1 answer
4
208 views
Consider the following relational schema : Employee ( Empid, Deptid, Salary ) Department ( Deptid, DeptName ) What does the following query return ? Query_1 :- Select D.DeptName From Department D Where ( Select COUNT(*) From Employee E where E.Deptid = D.Deptid and E.Salary ... the query return same output ?? in second query what is mean by min(dept.name ) is it count having minimum dept name ?
asked Dec 5, 2018 in Databases vijju532 208 views
...