更新时间:2023-12-04 12:30:34
拆分表.
每张票仅可容纳一名乘客.预订可以是一张或多张票.
Booking
Split the table.
Each ticket is for one and only one passenger. A booking can be for one or more tickets.Booking
Field Type Null Default Description
booking_no int(7) No Booking No.
t_no int(4) Yes NULL Train No.
t_name varchar(30) Yes NULL Train Name
s_frm varchar(30) Yes NULL Station From
s_to varchar(30) Yes NULL Station To
j_date date Yes NULL Journey Date
class varchar(10) Yes NULL Class
Ticket
Ticket
Field Type Null Default Description
booking_no int(7) No Booking No.
pnr_no int(7) No PNR No.
p_name varchar(30) Yes NULL Passenger Name
p_age tinyint(2) Yes NULL Passenger Age
p_sex char(1) Yes NULL Passenger Sex
p_sc varchar(3) Yes NULL Passenger Senior Citizen
p_berth char(1) Yes NULL Passenger Berth
然后,您的报告将使用字段booking_no
将两个表连接起来.
Your report then joins the two tables using the field booking_no
.