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
Which element in the database can modified by changing the data dictionary? Data elements in the database can be changed or modified through changing the data dictionary.

Consider the relations City (city_name, state) Hotel (name, address) City_hotel (hotel_name, city_name, owner) Answer the following queries in relational algebra (i) Find

Question 1 Suppose the employee employee id, name, designation, salary, attendance and address of any employee has to be stored in a database. You can store these data in a sequen

Hashed File Organisation Hashing is the most common form of purely random access to a database or file. It is also used to access columns that do not have an index as an optimi

how to prepare a data dictionary for online examination system for certified courses?

Differentiate between logical database design and physical database design. Show how this separation leads to data independence? Basis Logical Databas

What are the requirements to ensure the objectives of file management principle is realized?

why shadow copy technique is used?

Differentiate between various levels of data abstraction? Data Abstraction - Abstraction is the procedure to hide the irrelevant things from the users and represent the rele

An orchestra database consists of the following relations: CONDUCTS (conductor, composition) REQUIRES (composition, Instrument) PLAYS (Player, Instrument) Give the relational