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 Radix conversion method  One clever way to transform binary numbers to BCD notation (binary-coded decimal) is the "double dabble algorithm". It can be adapted to transfo

Create a view emp_dep containing e_name and number of dependents from the tables employee and dependent of (i) CREATE VIEW emp_dept AS SELECT ename, COUNT(*) FROM employee, dep

Define Partial Key and Primary Key A partial key, also known as discriminator, is the set of attributes which can uniquely identify weak entities that are related to similar o

what is file organization? what are file organization techniques.explain in detail? explain random file organization technique, multikey file organization technique?what is indexin

What are the two approaches to store relations in distributed database? a) Replication b) Fragmentation

need to get answer for questions 3&4 on this page in part 1

I am using Siteground. And my database is full of limit so need someone who reduces the data which no need. This is very simple and simple task. Skills required are Databa

What is completeness constraint on generalization? Define the variation between total and partial design constraint. Give an example each.       Ans: Completeness Constraints

What is meant by functional dependencies? Consider a relation schema R and α C R and β C R. The functional dependency α ->β  holds on relational schema R if in any legal relati

I have to solve a problem using access