The following tables form part of a Car Rental database held in
a Relational Database
Management System:
Customer(CustomerNo, FirstName, LastName, StreetNo,
StreetName,
Suburb, Postcode, City, State, TelephoneNo)
Driver(LicenceNo, FirstName, LastName)
Vehicle(RegistrationNo, RentalPrice, Make, Model, BranchNo)
Rental(RentalNo, CustomerNo, RegistrationNo, BorrowingDate,
ReturnDate, ActualReturnDate, StaffNo, LicenceNo)
Staff(StaffNo, FirstName, LastName, StreetNumber, StreetName,
Suburb,
Postcode, City, Country, BusinessTelephoneNo,
HomeTelephoneNo,
Salary, Position, Gender, BranchNo)
Branch(BranchNo, BranchName, StreetNumber, StreetName,
Suburb,
Postcode, City, Country, ManagerId)
Write the following queries using SQL:
a) List the details of all Customers order by
CustomerNo.
b) List the details of all Customers living in postcodes 2615 or
2617 or 2913.
c) List the details of all rentals order by CustomerNo.
d) How many Vehicles with Make = Toyota?
e) List the details of all Vehicles that have a RentalPrice greater
than or equal to 70 and
less than or equal 150.
f) List details of branches with BranchName that starts with
‘P’.
g) List the names of all staff, their City and street address,
their country name, and the
name of the branch they work in. [3 Marks]
h) List the average salary of staff per branch .
i) List the details of the staff member with maximum salary.
j) List the name of each branch and the name of its manager
including the branches
without a manager.
k) List the registration number, make and model of the car with the
highest number of
rentals.
The following tables form part of a Car Rental database held in a Relational Database Management System: Customer(Custo
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am