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
In object oriented design, which steps must designer take to adjust inheritance? To readjust inheritance following steps should be taken: i)  Rearrange and adjust the classe

Eliminate Repeating Groups The problem is, "Find out the list of employees, who knows DB2". For this problem we require to perform an awkward scan of the list looking for re

Design Of Distributed Databases: The distributed databases are mainly relational at local level. So a local database schema is the similar as that of a centralised database design

write-set(T): Each data items that are written by a transaction T

Define decision tree classifiers? As the name suggests decision tree classifiers use a tree: Every leaf node has an associated class, and every internal node has a predicate as

The dataset " CFOLYMPICS.XLS " contains the observations used in the above article.  The definitions of the variables are also included in this spreadsheet.  However, for the purpo

A distributed transaction consists of subtransactions that execute at different sites and access local DBMSs at those sites. For example, a distributed transaction that transfers m

Describe the definition of a transaction in SQL  Ans: The SQL transaction starts implicitly. Transactions are finished by either Commit work that commits the transaction and st

In this assignment, you will create a program that works with multiple tables. In this assignment, you will work with the factory and sales tables. 1. Create a new project nam