15
DAY 23: HOMEWORK # 5 OVERVIEW Aliya Farheen [email protected] April 7, 2015.

DAY 23: HOMEWORK # 5 OVERVIEW Aliya Farheen April 7, 2015

Embed Size (px)

DESCRIPTION

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

Citation preview

Page 1: DAY 23: HOMEWORK # 5 OVERVIEW Aliya Farheen April 7, 2015

DAY 23:HOMEWORK # 5 OVERVIEW

Aliya [email protected] 7, 2015.

Page 2: 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.

Page 3: DAY 23: HOMEWORK # 5 OVERVIEW Aliya Farheen April 7, 2015

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

Page 4: DAY 23: HOMEWORK # 5 OVERVIEW Aliya Farheen April 7, 2015

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.

Page 5: DAY 23: HOMEWORK # 5 OVERVIEW Aliya Farheen April 7, 2015

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

Page 6: DAY 23: HOMEWORK # 5 OVERVIEW Aliya Farheen April 7, 2015

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)

Page 7: DAY 23: HOMEWORK # 5 OVERVIEW Aliya Farheen April 7, 2015

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.

Page 8: DAY 23: HOMEWORK # 5 OVERVIEW Aliya Farheen April 7, 2015

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.

Page 9: DAY 23: HOMEWORK # 5 OVERVIEW Aliya Farheen April 7, 2015

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 <250 Or >1500.• Format Calculated Field as currency type with 3 decimal places. • Sort in descending order for Distance and then for CostPerMile

Page 10: DAY 23: HOMEWORK # 5 OVERVIEW Aliya Farheen April 7, 2015

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

Page 11: DAY 23: HOMEWORK # 5 OVERVIEW Aliya Farheen April 7, 2015

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

Page 12: DAY 23: HOMEWORK # 5 OVERVIEW Aliya Farheen April 7, 2015

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.

Page 13: DAY 23: HOMEWORK # 5 OVERVIEW Aliya Farheen April 7, 2015

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]![Population]• Format DepartingPassengersPerResident as fixed type number

with 2 decimal places. • Sort in descending order forDepartingPassengersPerResident and then City in ascending order.

Page 14: DAY 23: HOMEWORK # 5 OVERVIEW Aliya Farheen April 7, 2015

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 ! ! !

Page 15: DAY 23: HOMEWORK # 5 OVERVIEW Aliya Farheen April 7, 2015

Questions ?