Booking flights At the restaurant Wiki. Triggers. February 24, Grégoire Détrez Tutorial 4

Similar documents
Kristina Ricks ISYS 520 VBA Project Write-up Around the World

Solutions to Examination in Databases (TDA357/DIT620)

MARKETO INTEGRATION GUIDE

CASS & Airline User Manual

Angel Flight Information Database System AFIDS

e-airportslots Tutorial

Configuring a Secure Access etrust SiteMinder Server Instance (NSM Procedure)

Preliminary Staff User s Manual. CASSi The Computerized Aircraft Scheduling System Rev. 1.28a. February 10, 2001

PASSUR Aerospace. Departure Metering Program at Toronto Pearson International Airport. Training Manual

Route Support Cork Airport Route Support Scheme ( RSS ) Short-Haul Operations Valid from 1st January Introduction

Be fast with fares. Be first with customers

Concur Travel: View More Air Fares

e-crew Horizon Air Pilot Trip Trades Phase I Notes for the Crewmembers

Stair Designer USER S GUIDE

Operations Manual. FS Airlines Client User Guide Supplement A. Flight Operations Department

InHotel. Installation Guide Release version 1.5.0

SIMAIR: A STOCHASTIC MODEL OF AIRLINE OPERATIONS

e-crew Horizon Air Trip Trades Notes for the Flight Attendants

Special edition paper Development of a Crew Schedule Data Transfer System

CONTACT ON (888) FOR ANY QUERY RELATED TO BOOKING AMERICAN AIRLINES RESERVATIONS

WHAT S NEW in 7.9 RELEASE NOTES

Phytclean Guide: How to apply for phytosanitary (special) markets

Schedule Compression by Fair Allocation Methods

UK Rail with Rail Europe. Last Update: 25 Apr 2016

epods Airline Management Educational Game

Global formulas. Page1. Video filmed with GeneXus X Evolution 2

Course Project. 1. Let staff make entries when a passenger makes reservations on a flight.

Applying Integer Linear Programming to the Fleet Assignment Problem

WebReserv Quickstart Guides How to setup your Bed & Breakfast booking system

Mobile FliteDeck VFR Version Release Notes

Release Note

Guidelines for Workflow of AIP AMDT, AIP SUP & AIRAC at Iraq CAA AIS HQ

FAQ: HR 799 & S. 403: North Country National Scenic Trail Route Adjustment Act

E: W: avinet.com.au. Air Maestro Training Guide Flight Records Module Page 1

Short-Haul Operations Route Support Scheme (RSS)

In-Service Data Program Helps Boeing Design, Build, and Support Airplanes

Release Note

Flight Crew Operating Manual STANDARD OPERATING PROCEDURES

FareStar Ticket Window Product Functionality Guide

TILOS & P3 DATA INTERFACE PAUL E HARRIS EASTWOOD HARRIS PTY LTD. 24 July 2007

CRISIS AIREP Guidance

Making bookings for travellers with accessibility considerations

Concur Travel: User Supplied Hotels

Installation Guide. Unisphere Central. Installation. Release number REV 07. October, 2015

MU-avtalet. In English

my.scouting Tools Version 1 Overview Log In and Access Camping Manager

World Traffic 3 Quick-Start Guide. For World Traffic versions and higher.

What s New in VAX VacationAccess? VAX VacationAccess December 8, 2011 Enhancements Reference Guide

Annex III to ED Decision 2017/023/R. AMC and GM to Part-CAT Issue 2, Amendment 13

FOR SMALL AND MEDIUM SIZED AIRPORTS Velocity FIDS

UM1868. The BlueNRG and BlueNRG-MS information register (IFR) User manual. Introduction

Additional Boarding Setup and Daily Operations Guide

Specialty Cruises. 100% Tally and Strip Cruises

Copyright Thomson Financial Limited 2002

ELOQUA INTEGRATION GUIDE

FRA CDM. Airport Collaborative Decision Making (A-CDM) Flight Crew Briefing FRANKFURT AIRPORT. German Harmonisation

Frequently Asked Questions

Pacific Airways I S N T T H E W O R L D A S M A L L P L A C E? Operations Manual v 2.3. Revised: Dec. 1, Updated by Tom Detlefsen

EMC Unisphere 360 for VMAX

SWEN502 Foundations of Databases Session 2. Victoria University of Wellington, 2017, Term 2 Markus Luczak-Roesch

Release Notes Business Rules Version 10x Up to Spring 2019 Release for SIBR/BSAP/RC-BSAP

IBM Tivoli Storage Manager Version Configuring an IBM Tivoli Storage Manager cluster with IBM Tivoli System Automation for Multiplatforms

EXTENDED-RANGE TWIN-ENGINE OPERATIONS

HEATHROW NIGHT MOVEMENT AND QUOTA ALLOCATION PROCEDURES Version 3

Advice for brokers about the ATOL Regulations and the ATOL scheme

Improved Seat Reservation Functionality in Worldspan

Dell EMC Unisphere 360

Model Solutions. ENGR 110: Test 2. 2 Oct, 2014

2018/09/01 05:24 1/1 Flight Plan

Aerodrome Surveys. Airside Operational Instruction 17 CONTENT:- 1. INTRODUCTION 2. PROCEDURES 3. TREATMENT OF OBSTACLES APPENDIX 2

VARIBLE COMMISSIONS OVERVIEW

Copyright Thomson Financial Limited 2006

