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

Coursework, ERD Diagram of Medical Recruitment Agency?

ERD Diagram of Medical Recruitment Agency?

Discuss the different layers of ansi sparc architecture, Q.1 Briefly discus...

Q.1 Briefly discuss the different layers of ANSI SPARC architecture. Ans: The three layers of ANSI SPARC architecture are like this: 1. Internal view is at the lowest leve

Explain the static or conservative two phase locking, Explain the Static or...

Explain the Static or conservative Two Phase Locking: Static (or conservative) Two Phase Locking: In this type of scheme, all the data items are locked earlier than any opera

Why a report generator is used, Why a report generator is used ? Report...

Why a report generator is used ? Report generator is used for print files on paper.

Convert encrypted hsql database into csv format, Project Description: We...

Project Description: We have an encrypted HSQL Database which we want to change into csv format. HSQL DB . We have java application (jar file) which reads that database but n

Transaction states, The following variant of the primary copy asynchronous-...

The following variant of the primary copy asynchronous-update replication protocol has been proposed for totally replicated systems. (a)  A transaction executing at site A updat

Define database management system, Define database management system? D...

Define database management system? Database management system (DBMS) is a set of interrelated data and a combination of programs to access those data.

Database schema, #Use the following database schema: 1) Patient—PatientID, ...

#Use the following database schema: 1) Patient—PatientID, Name, DOB 2) Doctor—DoctorID, Name, MedLicenseNumber, Phone 3) Medication—MedicationID, BrandName, GenericName 4) Prescrip

Database errors, Database Errors: An error is said to have occurred if the ...

Database Errors: An error is said to have occurred if the implementation of a command to manipulate the database cannot be successfully finished either due to inconsistent data or

What is online transaction processing, What is OLTP (Online Transaction Pro...

What is OLTP (Online Transaction Processing)? In OLTP - online transaction processing systems relational database design use the discipline of data modeling and generally follo

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