实体模型帮助
我的数据库中有以下模型,但我对应该做什么有点困惑。
如果我有座位表,它最终会创建这么多行,A - 1,A - 2 等
我怎样才能分割这个数据,这样它就不会这样做?我希望将 SeatRow 和 SeatNumber 分开,这样我就可以轻松匹配程序中的值。
谢谢
I have the following model in my database, but I'm a bit confused on what I should do.
If I have the Seat table how it is, it will end up creating so many rows, A - 1, A - 2 etc
How can I have this data split so it doesn't do this? I wanted the seatRow and seatNumber separate so I can easily match the values around the program.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在给定的场景中,我没有看到座位表中有大量行的问题。我相信你所指的就是这一点。
假设您的场地有 100 个座位,100 排。
如果您遵循所有规范化规则,您最终只会将两个表重新合并在一起。该设计看起来不错。将 SeatRow 和 Number 放在一起不会对行数产生较大或较小的影响。让他们分开是一个聪明的主意。 Microsoft SQL Server 对于这种架构并对其进行索引以提高性能不会有任何问题。对于 Access 和其他基于文件的数据库,我不熟悉索引策略,因此无法发表评论。
In the given scenario I don't see the problem with having a large number of rows in the seat table. Which is what I believe you are alluding to.
Lets say you have a venue that has 1000 seats over 100 rows.
If you followed all normalisation rules you would only end up merging the two tables back together. The design looks fine for what it is. Placing the SeatRow and Number together would have no bigger or smaller impact on the number of rows. It's a smart idea to leave them split. Microsoft SQL Server would have no problem with this architecture and indexing it for performance. For Access and other file based databases I'm not familiar with the indexing policies so I can't comment.
您回答自己的问题:“座位有 1 行和 1 个号码”,因此您可以将它们创建到表中并在座位表中添加外键。
You answer your own question: "a seat has 1 Row and 1 Number", so you can create these to tables and add foreign keys in your Seat table.