Trigger , Database Management System

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.

Posted Date: 2/22/2013 8:16:17 AM | Location : United States







Related Discussions:- Trigger , Assignment Help, Ask Question on Trigger , Get Answer, Expert's Help, Trigger Discussions

Write discussion on Trigger
Your posts are moderated
Related Questions
Define According to the levels of abstraction, the schema at the intermediate level is called  Ans: As per to the levels of abstraction, the schema at the intermediate level is

You have a friend that runs a motor bike club that holds racing events at various venues on weekends, on a monthly basis. Some venues are private race tracks and some are dirt trac

Define the Two Phase Locking Protocol This is a protocol that is used to make sure serializability of transactions. This protocol needs that every transaction issue lock and u

BCNF Boyce-Codd Normal Form A relation schema R is in BCNF if it is in 3NF and accepts an additional constraint that for every FD X A, X has to be a candidate key. If a relati

I want to fragment existing table using java code... help me..!!

Should I select imaging software that allows changes? An imaging system should not give features to edit or alter images. Images generally are formed as safe and secure records

What Is Sql?  Structured Query Language (SQL) is a standard query language. It is usually used with all relational databases for data manipulation and definition. All the re

Find out the names of all employees who work for first Bank Corporation from database. SELECT EMPLOYEE_NAME FROM WORKS WHERE COMPANYNAME = ‘First Bank Corporation';

a.  Construct a query around any one of the functional divisions you made in 4a such that if executed in the distributed design of 4 would require reconstruction of at least two ho

Concurrency Identification While designing analysis, model we map real world model into our analytical model. Real life objects are simultaneous in nature, but all the design