Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help in SQL please. 3. Any flights currently scheduled, or that may be added to the Flights table in the future, originating in Boise

Need help in SQL please.

3. Any flights currently scheduled, or that may be added to the Flights table in the future, originating in Boise and landing in Salt Lake City after the month of August have been cancelled. Write SQL that will remove any flights that violate this criteria, ensuring that your SQL will not only work to remove the correct flights now, but will also remove any flights added later. In other words, every time your SQL is run, it should remove any flights from Boise to Salt Lake scheduled to occur after August of this year. Your SQL should not remove already completed flights from Boise to Salt Lake, if any.

image text in transcribed

4. List each airline name with a count of the number of flights (past, present or future), even if the airline hasnt flown any flights. Sort from most flights to fewest flights. Alias the count column as "Number of Flights".

image text in transcribed

ELECT TOP (1000) [FlightID] , [PlaneID] [AirlineID] , [AirportCodeOfDeparture] , [AirportCodeOfArrival] , [DepartureDateTime] ,[ArrivalDateTime] FROM [dbo] [Flights] sults FlightID PlanelD AilinelD AirportCodeOfDeparture AirportCodeOf Arival DepartureDate Time 1072 116 1073 124 1074 107 1075 102 1076 109 1077 106 1078 118 1079 127 1080 101 1081 1082 104 1083 1084 1085 127 1086 1087 119 1088 105 1089114 1090 118 AmrivalDate Time DFW LAS 2018-12-30 11:03:00.000 2018-12-30 15:18:00.000 2019-02-13 15:34:00.000 2019-02-13 17:41:00.000 2019-01-05 14:14:00.000 2019-01-05 16:17:00.000 2019-01-07 21:26:00.000 2019-01-07 23:56:00.000 2019-02-23 10:42:00.000 2019-02-23 12:26:00.000 2019-01-05 13:38:00.000 2019-01-05 14:43:00.000 2019-04-27 09:50:00.000 2019-04-27 12:17:00.000 2019-04-23 16:21:00.000 2019-04-23 17:52:00.000 2019-02-28 16:17:00.000 2019-02-28 18:44:00.000 2019-01-26 09:41:00.000 2019-01-26 11:24:00.000 2019-03-26 12:11:00.000 2019-03-26 15:53:00.000 2018-12-13 10:16:00.000 2018-12-13 11:25:00.000 2019-01-08 00:24:00.000 2019-01-08 02:59:00.000 2019-01-11 01:34:00.000 2019-01-11 04:58:00.000 2019-02-27 22:24:00.000 2019-02-28 01:38:00.000 2019-01-26 21:03:00.000 2019-01-26 22:35:00.000 2019-02-12 06:27:00.000 2019-02-12 10:39:00.000 2019-01-23 04:01:00.000 2019-01-23 06:13:00.000 2019-02-28 11:11:00.000 2019-02-28 12:29:00.000 ORD PHL ORD ORD JFK ATL PHL DFW SLC ORD ORD ORD 124 LAS PIT 106 124 DFW ORD SFO DFW SFO DFW 121 BOI SLC LAS JAX Script for SelectTopNRows command fro SELECT TOP (1000) [Airline!D] AirlineName FROM [ bo].[Airlines] Results Messages AilinelD AirlineName American Delta Southwest Airlines United Virgin Atlantic Frontier Airlines Frontier Airlines 4 7

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 Driven Web Sites

Authors: Joline Morrison, Mike Morrison

2nd Edition

? 061906448X, 978-0619064488

More Books

Students also viewed these Databases questions

Question

Discuss whether we can control stereotyping.

Answered: 1 week ago