Module Objectives. Creating a Manual Fare Build

EMC Unisphere 360 for VMAX

TWELFTH AIR NAVIGATION CONFERENCE

Solutions. Author, Department Place, Date

European Aviation Safety Agency

The European Commission's Proposal to Amend EU Regulation 261/2004. by Arpad Szakal

UVACARS User Guide Version 1.0

Frequently asked questions (FAQ)

CPDLC-DCL U.S. Airports

LS-Data. Manual. Altenrhein Luftfahrt GmbH Office Park 3 Top 312 / Postfach 90 A-1300 Wien Flughafen

NAIPS Internet Service Authorised NOTAM Originator User Guide Version 3.0. (To be read in addition to NIS User Guide 3.0)

PORTABLE LIGHT SIGNALS

Pilot Certification and Qualification Requirements for Air Carrier Operations; Technical

Physical Security Fleets Analyzer Saved Searches... 62

EMC Unisphere 360 for VMAX

Guyana Civil Aviation Authority. ATR Form M Instructions

2018 Cathay Pacific Virtual 2 P a g e

Airport Monthly Air Transport Movements Guidance Notes CAA Business Intelligence

EASA Safety Information Bulletin

Q. Can I book personal travel on the site? - The Concur site is to be used exclusively for business related travel.

Class 47 Network Southeast Add-On

Mathematical modeling in the airline industry: optimizing aircraft assignment for on-demand air transport

Summary of Public Submissions Received on

SERVICE BULLETIN TITLE NAVIGATION - GARMIN G1000 ENHANCED SEARCH AND RESCUE ENABLEMENT

Supports full integration with Apollo, Galileo and Worldspan GDS.

June 9th, 2011 Runway Excursions at Landing The n 1 Global Air Safety Issue Can We Reduce this Risk Through Innovative Avionics?

Helicopter Performance. Performance Class 1. Jim Lyons

permanent / opt out possible 27% Depends on reason Decline to digitise 9%

Transcription:

Triggers Grégoire Détrez February 24, 2016

Exercice 1

Domain Description We extend the shema from last week with the following relations to handle bookings: AvailableFlights(_flight_, _date_, numberoffreeseats, price) flight -> Flights.code Bookings(_reference_, flight, date, passenger, price) (flight, date) -> AvailableFlights.(code, date) Where Bookings.price is the price that was paid for a particular ticket and AvailableFlights.price is the current price of the flight, which is different.

Question 1 Create a view that lists booking references, passengers, flight codes, dates, and departure and destination cities.

Question 2 Create a trigger on the view defined in question 1. This trigger takes care of booking a new passenger to a flight. It is fired by an insertion of a passenger and a flight code to the view, for instance, book Annie Adams for AF666. Its effect should be the following: 1 if the number of free seats on AF666 is positive, decrement it by one; the booking is successful 2 if there are no free seats, the booking fails 3 if the booking is successful, add Annie Adams and AF666 to Bookings, with the price given in AvailableFlights when booking her; also add a booking reference which is the maximum of the previous references (for all flights) plus one 4 if the booking is successful, increment the price by 50 SEK for the next passenger (thus the fuller the flight, the more you pay)

Refactoring The airline decides to upgrade its database to keep track of its fleet. This means adding a table to list the available planes and updating the AvailableFlights in the following way: Planes(_regnr_, capacity) AvailableFlights(_flight_, _date_, numberoffreeseats, price, plane) (flight, date) -> Flights.(code, date) plane -> Planes.regnr

Question 3 Your job is to create a trigger that automatically update numberofseats when the company changes plane for a flight.

Exercice 2

Domain Description In this exercise, we are creating the following database for a restaurant: Tables(_number_, seats) Bookings(_name_, _time_, nbpeople, table) table -> Tables.number For the sake of simplicity, we assume that the database only needs to hold bookings for the current day and that bookings are always done on the hour (i.e. time is an integer between 0 and 23). Finally, tables are always booked for two hours. This means that if table 1 is booked at 19.00, it can t be booked at 20.00 but it can be booked again at 21.00.

Question 1 Write a view that lists the times at which tables are blocked by a booking. In the example above, where table 1 is booked at 19.00, the view should contain the following rows: table time 1 18 1 19 1 20

Question 2 Write a trigger on the table Bookings that automatically assign a table to new rows if none is specified. The assigned table should respect the following rules: it should be free for the duration of the booking. it should be big enough for the number of people in the party it should be the smallest possible table to accommodate this number of people

Exercice 3

Domain Description In this exercise, we are creating a database for a wiki. A wiki is a website that allows collaborative modification of its content and structure directly from the web browser (pedia). To make collaborative edition easier, we needs to keep an history of the modifications of each page. To achieve this, we will use a simple model that simply keeps each version of each page as a separate row: PageRevision(_name_, _date_, author, text)

Question 1 To make it easier to access the wiki, creat a view Page(name, last author, text) that shows only the latest version of each page.

Question 2 Create a trigger on your newly created view so that when a user tries to update a given page, a new revision is created instead.

Sometimes, pages on the wiki needs to be completely deleted (for instance, if a page contains sensitive information or copyrighted content). In that case, we want to remove all revisions of the page from the database but we still want to remember that the page has existed but has been deleted. To this end, we add the following table to our database: DeleteLog(_pagename_, _date_)

Question 3 Write a trigger on the Page view such that when a page is deleted: all its revisions are removed from the database the deletion is recorded in the DeleteLog.