问题描述
我有两个桌子.具有15个字段的Table1具有6个字段的Table2.在这6个字段中,有5个字段将共享与表1中相同的数据.这意味着,如果更新了Table1,我还必须更新Table2,除了这个Table2还将拥有自己的数据.
我的问题是我应该摆脱Table2并向Table1添加一个额外的字段,在这种情况下,其余9个字段对于之前进入Table2的数据将具有空值.
或者我保留Table2;但是在那种情况下,我将不得不以编程方式维护两个表,这将导致数据重复.这两个表的数据始终匹配是非常重要的,因为这是程序的核心.
在此先感谢.
I have two tables; Table1 with 15 fields Table2 with 6 fields. Among these 6 fields 5 fields will share same data as in Table1. Which means If Table1 is updated I have to update Table2 as well, apart from this Table2 will have its own data as well.
My question is should I get rid of Table2 & add one extra field to Table1, in this case the remaining 9 fields will have null values for the data that was going into Table2 before.
Or I keep Table2; but in that case I will have to programmatically maintain both tables, which will cause data duplication. It is very important that the data of these two tables always match as it is the heart of the program.
Thanks in Advance.
推荐答案
这篇关于SQL数据库设计-如何的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!