In: Computer Science
Complete the following tasks. In each exercise, represent your answer only in DBDL. Do not use diagrams a this point. Submit either a text file or a Word document with your work. Make sure you follow chapter 6's DBDL notation
(****** Just to clarify: this is the first question on Page
220. It says to 'produce the following reports', but what you are
asked to do is use DBDL notation to create 5 tables: Guide,
Trip, Customer, Reservation and TripGuides
Make sure to list the FK where they belong ******)
Schema design in DBDL :
Guide [GuideNumber(Primary Key), GuideLastName, GuideFirstName, Address, City , State, PostalCode, TelephoneNumber, DateHired]
Trip [TripIdNumber(Primary Key), TripName, TripStartLocation, TripStartState, TripDistance, MaxGroupSize, TypeOfTrip, SeasonOfTrip, GuideNumber(Foreign Key)]
Customer[ CustomerNumber(Primary Key), CustomerLastName, CustomerFirstName, Address, City, State, PostalCode, TelephoneNumber]
Reservation[TripIdNumber(Primary Key), TripDate, NumOfPeopleInReservation, TripPricePerPerson, AdditionalFeesPerPerson, CustomerNumber(Foreign Key)]
Queries to fetch required data from the above tables
:
1) select GuideNumber,GuideLastName,GuideFirstName,Address, City
, State, PostalCode, TelephoneNumber, DateHired from Guides where
GuideNumber = "123"
2) select TripIdNumber, TripName, TripStartLocation,
TripStartState, TripDistance, MaxGroupSize, TypeOfTrip,
SeasonOfTrip, GuideNumber,GuideLastName,GuideFirstName from Trip
inner join Guide on(Trip.GuideNumber=Guide.GuideNumber)
where TripIdNumber = "123"
3) select CustomerNumber, CustomerLastName, CustomerFirstName,
Address, City, State, PostalCode, TelephoneNumber from Customer
where CustomerNumber = "123"
4) select TripIdNumber, TripDate, NumOfPeopleInReservation,
TripPricePerPerson, AdditionalFeesPerPerson, CustomerNumber ,
CustomerFirstName, CustomerLastName
from Reservation inner join Customer on (Reservation.CustomerNumber
= Customer.CustomerNumber) where TripIdNumber = "123"