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

Adjustments are required to increase chances of inheritance, What types of ...

What types of adjustments are required to increase chances of inheritance. a)   Some attributes can be added or ignored in  the base class operation  b) Some changes can be

What is the candidate key for a table with columns, For problems 1-4, give ...

For problems 1-4, give all candidate keys for the tables with FDs specified.  Composite candidate keys must be put in parentheses, and candidate keys must be separated with commas

Record based logical models, Record based Logical Models: Use records as th...

Record based Logical Models: Use records as the key data representation components Examples: Relational Model: It shows data as well as relationship between data in the form

Analyzing association traversal, Analyzing Association Traversal Assoc...

Analyzing Association Traversal Association Traversal shall be understood properly for the association design explanation.  Analyzing association traversal means analyzing tra

Why like predicate used for, Why Like predicate used for? LIKE predicat...

Why Like predicate used for? LIKE predicate: The LIKE predicate searches for strings in which have a certain pattern.

What is data defination language, What is DDL? Make a list of commands with...

What is DDL? Make a list of commands with short description used in DDL Ans: Data Definition Language that is abbreviated as DDL is a computer language for defining data struct

What is icr, What is ICR? A. ICR (Intelligent Character Recognition) is...

What is ICR? A. ICR (Intelligent Character Recognition) is a technology that gives scanning and imaging systems the ability to identify images of hand-printed or script charact

What is primary index, Primary Index In primary index, there is a one-t...

Primary Index In primary index, there is a one-to-one relationship among the entries in the index table and the records in the major table. Primary index can be of two types:

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