1 / 2

SELECT cust_id, reg_no, rent_date FROM Rent WHERE reg_no IN (SELECT reg_no FROM Car

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

Download Presentation

SELECT cust_id, reg_no, rent_date FROM Rent WHERE reg_no IN (SELECT reg_no FROM Car

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 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)

  2. 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

More Related