DAY 23: HOMEWORK # 5 OVERVIEW Aliya Farheen April 7, 2015.
ANNOUNCEMENTS Homework # 5 is due for 4/10/2015 by 11:59 pm. Exam-2 on Microsoft Access is scheduled on the 4/14/15.
HOMEWORK 5 OVERVIEW Open the directions file online to follow the flow of the assignment: Create database and 5 tables –Populate and relate as described Create 7 Queries Analysis Questions
STEP3: IMPORT XML DATA External Data->Xml file Browse the Xml file required and use the Structure and data option in the import dialog box. One at a time browse originairports.xml, destinationairports.xml, airfare.xml and largestairlines.xml After this step your database consist of four tables.
STEP4 Create a table with name CheapestAirlines. Switch to design view and rename the Id field as CheapestAirlineCode with text datatype. Create the field AirlineName with text datatype Create the field AirlineType using lookup wizard to create lookup for type {Legacy, Low-Cost, Other } Enter the records into table
STEP5 Database Tools->Relationships Add all the tables from the Show Table dialog box. Create relationships from these tables to Airfare table and do not enforce referential integrity. -OriginAirports(OriginAirportCode) -DestinationAirports(DestinationAirportCode) -LargerstAirlines(LargestAirportCode) -CheapestAirlines(CheapestAirportCode)
STEP6A Create->Query Design Add all the tables Add the fields [OriginAirports] City [DestinationAirports] City [LargestAirlines] AirlineName, AirlineType [CheapestAirlines] AirlineName, AirlineType Sort in ascending order for Origin-City and then for Destination-City.
STEP6B Create->Query Design Add all the tables Add the fields [OriginAirports] City [DestinationAirports] City [LargestAirlines] AirlineName [Airfare] LargestAirlineShare [CheapestAirlines] AirlineName, AirlineType [Airfare] CheapestAirlineShare [LargestAirlines] AirlineType CheapestAirlines] AirlineType Add Criteria for largest airlinetype as Legacy and Cheapest airlinetype as low-cost carrier. Sort in ascending order for Origin-City and then for Destination-City.
STEP6C Create->Query Design Add the tables OriginAirports, DestinationAirports, Airfare Add the fields [OriginAirports] City [DestinationAirports] City [Airfare] Distance, PasengersPerDay, AverageFare Add the calculated field CostPerMile: [Airfare]![AverageFare]/[Airfare]![Distance] Add Criteria for distance as Format Calculated Field as currency type with 3 decimal places. Sort in descending order for Distance and then for CostPerMile
STEP6D Create->Query Design Add the tables OriginAirports, DestinationAirports, Airfare Add the fields [OriginAirports] City,Hub [DestinationAirports] City, Hub [Airfare] PasengersPerDay, AverageFare Add Criteria for [OriginAirports] Hub as True. Add Or for [DestinationAirports] Hub also True.. Sort in descending order for AverageFare
STEP6E Create->Query Design Add the tables AirFare and OriginAirports Add the fields [OriginAirports] City [Airfare] OriginAirportCode [OriginAirports] Hub [Airfare] Distance Add the calculated field AnnualDepartingPassengers: Sum([Airfare].[PassengersPerDay])*365 Add Totals Row and change the option to Avg for Distance and Expression for the calculated field. Format Calculated Field and Distance as standard type with 0 decimal places. Sort in ascending order for City
STEP6F For this query, copy and-paste the SQL code given in the instruction. Do not make any modifications to this query other than entering the above SQL code.
STEP6G Create->Query Design Add the table OriginAirports and query named Query6E Add the fields [OriginAirports] City, OriginAirportCode, Hub [Query6E] AnnualDepartingPassengers Add the calculated field DepartingPassengersPerResident: [Query6E]![AnnualDepartingPassengers]/[OriginAirports]![Pop ulation] Format DepartingPassengersPerResident as fixed type number with 2 decimal places. Sort in descending order forDepartingPassengersPerResident and then City in ascending order.
STEP 7 New Table ‘AnalysisQuestions’ with 2 fields –QuestionNumber Field values will be the question designators from the assignment (9a, 9b, 9c…) –Answer Field values will be your answers to the given question Make it of data type “Memo” This table is not related to the others, merely a place to put the answers to your Analysis Questions. Make sure answers are RECORDS in datasheet view, and NOT TYPED IN DESIGN VIEW ! ! !