Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

6. How many seats are available for a flight from 'Ottawa' to 'Toronto' departing at noon (12)? 7. List the names of all passengers arriving

image text in transcribed

6. How many seats are available for a flight from 'Ottawa' to 'Toronto' departing at noon (12)?

7. List the names of all passengers arriving in 'Vancouver' after 13:00 (note that arrival time ranges from 0 to 23), the airport (by city) they are coming from, and their arrival time.

8. List all trips (with 1 stop, i.e, two flights) from 'Ottawa' to 'Vancouver' and sort by lowest total fare. Please list flight ID for both Ottawa-layover and layover-Vancouver flights, airline name (of first flight only), city of origin, layover city, destination city, total trip time (including layover), and total fare price.

Consider the relational schema below and write SQL queries for the next questions. This is a simplified flight booking database. In this database we have 5 relations (tables). You must assume you don't know airport codes, but only city names, unless otherwise mentioned in the question. For example, you can use 'Toronto' in a query, not 'YYZ'. If a question explicitly uses a PK value, e.g., "Where is airport 'YYZ' located?", then you can use it in a query like where code= 'YYZ'. Primary keys are used to uniquely identify tuples and also to 'link' tables with their corresponding foreign keys. Therefore, you must not use any primary key values explicitly, unless otherwise mentioned. If your query uses PK or FK values explicitly where it shouldn't, the answer will be invalidated. Consider the relational schema below and write SQL queries for the next questions. This is a simplified flight booking database. In this database we have 5 relations (tables). You must assume you don't know airport codes, but only city names, unless otherwise mentioned in the question. For example, you can use 'Toronto' in a query, not 'YYZ'. If a question explicitly uses a PK value, e.g., "Where is airport 'YYZ' located?", then you can use it in a query like where code= 'YYZ'. Primary keys are used to uniquely identify tuples and also to 'link' tables with their corresponding foreign keys. Therefore, you must not use any primary key values explicitly, unless otherwise mentioned. If your query uses PK or FK values explicitly where it shouldn't, the answer will be invalidated

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

Practical Neo4j

Authors: Gregory Jordan

1st Edition

1484200225, 9781484200223

Students also viewed these Databases questions

Question

Define Deregulation and Privatization

Answered: 1 week ago

Question

What are Decision Trees?

Answered: 1 week ago

Question

What is meant by the Term Glass Ceiling?

Answered: 1 week ago