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
Differentiate sub-class and super-class? The specialization of a class is known as subclasses.eg: employee is a subclass of person and teller is a subclass of employee. Convers


You are working for the ABC Telecom and are given some customer records for data mining. You are asked to discover, from the data, patterns that characterize low-, medium- and high

In Oracle what is system global area and how is it organized? The SGA is a collection of shared memory fields which along with the Oracle processes constitute an Oracle instan

One-to-one relationship: For every 1:1 relationship type R in the ER diagram including two entities E1 and E2 we take one of entities (say E1) preferably with total participatio

What do you understand by a view? What does WITH CHECK OPTION clause for a view do? - A view is a virtual table which comprises fields from one or more real tables. - It is


Outer Join: The use of Outer Join is that it still joins those tuples that do not have matching values in common columns are also contained in the result table. Outer join places

What is Thread splitting A thread of control is a path by which a set of state diagrams on that a single object is active at a time. Objects are shared between threads

Given the subsequent relations:    vehicle (reg_no, make, colour)    Person (eno, name, address)    Owner (eno, reg_no)   Write expressions