Relational Database Contains Details Journeys India Variety Destinations Contains Followin Q43867184
A relational database contains details about journeys from Indiato a variety of
destinations and contains the following relations:
Operator (opCode, opName)
Journey (opCode, destinationCode,price)
Destination (destinationCode, destinationName,distance,averageFuelCost)
JourneyDetails(destinationCode, departureDate, departureTime,arrivalTime, fuelCost)
(a) Formulate the following queries using SQL:
(i) List the code and names of all destinations.
(ii) List the names of operators with at least one journey pricedunder Rs 2000.
(iii) List the codes of destinations whose price is below averageprice.
(iv) List of code and name of all operators. The list shouldinclude operators who do
not provide any journey also.
(b) Write a stored procedure UpdateAverageFuelCost() thatcalculates the average fuel
cost for each destination. The procedure should update the value ofthe
averageFuelCost in table Destination and should display thefollowing message:
The average fuel usage for Destination “X” is “Y “,
each time the average fuel cost is updated. The value of X is thedestination code
and Y is the average fuel cost for that particular destination.
Expert Answer
Answer to A relational database contains details about journeys from India to a variety of destinations and contains the following…
OR