-- This query deletes from the Laptop relation all laptops
-- made by a manufacturer that does not make printers.

DELETE
FROM  Laptop
WHERE model IN
      (SELECT model
       FROM   Product
       WHERE  maker IN
              (SELECT DISTINCT maker
               FROM   Product
               WHERE  maker NOT IN
                      (SELECT DISTINCT maker
                       FROM   Product
                       WHERE  type = 'printer'
                      )
              )
      );

-- This query uses the same subquery to delete the
-- same laptops from the Product relation.

DELETE
FROM  PRODUCT
WHERE type = 'laptop'
  AND model IN
      (SELECT model
       FROM   Product
       WHERE  maker IN
              (SELECT DISTINCT maker
               FROM   Product
               WHERE  maker NOT IN
                      (SELECT DISTINCT maker
                       FROM   Product
                       WHERE  type = 'printer'
                      )
              )
      );

