1 / 16

Group 1

Group 1. Brooke Sims Don Luna Alison Lee. Problem #7.20 (Part A). Figure 7.19. Using relational algebra we were to specify the query by listing each flight, the flight number, the departure airport for the first leg of the flight, and the arrival airport for the last leg of the flight.

woody
Download Presentation

Group 1

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Group 1 • Brooke Sims • Don Luna • Alison Lee

  2. Problem #7.20 (Part A) • Figure 7.19. Using relational algebra we were to specify the query by listing each flight, the flight number, the departure airport for the first leg of the flight, and the arrival airport for the last leg of the flight.

  3. Part A Relational Algebra One_Leg <-s Leg_Number = ‘1’ (Flight_Leg) One_Leg2 <-p Flight_Number, Leg_Number, Departure_Airport_Code, Arrival_Airport_Code (One_Leg) Leg_1<- r FNum1, Leg_Num, Dep_Air_Code1, Arrive_Air_Code1 (One_Leg2)

  4. Part A Relational Algebra cont’d Leg_Max <-Flight_Number MAXIMUM Leg_Number (Flight_Leg) Leg_Max2 <-p Flight_Number, Leg_Number, Departure_Airport_Code, Arrival_Airport_Code (Leg_Max) Leg_Result <- r FNum Max, Leg Num Max, Dep Air Code1, Arrive Air Code Max (Leg_Max2)

  5. Part A Relational Algebra cont’d Result - Leg_1 |><| FNum1 = FNum Max Leg_Result

  6. Problem #7.20 (Part B) • Using relational algebra, we were to specify the query by listing the flight numbers and weekdays of all flights or flight legs that depart from Houston Intercontinental Airport (IAH) and arrive in Los Angeles International Airport (LAX).

  7. Part B Relational Algebra One_Leg <-s Leg_Number = ‘1’ (Flight_Leg) One_Leg2 <-p Flight_Number, Leg_Number, Departure_Airport_Code, Arrival_Airport_Code (One_Leg) Leg_1<- r FNum1, Leg_Num, Dep_Air_Code1, Arrive_Air_Code1 (One_Leg2)

  8. Part B Relational Algebra cont’d Leg_Max <-Flight_Number MAXIMUM Leg_Number (Flight_Leg) Leg_Max2 <-p Flight_Number, Leg_Number, Departure_Airport_Code, Arrival_Airport_Code (Leg_Max) Leg_Result <- r FNum Max, Leg Num Max, Dep Air Code1, Arrive Air Code Max (Leg_Max2)

  9. Part B Relational Algebra cont’d Result1 - Leg_1 |><| FNum1 = FNum Max Leg_Result Temp1 - Departure Airport Code = ‘IAH’ AND Arrival Airport Code = ‘LAX’ (Flight_Leg) Temp2 - FNum Max, Dep Air Code1, Arrive Air Code Max (Result1)

  10. Part B Relational Algebra cont’d Temp3 - Dep Air Code1 = ‘IAH’ AND Arrive Air Code Max = ‘LAX’ (Temp2) Result2 -FNum Max, Dep Air Code1, Arrive Air Code (Temp3) Flight Number, Departure Airport Code, Arrival Airport Code (Temp1) Result3 - Result2 |><| FNum Max = Number (Flight)

  11. Part B Relational Algebra cont’d  Final - Weekdays, Flight Number (Result3)

  12. Problem #7.20 (Part C) • Using relational algebra, we were to specify the query by listing the flight number, departure airport code, scheduled departure time, arrival airport code, scheduled arrival time, and weekdays of all flights or flight legs that depart from some airport in the city of Houston and arrive at some airport in the city of Los Angeles.

  13. Part C Relational Algebra Houston - City = ‘Houston’ (Airport) Los_Angeles - s City = ‘Los Angeles’ (Airport) Houston_Flights - Flight_Leg |><| Departure Airport Code = Airport Code (Houston)

  14. Part C Relational Algebra cont’d LA_Flights - Flight_Leg |><| Arrival Airport Code = Airport Code (Los_Angeles) Houston_Flights2 - Flight Number, Departure Airport Code, Scheduled Departure Time, Arrival Airport Code, Scheduled Arrival Time (Houston_Flights)  Houston_Departs - FNum, DAC, SDT, AAC, SAT (Houston_Flights2)

  15. Part C Relational Algebra cont’d LA_Arrives - Flight Number, Departure Airport Code, Scheduled Departure Time, Arrival Airport Code, Scheduled Arrival Time (LA_Flights) Result1 - Houston_Leave |><| FNum = Flight Number (LA_Arrives) Result2 - DAC, SDT, AAC, SAT, Flight Number (Result1)

  16. Part C Relational Algebra cont’d Result3 - Result2 |><| Flight_Number = Number (Flight) Final - Weekdays, Flight Number, DAC, DAT, Arrival Airport Code, Scheduled Arrival Time (Result3)

More Related