关系数据库设计 - 拆分表

时间:2017-03-22 15:52:08

标签: database database-design relational-database

我认为我需要拆分一个表,因为有些记录与一个表和其他表相关的其他记录有关。但我真的需要拆分桌子吗?

表格如下:

SAMPLE( sample_id ,sample_type,borehole_id)
钻孔( borehole_id ,x,y,z)
TRAM( drawpoint_id section_id

表SAMPLE包含 core tram 类型的样本。核心样本与BOREHOLE表相关,电车样本与TRAM表相关。 (电车样本没有地理坐标,因此需要单独保存)

除了分类型样品数据相同外,实际上我们无法根据分析实验室输入的类型分离样品。我们可能会在一个报告中从实验室获取样本数据,并且只会在查询类型后知道它们的类型。我希望将所有SAMPLE检测结果存储在一个表中。

这通常如何处理?

1 个答案:

答案 0 :(得分:0)

If the data is identical then the design od table SAMPLE is wrong. I probably dont understant what you are trying to achieve, but the table SAMPLE needs only a couple of fields id_sample and title (or name), then youll need a table for storing these samples listings, say LIST table. Table LIST would have fields id_list, id_sample, id_borehole, date_rcvd, etc (whatever fields you need to keep information about specific sample with its characteristcs) Its not clear to me what the table TRAM should store, but it seems that you are repeating two columns from it to the SAMPLE table which is wrong.