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

Explain the function of input controls, Explain the function of input contr...

Explain the function of input controls. Identify four types of input control and explain the function of each. Provide an example of a data integrity error that could occur i

Relational algebraic operators, Problem Explain at least five relationa...

Problem Explain at least five relational algebraic operators with a suitable example. Note: All the above descriptions should be done by taking at least two examples from ou

Explain dynamic two-phase locking, Explain Dynamic Two-Phase Locking H...

Explain Dynamic Two-Phase Locking Here a transaction locks a data item instantly earlier than any operation is applied on the data item.  After finishing all the operations on

Derived horizontal fragmentation, atient(PNumber, Name, NHS_no, Amount_due,...

atient(PNumber, Name, NHS_no, Amount_due, DNO, Doctor, Medical_Treatment), relation of schema Staff(StaffNum, Name, DNO, Task) and relation of schema Dept(DNO, Name, Location, Dire

The file based system in dbms, The File Based System File based systems...

The File Based System File based systems are an early attempt to computerise the manual filing system. For example, a manual file can be set up to hold all the correspondence r

Explain normalization, What is Normalization? Database normalization is...

What is Normalization? Database normalization is a data design and organization method applied to data structures based on rules that help building relational databases. In rel

Compare wait-die deadlock prevention with wait-wound scheme, Compare wait-d...

Compare wait-die deadlock prevention scheme with wait-wound scheme   Ans:  Wait-Die Scheme  a) Based upon a nonpreemptive technique.  b) If Pi requests a resource present

Define identify relationship, Define identify relationship? Identifyin...

Define identify relationship? Identifying relationship: An identifying relationship means in which the child table cannot be uniquely recognize without the parent. For exampl

2phase locking, we need example of 2phase locking

we need example of 2phase locking

What is a super key, What is a super key? A super key is a set of one o...

What is a super key? A super key is a set of one or more attributes that collectively permits us to recognize uniquely an entity in the entity set.

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