The table below shows a small database whose records correspond to flights depar
ID: 3704354 • Letter: T
Question
The table below shows a small database whose records correspond to flights departing from an airport.
Airline
Flight Number
Gate
Destination
Departure Time
FlyRight
122
34
Detroit
08:10
JetGreen
221
22
Denver
08:17
JetGreen
122
33
Anchorage
08:22
JetGreen
323
34
Honolulu
08:30
FlyRight
199
13
Detroit
08:47
JetGreen
222
22
Denver
09:10
FlyRight
322
34
Detroit
09:44
Are the attributes "Airline" and "Destination" a key for this database?
Give two examples of sets of attributes that are keys for this database.
Show the results of Select[Airline = "JetGreen" and Destination="Denver"].
Show the results of Project[Airline, Gate].
Show the results of Select[Destination = "Denver"] followed by Project[Gate].
What operations should be performed if you want to know which airlines use gate 22?
What operations should be performed if you want to know whether there are any flights to Detroit departing before 09:10? A flight is identified by the airline and flight number.
Airline
Flight Number
Gate
Destination
Departure Time
FlyRight
122
34
Detroit
08:10
JetGreen
221
22
Denver
08:17
JetGreen
122
33
Anchorage
08:22
JetGreen
323
34
Honolulu
08:30
FlyRight
199
13
Detroit
08:47
JetGreen
222
22
Denver
09:10
FlyRight
322
34
Detroit
09:44
Explanation / Answer
Solution:
Are the attributes "Airline" and "Destination" a key for this database?
Yes.
Explanation:
Because they define every row of the table uniquely.
Give two examples of sets of attributes that are keys for this database.
Departure time is one key
Flight number, Gate is also one key
Show the results of Select[Airline = "JetGreen" and Destination="Denver"].
The result would be
JetGreen
221
22
Denver
08:17
Show the results of Project[Airline, Gate].
Here the complete columns of Airline and Gate will be printed
Show the results of Select[Destination = "Denver"] followed by Project[Gate]
What operations should be performed if you want to know which airlines use gate 22?
SELECT Airline FROM table WHERE Gate= 22
What operations should be performed if you want to know whether there are any flights to Detroit departing before 09:10? A flight is identified by the airline and flight number.
SELECT Flight Number FROM table WHERE Destination= 'Detroit' AND Departure Time<9:10
I hope this helps if you find any problem. Please comment below. Don't forget to give a thumbs up if you liked it. :)
Airline Flight Number Gate Destination Departure TimeJetGreen
221
22
Denver
08:17
JetGreen 222 22 Denver 09:10Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.