search
Log In
0 votes
160 views

Suppose there are two tuples in Animals relation with different IDs but of same type and in Adoption table there is a tuple with an ID that matches with the  ID of first tuple in Animal relation. AND during the query evaluation, the type of first tuple of the animal relation will not be selected whereas the SQL query will select type of second tuple of animal relation as there is no tuple in ADoption that have same Id as of second tuple of Animal relation . 

Hence this is wrong to say that Distinct type of animals will be selected who have not had any adoption? right?

 

I know my answer is wrong here for the case when all Ids of the same type are also present in Adoption table . but the thing is given answer is also wrong here. 

Correct me if i’m wrong.

in Databases 160 views
0

Hence this is wrong to say that Distinct type of animals will be selected who have not had any adoption? right?

yes, they given wrong answer.

 

Simply the query returns

Distinct Types of the animals which there should be atleast one animal is not adopted !

     or

Distinct Types of the animals which all animals of that type are not adopted !

0
Please edit the question, type the required text instead of screenshot.

please avoid unnecessary usage of screenshots !
0
I don't know what's the problem here but really brother it is very helpful to post a screenshot than typing the whole question as it saves more time and removes any confusion to readers :)

Thanks for ur answer.
0
we can't find duplicates if you post screen shots....

there are more number of questions already present in GO, there is a high probability ( due most of the persons posting test series questions which are repeated by test series organizations ) that your question already been asked, and answered by someone.

Please log in or register to answer this question.

Related questions

0 votes
1 answer
1
380 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 380 views
0 votes
0 answers
2
204 views
a) 0 b) 1 c) 2 d) 3
asked Sep 15, 2018 in Databases Nirmal Gaur 204 views
0 votes
2 answers
3
229 views asked Jul 14, 2018 in Databases Na462 229 views
1 vote
1 answer
4
254 views
Consider relational schema $R(A,B,C)$ and $S(A,B,C)$ $1)$ Select * from $R$ where $(A,B,C)$ in (Select * from $S$) $2)$ Select * from $R$ where exists ( Select * from $S$ where R.A=S.A and R.B=S.B and R.C=S.C) $3)$ Select * from R where $(A,B,C)$ not in((Select * from $R$ where $(A,B,C)$ not in)Select * from S) Which of the following SQL expression equal to $R\cap S$?
asked Jun 5, 2018 in Databases srestha 254 views
...