Databases Write an SQL statement to display the names of the MANUFACTURERs who d
ID: 3592392 • Letter: D
Question
Databases
Write an SQL statement to display the names of the MANUFACTURERs who do not have any models in the COMPUTER table using these tables,
MANUFACTURER Name Dell IBM Gatewa Apple COMPUTER Model SerialNumber|Make 9870 8590 7840 4870 EmpNo 123 456 123 789 State TX ListPrice 649.99 Austin White Plains NY Sioux Cit Cupertino Gateway Apple Dell Dell DX4850 IA CA eMacBook Air Alienware XPS 899.00 799.99 EMPLOYEE EmploveelD 123 456 789 EmpName Salarv Uc Charlie Linus Pat 500,000 600,000 300,000 200,000 HireDate 01/02/1993 02/03/1992 01/25/1995 11/23/2003Explanation / Answer
select name from Manufacturer where name NOT IN(select Make from Computer);
this query will give the desired result.
for each row returned by the outer query "select name from Manufacturer" inner query will be executed.
for example for the 1st row of outer query , Name = Dell
select Make from Computer will return Gateway,Apple,Dell,Dell
so according to where condition we want only those names from manufacturer which is not availabel in Computers table.
So Dell is availabel in Computers so it will ot be returned as a final result.
Output of the query would be.
Name
IBM
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.