如何在表格中表示这一点?
我有一个像这样的数据集合
Programme title | Episode | Subtitle | Performers | Description
最初我将其标准化为两个表,所以
PROGRAMME
progid | progtitle | description
EPISODE
epid | progid | episode | subtitle | description
我想我想在另一个表中表示表演者,但不确定如何表示它。据我所知,存在以下关系
- 一对多:一个节目可以有许多表演者
- 一对多:一个表演者可以在许多节目中出现
我不确定如何表示这一点?
编辑啊,我明白了,所以我实际上会有这样的表格?
PERFORMER
performerid | performer
PROGRAMME
progid | progtitle | description
EPISODE
epid | progid | episode | subtitle | description
PROG_PERFORMER
progid | performerid
I have a collection of data like so
Programme title | Episode | Subtitle | Performers | Description
Initially I normalised this into two table like so
PROGRAMME
progid | progtitle | description
EPISODE
epid | progid | episode | subtitle | description
I'm thinking I'd like to represent the performers in another table though, but not sure how to represent it. From what I can tell the following relationships exist
- One to Many: A programme can have many performers
- One to Many: A performer could feature in many programmes
I'm not sure how I would represent this?
EDIT Ah I see so I'd actually have tables like this for example?
PERFORMER
performerid | performer
PROGRAMME
progid | progtitle | description
EPISODE
epid | progid | episode | subtitle | description
PROG_PERFORMER
progid | performerid
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
此外,表演者可以在剧集之间更换
Also, performers can change between episodes
这是多对多。一名表演者可以参与多个节目,一个节目可以有多个表演者。
网络上(以及教科书中)有大量关于建立多对多关系的信息。其中一个资源如下:
http:// /www.tekstenuitleg.net/en/articles/software/database-design-tutorial/many-to-many.html
确实,虽然应该是
这足以创建一个列出所有表演者/节目/剧集关系的查询。
It's many-to-many. One performer can be in multiple programs, and one program can have multiple performers.
There's plenty of information on the net (and in textbooks) about setting up many-to-may relationships. One such resource is here:
http://www.tekstenuitleg.net/en/articles/software/database-design-tutorial/many-to-many.html
Really, though it should be
This is enough to create a query that will list all performer/show/episode relationships.
除了执行者表之外,您还必须创建一个关系表
执行者表
关系表
beside performer table you have to create a relation table
performer table
relation table