0
CREATE TABLE LeadCustomer
(
CustomerID INTEGER NOT NULL, FirstName VARCHAR(20) NOT NULL,
Surname VARCHAR(40) NOT NULL, BillingAddress VARCHAR(200) NOT NULL,
email VARCHAR(30) NOT NULL
)
CREATE TABLE Flight
(
FlightID INTEGER NOT NULL, FlightDate TIMESTAMP NOT NULL,
Origin VARCHAR(30) NOT NULL, Destination VARCHAR(30) NOT NULL,
MaxCapacity INTEGER NOT NULL, PricePerSeat DECIMAL NOT NULL
)
CREATE TABLE FlightBooking
(
BookingID INTEGER NOT NULL, CustomerID INTEGER NOT NULL, FlightID INTEGER NOT NULL,
NumSeats INTEGER NOT NULL, Status CHAR(1) NOT NULL, BookingTime TIMESTAMP NOT NULL,
TotalCost DECIMAL
)
如果航班重新安排,我們如何生成需要聯繫的客戶列表?Sql加入,更新一個表格並從另一個表格生成輸出
到目前爲止,我已經完成了到:
SELECT
LeadCustomer.CustomerID,Flight.FlightID
FROM LeadCustomer
inner join FlightBooking
ON LeadCustomer.CustomerID = FlightBooking.CustomerID
inner join
Flight ON FlightBooking.FlightID = Flight.FlightID;
,但不知道如何更新的飛行時間