创建关系数据库 [英] Creating relational database

查看:110
本文介绍了创建关系数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

E图,我需要变成数据库。我知道我的主键,但不真正理解如何链接不同的表在一起。



所以我有操作员表名为主键。每个操作者可以操作那些列车的一定比例。例如运营商a30 =这些服务的30%和运营商b 70%的那些服务100全部等等...
这是被困住的部分。我需要另一个表来将这两个表链接在一起吗?



对于每个火车,我需要存储从哪个车站开始,并且它将再次终止(目的地)

解决方案

p>

否,对于列车起点和终点站点,您可以使用您的操作框来表示与OperatorID / TrainID的键表。不需要另一个表,只需要列表中的字段。



这是家庭作业吗?这些新概念是你吗?


E diagram which i need to turn into databse. I know my primary keys but do not really understand how to link the different tables together.

So I have operator table with name as primary key. Each operator can operate certain proportion of those trains. e.g operator "a" 30 = 30% of those services and operator b 70% of those services 100 all of them etc... This is the part im stuck with. Do I need another table to link these two tables together ?

for each train i need to store which station it starts from and where its going to terminate (destination) once again do i create new table for this ?

Thank you in advance

解决方案

You can use your Operates box as a representation of your keys table with OperatorID/TrainID to associate operators with trains.

No, for train start and end stationIDs, you don't need another table, just fields in the Train table.

Is this homework? Are these new concepts for you?

这篇关于创建关系数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