Trigger , Database Management System

Assignment Help:

Flights(FlightNo, DeptDateTime, Origin, ArrivalDateTime, Destination, Capacity, SoldSeats) Tickets(FlightNo, Seat, CustID)

Where
- flightNo is the PK of the flights table
- DeptDateTime holds the date and time of the flights departure
- Origin holds the airport code (e.g. RKE) of the flights origin
- ArrivalDateTime holds the date and time of the flights arrival
- Destination holds the airport code (e.g. ATL) of the flights destination
- Capacity is the number of passenger seats the flight can hold
- SoldSeats is the number of seats that are currently sold

- FlightNo+Seat is the PK of the Tickets Table
- FlightNo in the Tickets Table is an FK referencing the Flights Table
- Seat is the seat assigned to that ticket (e.g. 7B)
- CustID is the ID number of the customer that is assigned to that seat

Write a trigger or triggers that:
- increments the SoldSeats field when a ticket is inserted
- raises an exeception when an attempt to insert a ticket occurs
  if the flight is already sold out
- decrements the SoldSeats field when a ticket is deleted

To provide appropriate transaction control your trigger should lock the associated flight row in the flights table before attempting to update the SoldSeats field.

Add sample data and test your triggers.

Have your triggers finished with some sample data entered by the start of class on November 16th.


Related Discussions:- Trigger

Create table to evaluating websites-reasoning, Have a look around the site,...

Have a look around the site, and at some of the sites they have featured. These are all examples of bad design, and also offer an explanation about why they fall into this category

Mysql database merge, MySQL Database Merge Project Description: I hav...

MySQL Database Merge Project Description: I have two databases, I need merge the data of one database into another Work to be done online right now. Payment can be done

Two phase locking (2pl), Two Phase Locking (2PL) The two-phase locking ...

Two Phase Locking (2PL) The two-phase locking protocol having of two phases: Phase 1 : The lock acquisition phase : If a transaction T needs to read an object, it wants to

Job scheduling strategy, 1) Define a job scheduling strategy that will meet...

1) Define a job scheduling strategy that will meet business requirement of reporting availability by 6am CST for the following cubes? Show the job scheduling dependencies in a pict

What are the drawbacks of shadow-paging technique, What are the drawbacks o...

What are the drawbacks of shadow-paging technique? The drawbacks of shadow paging is:- a) Commit Overhead b) Data fragmentation c)  Garbage collection

Mention the various user privileges, Mention the various user privileges ...

Mention the various user privileges All privileges directly granted to the user or role. All privileges granted to roles that have been granted to the user or role.

Determine the two special events, What are two special events? The two ...

What are two special events? The two special events are as "entry" and "exit". Any action which is marked as linked to entry event is executed whenever given state is entered v

Frequecy count, how to calculate frequency count of algorithm

how to calculate frequency count of algorithm

What is a database graph, What is a database graph? The partial orderin...

What is a database graph? The partial ordering implies that the set D may now be viewed as a directed acyclic graph, known as a database graph.

Transaction, Draw the precedence graph of the following schedule and determ...

Draw the precedence graph of the following schedule and determine whether the schedule is serializable. (Note that all instructions, except lock and unlock, are omitted. We assume

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd