Question: Please create a PL / SQL procedure which creates a new trip. The input includes a ride request ID , a driver ID , and
Please create a PLSQL procedure which creates a new trip. The input includes a ride request ID a driver ID and a car ID
it first checks whether there is a ride request with the input ID If there is no such request, print a message 'Invalid request ID and stop.
it then checks whether there is a row in drivercar that matches the input driver ID and car ID
If there is no such a row, print a message 'Invalid car ID or driver ID and stop.
if all input IDs are valid, insert a new row into the trip table, with a newly generated trip ID input rider request ID input driver ID input car ID and starttime as current time systimestamp Endtime, fare, and rating are null.
Print out the newly generated trip ID
Hint: create a sequence to generate a new trip ID
Please call this procedure with an invalid input and a valid input.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
