Question: SELECT CID, CNAME FROM CUSTOMER WHERE EXISTS (SELECT CID FROM RENTALS WHERE CUSTOMER.CID = RENTALS.CID AND PICKUP = 'CARY') The execution of this query lists

SELECT CID, CNAME FROM CUSTOMER WHERE EXISTSSELECT CID, CNAME FROM CUSTOMER WHERE EXISTS

SELECT CID, CNAME FROM CUSTOMER WHERE EXISTS (SELECT CID FROM RENTALS WHERE CUSTOMER.CID = RENTALS.CID AND PICKUP = 'CARY') The execution of this query lists the following CNAMES: = = BLACK BLACK, JONES, MARTIN BLACK, GREEN, JONES, MARTIN, SIMON BLACK, GREEN, JONES, MARTIN, SIMON, VERNON Car Rental Database CUSTOMER CID CNAME 10 BLACK 20 GREEN 30 JONES 40 MARTIN 50 SIMON 60 VERNON AGE 40 25 30 35 22 60 RESID CITY ERIE CARY HEMET HEMET ERIE CARY BIRTHPLACE TAMPA ERIE TAMPA TAMPA ERIE CARY In table CUSTOMER, CID is the primary key (Customer ID). RENTALS CID MAKE 10 FORD 10 GM 10 FORD 20 NISSAN 30 FORD 30 GM 40 FORD 50 GM 70 TOYOTA DATE OUT PICKUP 10-Oct-1994 CARY - 01-Nov-1995 TAMPA 01-Jan-1995 ERIE 07 Jul-1994 TAMPA 01 Jul-1995 CARY 01-Aug-1995 ERIE 01-Aug-1994 CARY 01-Sep-19/95 ERIE 02-Sep-1995 RENO RETURN CARY CARY ERIE TAMPA ERIE ERIE ERIE CARY RENO RTN 1 2 13 14 15 16 17 8 19 In the table RENTALS, RIN provides the rental number (the primary key), CID is the customer's unique id, PICKUP is the city where the car was picked up, and Return is the city where the car was returned. RENTCOST MAKE FORD GM NISSAN TOYOTA VOLVO COST 30 40 30 20 50 RENTCOST shows the base cost of renting a given MAKE for one day. CITYADJ CITY CARY ERIE RENO TAMPA FACTOR 1 1.1 0.9 0.8 If the return city of table RENTALS is the one listed in table CITYADJ, the cost of the rental is multiplied by FACTOR and by DAYS shown in table RENTLENGTH below. RENTLENGTH RIN 1 2 3 4 4 5 6 7 8 DAYS 1 3 2 2 4 2 3 RENTLENGTH shows the number of days for the rental number (RTN) shown in table RENTALS. In a database used in reality, this table would be merged with the RENTALS table

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related General Management Questions!