The Gateway to Computer Science Excellence
+1 vote

Why Q1 not correct? Because it is fetching any red part and not every red part,right??

Why Q2 is not correct query? It takes  2 tables and comparing. Is it not fetching single red value?

in Databases by Veteran (119k points) | 96 views
I think Q2 will be correct had it been NOT EXIST because if a supplier supplies all red parts then the inner query will result in NULL set and NOT EXIST would have returned true.
both are incorrect.

Q1: Sid's will be selected if there is no red color part or there is only one red color part and supplier sells that red color part

Q2 Sid's who does not sell at least one red color part.

hence both Q1 and Q2 are incorrect.

chk this example

If we consider these two tables

According to question, we should return S3

but Q1 returning S1, S2, S3

and Q2 returning nothing


which one ?
sorry computer making problem

Please log in or register to answer this question.

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,737 questions
57,321 answers
105,142 users