Question
Using the KCT design shown below, code SQL statements for the following. KCT _CUSTOMER(CustomerID, FirstName, LastName, Street, City, State, Zip, Phone) KCT _RENTAL(RentalID, RentalDate,NumberOfDays, RentalAmount,
Using the KCT design shown below, code SQL statements for the following.
KCT _CUSTOMER(CustomerID, FirstName, LastName, Street, City, State, Zip, Phone)
KCT _RENTAL(RentalID, RentalDate,NumberOfDays, RentalAmount, Deposit, Tax, TotalAmount, CustomerID, ReturnDate, AmountReturned)
KCT _LINEITEM(RentalID, CostumeID, Rate, Deposit)
KCT _COSTUMETYPE(TypeID, Description, Photo, DailyRentalRate, DepositRate, ReplacementCost)
KCT _COSTUME(CostumeID, Size, Availability, DatePurchased, CostumeType)
Question:
A. List the names and phone numbers of all customers who have a rental with a non-null (or greater than zero) TotalAmount and a null ReturnDate. Use a subquery.
B. Same as above, but use join within the WHERE clause.
C. Same as above, but use join with the JOIN ON syntax
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started