Find all PC’s makers which doesn’t produce laptops

–Find all PC’s makers which doesn’t produce laptops
 
1. SELECT DISTINCT maker
FROM product WHERE
maker NOT IN (SELECT maker FROM product WHERE type =
‘LAPTOP’)
AND type = ‘PC’
 
2. SELECT DISTINCT p1.maker
FROM         product AS p1 LEFT OUTER JOIN
                      product AS p2 ON p1.maker = p2.maker AND p2.type =
‘Laptop’
WHERE     (p1.type = ‘PC’) AND (p2.maker IS NULL)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s