Write SQL expression to list flight_no and airline_code of all the bookings for customers with first name Sam and city Chicago

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

SQL Question~

Write SQL expression to list flight_no and airline_code of all the bookings for customers with first name Sam and city Chicago

customer (customer_id, first_name, last_name, customer_email, customer_address, city, customer_phone)
airline (airline_code, airline_name, airline_country)
city( city_id, city_name, post_code, country, province)
flight ( flight_no, airline_code, origin_city, destination_city)
flight_schedule (schedule_id, flight_no, departure_date, departure_time, arrival_date, arrival_time)
booking ( booking _number, customer_id, schedule_id, booking_class, booking_status)
The customer table contains information about customers and customer_id is the primary key. The field city is a foreign key and
refers to the city relation.
The airline table contains information about airlines and airline_code is the primary key.
The city table contains information about cities and city_id is the primary key. Also, the post_code is unique for each city.
The flight table contains information about flights and flight_no is the primary key. The fields airline_code, origin_city, and
destination_city are foreign keys and refer to airline, city, and city relations respectively.
The flight_schedule table contains information about scheduled trips for the flight and schedule_id is the primary key. The field
flight_no is a foreign key and refers to the flight relation.
The booking table contains information about bookings and booking_number is the primary key. A booking will be for a
customer for a given flight schedule. The fields customer id and schedule id are foreign keys and refer to the customer and
flight_schedule relations respectively.
Transcribed Image Text:customer (customer_id, first_name, last_name, customer_email, customer_address, city, customer_phone) airline (airline_code, airline_name, airline_country) city( city_id, city_name, post_code, country, province) flight ( flight_no, airline_code, origin_city, destination_city) flight_schedule (schedule_id, flight_no, departure_date, departure_time, arrival_date, arrival_time) booking ( booking _number, customer_id, schedule_id, booking_class, booking_status) The customer table contains information about customers and customer_id is the primary key. The field city is a foreign key and refers to the city relation. The airline table contains information about airlines and airline_code is the primary key. The city table contains information about cities and city_id is the primary key. Also, the post_code is unique for each city. The flight table contains information about flights and flight_no is the primary key. The fields airline_code, origin_city, and destination_city are foreign keys and refer to airline, city, and city relations respectively. The flight_schedule table contains information about scheduled trips for the flight and schedule_id is the primary key. The field flight_no is a foreign key and refers to the flight relation. The booking table contains information about bookings and booking_number is the primary key. A booking will be for a customer for a given flight schedule. The fields customer id and schedule id are foreign keys and refer to the customer and flight_schedule relations respectively.
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Similar questions
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY