Skip to content
Advertisement

SELECT Brand and Model for cars which have been rented in December 2000?

There is a table called Car with columns CarID, Brand, Model, ProdYear, Color and a table Rent with columns RentID, CarID, RentDate, ReturnDate.

How to SELECT Brand and Model for cars which have been rented in December 2000?

RentDate and ReturnDate are stored in DATETIME format (YYYY-MM-DD)

Advertisement

Answer

For a simplistic scenario:

If you want to dig further and the following will cover four scenarios:

  1. Rented earlier but returned in the year of Dec 2000
  2. rented in 2000 and returned after Dec 2000
  3. Rented in 2000 and returned also in Dec 2000
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement