Question: You are developing a system for storing information about car rides. You have the following queries for creating type and object table. CREATE TYPE RIDE
You are developing a system for storing information about car rides. You have the following queries for creating type and object table.
CREATE TYPE RIDE AS OBJECT( RIDE_ID NUMBER, CAR VARCHAR2(30), DISTANCE NUMBER, FUEL_CONSUMPTION NUMBER, FUEL_PRICE NUMBER )
CREATE TABLE JOURNEYS OF RIDE (PERSONAL_ID PRIMARY KEY )
Your system must provide a report with ride ID, car and distance that is sorted descending by the expenses of the ride. If the distance is above 100 km, Expenses should be calculated by multiplying fuel consumption, distance and fuel price. Otherwise a flat rate of 10 EUR is used. Write the following queries: 1) Extend the query for the type declaration to enable creating such report. the attributes of the type must remain unchanged (2 points); 2) Create Type body with the necessary method to create such a report (4 points); 3) Write a query to retrieve ride ID, car and distance and sort it descending by the total expenses (2 points).
Use the features of ORDB in this task!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
