5 5
6
7
8
6
7
8
9 9
Capterra Cheap Air
Flight Gorilla
Opodo At airport
Amadeus
Expedia
3
3
2
4
1
1
3
2
3
5
2
4555
5
Picture 7.1
Question 8:
Create a stored procedure named P1 to calculate the number of bookings made by a given passenger where passenger_id int is the input parameter of the procedure and numberOfBookings int is the output parameter of the procedure.
For example, when we execute the procedure P1 with passenger_id = 1 by using the following statements, the result should be as in the following figure:
declare @x int
exec P1 1, @x output
select @x as NumberOfBookings
NumberOfBookings
1
Picture 8.1
1
Question 9:
Create a trigger named T1 for the delete statement on the "booking" table so that when we call a delete statement to delete one or more rows from the "booking" table, the system will automatically delete also from the "baggage" table all the baggage of the deleted bookings.
For example, if we call the following statement to delete 2 bookings with id = 10 and id = 11 from the "booking" table, all the rows with booking_id = 10 and booking_id = 11 must also be deleted from the "baggage" table.
delete from booking where id in (10,11)
Question 10:
Zoom
FUO
+ 81%
Close