-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathview_Upcomigarrivals.sql
28 lines (19 loc) · 1 KB
/
view_Upcomigarrivals.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
CREATE VIEW upcomingArrivals
AS
SELECT dbo.Flight.Flight_number AS [Flight Number],
dbo.Airline.Airline_name AS [Air Line Name],
dbo.Airline.Company_name AS [Company Name],
dbo.Flight.Flight_type AS [Flight Type],
dbo.Flight_leg_A.Date_of_flight AS [Date of Arrival],
dbo.Flight_leg_A.Arrival_time AS [Arrival Time],
dbo.Flight_leg_A.Arrival_teminal_number AS [Arrival Terminal]
FROM dbo.Airline
Inner JOIN dbo.Flight ON dbo.Airline.Airline_code = dbo.Flight.Airline_code
INNER JOIN dbo.Flight_leg_A ON dbo.Flight.Flight_number = dbo.Flight_leg_A.Flight_number
WHERE Flight.Flight_type='Arrival' AND Flight_Leg_A.Date_of_Flight> GETDATE()
select * from upcomingArrivals
select * from Flight
select * from Flight_leg_A
update Flight_leg_A set Date_of_flight='2019-02-21' where Leg_number='arl1597456'
/* Execution*/
select * from upcomingArrivals