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
)
如果航班改期,我们如何生成需要联系的客户列表?
到目前为止,我已经完成了:
SELECT
LeadCustomer.CustomerID,Flight.FlightID
FROM LeadCustomer
inner join FlightBooking
ON LeadCustomer.CustomerID = FlightBooking.CustomerID
inner join
Flight ON FlightBooking.FlightID = Flight.FlightID;
但不知道如何更新飞行时间