Question: Create the stored procedure and execution also needed. Create a table tbl_FlightDetails used to store the details of various flights tbl_FlightDetails consists of FlightNumber with
Create the stored procedure and execution also needed.
Create a table ‘tbl_FlightDetails’ used to store the details of various flights
tbl_FlightDetails consists of
FlightNumber with datatype Numeric(6)
DateofTravel with datatype Date
Source with datatype varchar(50)
Destination with datatype Varchar(50)
TicketCost with datatype Decimal(8,2)
TicketsAvailable with datatype Integer
And insert the values in the tbl_FlightDetails table.
And then create the stored procedure which performs the following operations on the table tbl_FlightDetails
Based on the FlightNumber, DateofTravel, Source, Destination and TicketsRequired the procedure must provide
TotalTicketCost based on the TicketsRequired and TicketCost. If the flight is available for the given source and destination for the specified date.
Update the TicketsAvailable column of the table based on the TicketsRequired if the required tickets are available.
If the required number of tickets are available it must return 0 else it must return -1.
If flight is not available for the specified date, source or destination it must return -2
Any other error, it must return -3.
Step by Step Solution
There are 3 Steps involved in it
To create the table tblFlightDetails and insert values into it you can use the following SQL statements sql CREATE TABLE tblFlightDetails FlightNumber ... View full answer
Get step-by-step solutions from verified subject matter experts
