Question: Booking(agent: String, traveler ssn: integer, trip id: integer) FormedBy(id: integer, location: String, start date: Date, end date: Date) Goes On(ssn: integer, id: integer) Leg(location: String,

 Booking(agent: String, traveler ssn: integer, trip id: integer) FormedBy(id: integer, location:

Booking(agent: String, traveler ssn: integer, trip id: integer) FormedBy(id: integer, location: String, start date: Date, end date: Date) Goes On(ssn: integer, id: integer) Leg(location: String, start date: Date, end date: Date) Owns(ssn: integer, passport number: integer, country: String) Passport(number: integer, country: String, expiration_date: Date, owner: String) TravelAgent(name: String, years experience: integer, phone: String) Traveller(name: String, ssn: integer, dob: Date) Trip(id: integer, start location: String, end location: String, start_date: Date, end date: Date) Exercises 1. [3 pts] Using SQL, find the name(s) of the travel agent(s) through whom the traveler 'pete' has booked trips. 2. (pts] Find the name(s) and phone(s) of the agent(s) who have booked the most trips. (a) Using relational algebra (b) Create the expression tree of your relational algebra (c) Using SQL 3. Find the average number of legs for all trips. (a) Using Relational Algebra (b) Create the expression tree of your relational algebra (c) Using SQL 4. Find name(s) of the Traveler(s) who have been on the greatest number of distinct trips. Note, distinct trips are based upon location pairs and not dates of travel. (a) Using Relational Algebra (b) Create the expression tree of your relational algebra (c) Using SQL Booking(agent: String, traveler ssn: integer, trip id: integer) FormedBy(id: integer, location: String, start date: Date, end date: Date) Goes On(ssn: integer, id: integer) Leg(location: String, start date: Date, end date: Date) Owns(ssn: integer, passport number: integer, country: String) Passport(number: integer, country: String, expiration_date: Date, owner: String) TravelAgent(name: String, years experience: integer, phone: String) Traveller(name: String, ssn: integer, dob: Date) Trip(id: integer, start location: String, end location: String, start_date: Date, end date: Date) Exercises 1. [3 pts] Using SQL, find the name(s) of the travel agent(s) through whom the traveler 'pete' has booked trips. 2. (pts] Find the name(s) and phone(s) of the agent(s) who have booked the most trips. (a) Using relational algebra (b) Create the expression tree of your relational algebra (c) Using SQL 3. Find the average number of legs for all trips. (a) Using Relational Algebra (b) Create the expression tree of your relational algebra (c) Using SQL 4. Find name(s) of the Traveler(s) who have been on the greatest number of distinct trips. Note, distinct trips are based upon location pairs and not dates of travel. (a) Using Relational Algebra (b) Create the expression tree of your relational algebra (c) Using SQL

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!