帮助了解预订系统
我正在创建一个剧院预订系统。
我很困惑如何在一次预订中获取多张门票,并能够单独查询这些门票。 (与问题无关的字段未包含在内)
我有一个票表:
ticketId, ticketName
预订表:
bookingId, bookingReference, ticketId
连接此表时,我将能够创建许多票,但 bookingId 每次都会更改,我需要能够找到与预订相关的所有门票,然后查询单独的门票,以便它可以用于单票打印等。
任何人都可以帮助我了解我需要做什么。
谢谢。
I'm creating a theatre booking system.
I am quite confused on how I can get multiple tickets to one booking, and able to query those tickets separately. (fields that are of no relevance to the question have not been included)
I have a ticket table:
ticketId, ticketName
Booking Table:
bookingId, bookingReference, ticketId
When connecting this I will receive the ability to create many tickets but the bookingId will change everytime, I will need the ability to find all the tickets associated with a booking and then query an individual ticket so it can be used for single ticket printing etc.
Can anyone help me understand what I need to do.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Tickets 和 Bookings 之间的关系是多对一的。在票证表中包含一个字段 bookingid 比在 Booking 表中包含一个 TicketId 字段更有意义:
票证表:
ticketId、ticketName、bookingId
预订表:
bookingId、bookingReference
等
The relationship between Tickets and Bookings is many to one. It would make more sense to have a field bookingid in the ticket Table rather than having a ticketId field in Booking table:
Ticket table:
ticketId, ticketName, bookingId
Booking Table:
bookingId, bookingReference
etc