88-271 Homepage
Display in Printable Format

Home
Lecture Notes
   Lecture 1
   Lecture 2
   Lecture 3
   Lecture 4
   Lecture 5
   Lecture 6
   Lecture 7
   Lecture 8
   Lecture 9
   Lecture 10
   Lecture 11
Sample Solutions
   Homework #1
   Homework #2
   Homework #3
   Homework #4
   Homework #5
Common Homework Errors
   Homework #1
   Homework #2
   Homework #3
   Homework #4
   Homework #5
Exams
   Exam 1 Sample Solution
UML Use Case FAQ

88-271 Homework #4 Sample Solution

Problem #1: 4 Tables and their corresponding SQL



SQL: CREATE TABLE Flight (ID INTEGER(8) PRIMARY KEY(ID))
Flight Table
ID
1
2
3
4
5
6


SQL: CREATE TABLE FlightReservation (ID INTEGER(8), fareCode VARCHAR(50) PRIMARY KEY(ID))
FlightReservation Table
ID fareCode
1Coach
2First
3First
4Business
5Coach
6Coach
7Coach
8Business


SQL: CREATE TABLE TripReservation (ID INTEGER(8), recordLocator DECIMAL(8) PRIMARY KEY(ID))
TripReservation Table
IDrecordLocator
1what
2is
3this?


SQL: CREATE TABLE Ticket (ID INTEGER(8), fare DECIMAL(8) PRIMARY KEY(ID))
Ticket Table
IDfare
1109.26
2388.14
3899.99
489.12
5576.54

Problem #2: The Reserves Table


Reserves Table
FlightIDFlightReservationID
11
22
23
14
15
36
47
48

Problem #3: The TripReservation Table


This question is answered by the text of question #1.

Copyright © 1998, Carnegie Mellon University
Site maintained by Ben Ziskind