Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help using SQL please. dbo.Airlines AirlineID AirlineName 1 American 2 Delta 3 Southwest 4 United 5 Virgin Atlantic 6 Frontier 7 Frontier 8 Frontier

Need help using SQL please.

dbo.Airlines

AirlineID AirlineName 1 American 2 Delta 3 Southwest 4 United 5 Virgin Atlantic 6 Frontier 7 Frontier 8 Frontier

dbo. Airports

AirportCode AirportLocation YearOpened NumTerminals ATL Atlanta, GA 1926 9 BOI Boise, ID 1936 3 DFW Dallas-Fort Worth, TX 1973 8 IAH Houston, TX 1957 10 JAX Jacksonville, FL 1968 3 JFK New York, New York 1943 12 LAS Las Vegas, NV 1947 3 LAX Los Angeles, CA 1928 10 MCO Orlando, FL 1942 4 MIA Miami, FL 1945 9 ORD Chicago, IL 1942 8 PHL Philadelphia, PA 1927 6 PIT Pittsburgh, PA 1946 4 SEA Seattle, WA 1944 6 SFO San Francisco, CA 1927 8

dbo.Flights (example)

FlightID PlaneID AirlineID AirportCodeOfDeparture AirportCodeOfArrival DepartureDateTime ArrivalDateTime 1000 118 1 PIT DFW 2018-12-23 06:28:00.000 2018-12-23 09:45:00.000 1001 111 3 LAS MCO 2019-04-24 18:50:00.000 2019-04-24 22:23:00.000 1002 122 2 MIA BOI 2018-12-29 17:46:00.000 2018-12-29 18:59:00.000 1003 112 2 ORD SEA 2018-12-31 16:21:00.000 2018-12-31 19:33:00.000 1004 114 1 PHL MCO 2019-02-23 11:53:00.000 2019-02-23 12:25:00.000 1005 121 2 MIA JAX 2019-01-01 11:43:00.000 2019-01-01 15:04:00.000 1006 101 3 BOI SFO 2019-04-09 12:41:00.000 2019-04-09 14:25:00.000 1007 125 3 IAH PHL 2019-03-20 12:48:00.000 2019-03-20 15:07:00.000 1008 123 1 DFW ORD 2019-01-06 05:31:00.000 2019-01-06 09:56:00.000

dbo.Planes

PlaneID Manufacturer ModelNum OriginalPurchaseDate LastServiceDate AirlineID NumSeats 100 Boeing 787 Dreamliner 2014-10-10 2018-08-17 1 505 101 Boeing 737-900 2003-03-23 2018-08-26 3 262 102 Embraer RJ-45 1999-11-24 2018-07-31 3 NULL 103 Embraer RJ-45 2002-10-02 2018-06-20 1 NULL 104 Boeing 737-900 2000-04-16 2018-07-24 2 262 105 Boeing 747-400 2001-10-25 2018-05-03 3 NULL Question image text in transcribed

