Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Can you please write SQL following queries based on below ER diagram ( Assume yo

ID: 3743076 • Letter: C

Question

Can you please write SQL following queries based on below ER diagram (Assume you have already created DB tables)?

Assignment 1 Sample Solution ER model QRentals database system LOCATION Location Name Address Pick upDrop off CAR INSURANCE RENTAL Full Name BirthDate Address/Phone StartDate End Date [Cost] Make&Model NumOfSeats ManufacturedYear Carlmage PolicyN InsurerName Premium StartDate ExpiryDate CustomerType Associated Belong to Cust Type" BOOKING VEHICLECATEGORY CategoryID CategoryName Daily hire rate Description CORPORATE INDVIDUAL OrgnizationName ABN Personal Life Insured Travel special deal Process EMPLOYEE FullName BirthDate Phone SkillLevel AnnualSalary

Explanation / Answer

If you have any doubts, please give me comment...

1)

SELECT RegoNo, make, model, NumOfSeats, ManufacturedYear, CategoryID, CategoryName, DailyHireDate

FROM CAR C, VEHICLE_CATEGORY V

WHERE C.CategoryID = V.CategoryID;

2)

SELECT EmployeeID, FullName, LocationName, COUNT(*) AS no_of_bookings

FROM EMPLOYEE E, LOCATION L

WHERE E.LocationID = L.LocationID

GROUP BY EmployeeID, FullName, LocationName

ORDER BY no_of_bookings DESC;

3)

SELECT FullName, Phone, BookingDate

FROM CUSTOMER C, BOOKING B

WHERE C.CustomerID = B.CustomerID;

4)

SELECT FullName, RegoNo, make, model, StartDate, EndDate, Cost

FROM CUSTOMER C, CAR CR, RENTAL R

WHERE C.CustomerID = R.CustomerID AND CR.RentalID = R.RentalID;

5)

SELECT FullName, P.LocationName, D.LocationName, StartDate, EndDate, Cost

FROM CUSTOMER C, RENTAL R, LOCATION P, LOCATION D

WHERE C.CustomerID = R.CustomerID AND R.PickUpLocationID = P.LocationID AND R.DropOffLocationID = D.LocationID;

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote