search
Log In
1 vote
155 views

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 155 views
1
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.
1
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.
0

@joshi_nitish
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

Right??

0
which one ?
0
sorry computer making problem

Please log in or register to answer this question.

Related questions

1 vote
3 answers
1
316 views
Class(name, meets_at, room, fid) Faculty(fid, fname, deptid) Find the names of faculty members who teach in every room in which some class is taught
asked May 18, 2019 in Databases aditi19 316 views
0 votes
0 answers
2
266 views
Product(maker, model, type) PC(model, speed, ram, hd, price) Laptop(model, speed, ram, hd, screen, price) Printer(model, color, type, price) Find the maker(s) of the PC(s) with the fastest processor among all those PC 's that have the smallest amount of RAM pls check if my SQL ... p.model from PC p where p.speed IN( select max(p1.speed) from PC p1 where p1.ram IN( select MIN(p2.ram) from PC p2)))
asked May 8, 2019 in Databases aditi19 266 views
0 votes
0 answers
3
193 views
I got why query 2 is wrong. How do I approach to understand Query 1, is there a generic approach for solving questions like these which have no tables given?
asked Jan 8, 2019 in Databases amitqy 193 views
0 votes
1 answer
4
386 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 386 views
...