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

Architectural standard, Architectural standard: Designation : Archit...

Architectural standard: Designation : Architect , Consultant Job Profile : As a part of Oracle Fusion Middleware at Satyam, I am involved with Presales, Delivery, A

Operator precedence-data manipulation language, Operator Precedence The...

Operator Precedence The basic operators used in SQL are * /   - + Operators of the similar priority are evaluated From Left to right Parentheses are used to force priorit

Databases and data warehouses , Databases and data warehouses both are data...

Databases and data warehouses both are databases and both contains number of rows and columns of tables containing data. Data warehouse is really different from databases because d

In which relational modes cardinality is termed, In which relational modes,...

In which relational modes, cardinality is termed? Answer : Cardinality is termed in a number of tuples relational modes.

Explain domain-oriented relational calculus?, How does Tuple-oriented relat...

How does Tuple-oriented relational calculus vary from domain-oriented relational calculus? The tuple-oriented calculus uses a tuple variables i.e., variable whose only allowed

Differance between open addressing and chaining collision, Differance betwe...

Differance between Open addressing and chaining for collision resolution ? In open addressing , proceeding from the occupied position specified by hash address the program che

Distributed transaction atomic-consistent-isolated, A distributed transacti...

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

Explain hashing techniques, Explain Hashing techniques The hashing tech...

Explain Hashing techniques The hashing techniques can be categorized as: Static Hashing Techniques - In this method, the data can be viewed a collection of buckets, along with

Dataware house(job scheduling strategy), Define a job scheduling strategy t...

Define a job scheduling strategy that will meet business requirement of reporting availability by 6am CST for the following cubes? Show the job scheduling dependencies in a pictori

Control as a state machine engine, Control as a State Machine Engine F...

Control as a State Machine Engine First let us define the state machine: "the state machine is a machine which is an object but not an application object. It is a part of lang

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