Trigger , Database Management System

Assignment Help:

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.


Related Discussions:- Trigger

Objectives of data management, The traffic data mgmt. systems infrastructur...

The traffic data mgmt. systems infrastructure plan describes the software, hardware, data network, and other elements that will support the TDMS. The infrastructure plan is based o

Explain pipelining, Explain pipelining.        Ans: In order to describ...

Explain pipelining.        Ans: In order to describe pipelining in simple terms, think of it as breaking down processor functions into smaller and smaller parts. For instance,

Develop a java application, 1 - Serial RS232 comm port comunication 2 - ...

1 - Serial RS232 comm port comunication 2 - NanoHTTPD serving a few processed pages 3 - System tray application to indicate status and access configuration forms 4 - SQLit

Define outer union operation of the relational algebra, Define outer union ...

Define outer union operation of the relational algebra. Compute the outer union for the relations R and S given below. Outer Join - If there are any values in one tabl

Define tuple variable, Define tuple variable Tuple variable is a type o...

Define tuple variable Tuple variable is a type of variable whose domain is the set of all tuples.

What is predictive modelling, Problem: (a) Data mining is one of the b...

Problem: (a) Data mining is one of the best ways to analyse data and using software techniques, hidden and unexpected patterns and relationships in sets of data can be extrac

Differance between unordered and ordered file, Differance between Unordered...

Differance between Unordered and ordered file ? Unordered file do no has any sequence although ordered file has arranged in a few sequence and data are assigned in ordered form

What is an object id, What is an object ID? Each class-derived table ha...

What is an object ID? Each class-derived table has an ID for primary key, one or more object IDs form primary key for association derived tables. An object ID is equivalent dat

Explain disadvantages of a dbms, Question : (a) Database Management Sy...

Question : (a) Database Management Systems (DBMS) is the foundation of business intelligence. Explain the following concepts related to DBMS: (i) Entity Relationship Diagr

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd