20 likes | 112 Views
SELECT cust_id, reg_no, rent_date FROM Rent WHERE reg_no IN (SELECT reg_no FROM Car WHERE model_id = 6) SELECT cust_id, reg_no FROM Rent WHERE reg_no IN (SELECT reg_no FROM Car WHERE rate = 45) SELECT reg_no, model_id FROM Car WHERE rate IN (SELECT rate FROM Car
E N D
SELECT cust_id, reg_no, rent_date FROM Rent WHERE reg_no IN (SELECT reg_no FROM Car WHERE model_id = 6) SELECT cust_id, reg_no FROM Rent WHERE reg_no IN (SELECT reg_no FROM Car WHERE rate = 45) SELECT reg_no, model_id FROM Car WHERE rate IN (SELECT rate FROM Car WHERE reg_no = 'BAA-441') SELECT cust_id, Rent.reg_no, rent_date FROM Rent, Car WHERE model_id = 6 AND Rent.reg_no = Car.reg_no SELECT cust_id, Rent.reg_no FROM Rent, Car WHERE rate = 45 AND Rent.reg_no = Car.reg_no SELECT C1.reg_no, C1.model_id FROM Car AS C1, Car AS C2 WHERE C2.reg_no = 'BAA-441' AND C1.rate = C2.rate Solutions (Multitable)
SELECT C1.reg_no, C1.model_id FROM Car AS C1, Car AS C2 WHERE C2.rate <> 65 AND C1.reg_no = C2.reg_no SELECT cust_id, reg_no FROM Rent WHERE rent_date IN (#1-15-2005#, #1-26-2005#, #2-6-2005#) SELECT reg_no FROM Car, CarType WHERE year = 2004 AND CarType.model_id = Car.model_id SELECT * FROM Rent WHERE return_date IS NULL SELECT rent_id, (return_date - rent_date) * rate AS ‘total price’ FROM Rent, Car WHERE Rent.reg_no = Car.reg_no AND return_date IS NOT NULL Solutions