2. Consider the following screenshot: The Statement 1 American airlines operated flight number 253 which departed Pittsburgh, PA (PIT) on Sunday, August 28th, 2016 at 0628 and arrived in Dalas-Fort Worth, TX (DFW) on Sunday, August 28th, 2016 at 09:45 2 Southwest airlines operated flight number 254 which departed Las Vegas, NV (LAS) on Thursday, July 28th, 2016 at 18:50 and arrived in Orlando, FL (MCO) on Thursday, July 28th, 2016 at 22 23. 3 Delta airlines operated flight number 255 which departed Miami, FL (MIA) on Friday, September 23rd, 2016 at 17:46 and arrived in Boise, ID (BO) on Friday, September 23rd, 2016 at 18:59 4 Delta airlines operated flight number 256 which departed Chicago, IL (ORD) on Wednesday, August 3rd, 2016 at 16:21 and arrived in Seattle, WA (SEA) on Wednesday, August 3rd, 2016 at 19.33. 5 American airlines will operate flight number 257 which departs Philadelphia, PA (PHL) on Monday, October 10th, 2016 at 11:53 and arrives in Orlando, FL (MCO) on Monday, October 10th, 2016 at 12:25. 6 Delta airlines operated flight number 258 which departed Miami, FL (MIA) on Sunday, August 28th, 2016 at 11:43 and arrived in Jacksonville, FL (JAX) on Sunday, August 28th, 2016 at 15:04 7 Southwest airlines operated flight number 259 which departed Boise, ID (BOI) on Friday, August 26th, 2016 at 1241 and arrived in San Francisco, CA (SFO) on Friday, August 26th, 2016 at 14:25. 8 Southwest airlines operated fight number 260 which departed Houston, TX (IAH) on Friday, September 16th, 2016 at 12:48 and arrived in Philadelphio, PA (PHL) on Friday, September 16th, 2016 at 15:07 9 American airlines operated fight number 261 which departed Dallas-Fort Worth, TX (DFW) on Saturday, August 13th, 2016 at 05:31 and arrived in Chicago, IL (ORD) on Saturday, August 13th, 2016 at 09:56 10 Southwest airlines operated flight number 262 which departed Seattle, WA (SEA) on Monday, July 25th, 2016 at 22:23 and arrived in Boise, ID (BOI) on Tuesday, July 26th, 2016 at 01:47 1 American airlines operated flight number 263 which departed Chicago, IL (ORD) on Friday, August 26th, 2016 at 11:16 and arrived in Houston, TX (IAH) on Friday, August 26th, 2016 at 14:45. 12 American airlines operated flight number 264 which departed Atlanto, GA (ATL) on Thursday, August 11th, 2016 at 02:58 and arrived in San Francisco, CA (SFO) on Thursday, August 11th, 2016 at 03:08 13 American airlines operated flight number 265 which departed Seattle, WA (SEA) on Monday, September 26th, 2016 at 07:00 and arrived in Chicago, IL (ORD) on Monday, September 26th, 2016 at 08:23. 14 Delta airlines operated flight number 266 which departed Salt Lake City, UT (SLC) on Thursday, August 18th, 2016 at 11:16 and arrived in Las Vegas, NV (LAS) on Thursday, August 18th, 2016 at 15:38. Write a SQL statement that will return results that match the format of those shown above, noting the following details Flights that are in the future use future tense verbs (e.g....will operate...), while flights that are in the past use past tense verbs (e.g. ...operated...) There are correct suffixes on the ends of the date numbers (e.g. 17th, 23rd, 1st, etc.) The query returns exactly the number of rows in the Flights table. The query only returns one column, labeled "The Statement". The times are correctly expressed in HH:mm format. City names and airport codes are shown correctly 2. Consider the following screenshot: The Statement 1 American airlines operated flight number 253 which departed Pittsburgh, PA (PIT) on Sunday, August 28th, 2016 at 0628 and arrived in Dalas-Fort Worth, TX (DFW) on Sunday, August 28th, 2016 at 09:45 2 Southwest airlines operated flight number 254 which departed Las Vegas, NV (LAS) on Thursday, July 28th, 2016 at 18:50 and arrived in Orlando, FL (MCO) on Thursday, July 28th, 2016 at 22 23. 3 Delta airlines operated flight number 255 which departed Miami, FL (MIA) on Friday, September 23rd, 2016 at 17:46 and arrived in Boise, ID (BO) on Friday, September 23rd, 2016 at 18:59 4 Delta airlines operated flight number 256 which departed Chicago, IL (ORD) on Wednesday, August 3rd, 2016 at 16:21 and arrived in Seattle, WA (SEA) on Wednesday, August 3rd, 2016 at 19.33. 5 American airlines will operate flight number 257 which departs Philadelphia, PA (PHL) on Monday, October 10th, 2016 at 11:53 and arrives in Orlando, FL (MCO) on Monday, October 10th, 2016 at 12:25. 6 Delta airlines operated flight number 258 which departed Miami, FL (MIA) on Sunday, August 28th, 2016 at 11:43 and arrived in Jacksonville, FL (JAX) on Sunday, August 28th, 2016 at 15:04 7 Southwest airlines operated flight number 259 which departed Boise, ID (BOI) on Friday, August 26th, 2016 at 1241 and arrived in San Francisco, CA (SFO) on Friday, August 26th, 2016 at 14:25. 8 Southwest airlines operated fight number 260 which departed Houston, TX (IAH) on Friday, September 16th, 2016 at 12:48 and arrived in Philadelphio, PA (PHL) on Friday, September 16th, 2016 at 15:07 9 American airlines operated fight number 261 which departed Dallas-Fort Worth, TX (DFW) on Saturday, August 13th, 2016 at 05:31 and arrived in Chicago, IL (ORD) on Saturday, August 13th, 2016 at 09:56 10 Southwest airlines operated flight number 262 which departed Seattle, WA (SEA) on Monday, July 25th, 2016 at 22:23 and arrived in Boise, ID (BOI) on Tuesday, July 26th, 2016 at 01:47 1 American airlines operated flight number 263 which departed Chicago, IL (ORD) on Friday, August 26th, 2016 at 11:16 and arrived in Houston, TX (IAH) on Friday, August 26th, 2016 at 14:45. 12 American airlines operated flight number 264 which departed Atlanto, GA (ATL) on Thursday, August 11th, 2016 at 02:58 and arrived in San Francisco, CA (SFO) on Thursday, August 11th, 2016 at 03:08 13 American airlines operated flight number 265 which departed Seattle, WA (SEA) on Monday, September 26th, 2016 at 07:00 and arrived in Chicago, IL (ORD) on Monday, September 26th, 2016 at 08:23. 14 Delta airlines operated flight number 266 which departed Salt Lake City, UT (SLC) on Thursday, August 18th, 2016 at 11:16 and arrived in Las Vegas, NV (LAS) on Thursday, August 18th, 2016 at 15:38. Write a SQL statement that will return results that match the format of those shown above, noting the following details Flights that are in the future use future tense verbs (e.g....will operate...), while flights that are in the past use past tense verbs (e.g. ...operated...) There are correct suffixes on the ends of the date numbers (e.g. 17th, 23rd, 1st, etc.) The query returns exactly the number of rows in the Flights table. The query only returns one column, labeled "The Statement". The times are correctly expressed in HH:mm format. City names and airport codes are shown correctly

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

Databases And Python Programming MySQL MongoDB OOP And Tkinter

Authors: R. PANNEERSELVAM

1st Edition

9357011331, 978-9357011334

More Books

Students also viewed these Databases questions