Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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,

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Technology And Management Computers And Information Processing Systems For Business

Authors: Robert C. Goldstein

1st Edition

0471887374, 978-0471887379

More Books

Students also viewed these Databases questions

Question

Describe the seven standard parts of a letter.

Answered: 1 week ago

Question

Explain how to develop effective Internet-based messages.

Answered: 1 week ago

Question

Identify the advantages and disadvantages of written messages.

Answered: 1 week ago