两种数据库设计比较 [英] Two Data Base Design Comparison

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

问题描述

我有两种数据库设计方法,我开发了一个系统(它是一个会计系统)
在我的数据库设计中,我发现,我有采购订单表,采购账单表和采购退货表,当然每个订单,采购或退货都必须是自己的物品,假设三个票据的每个物品信息是一样,所以现在我有了一个名为Bill Items的新表,一种明智的方法是为这三个Bill的所有项制作一个Table,如下所示.
BillItems表(F1,F2,F3 .....,
PurchaseOrderID(允许为空),PurchaseBillID(允许为空),PurchaseReturnID(允许为空))

这是第一个解决方案,

第二种解决方案是使BillItem表将其分为三个表
1-PurchaseOrderItems(F1,F2,F3,....PurchaseOrderID(不允许为null))
2-PurchaseBillItems(F1,F2,F3,....PurchaseBillID(不允许为null))
1-PurchaseReturnItems(F1,F2,F3,....purchaseReturnID(不允许为null))


现在我想知道哪种解决方案是最好的...?

I have Two Data base Design approach , I develop a system (it is an accounting system )
during my data base design i found that , i have Purchase Order Table , Purchase Bill Table and Purchase Return Table , Of course Each Order , Purchase , Or Return Must Have it is Own Item , Suppose that Each item information For the three Bills Is the Same , So for now i have A new Table Called Bill Items , the wright Way , is to make One Table For all items of the three bill and it will be as follow
BillItems table (F1 , F2 , F3 ..... ,
PurchaseOrderID(Allow Null),PurchaseBillID (Allow Null),PurchaseReturnID(Allow Null))

this is the First Solution,

the Second Solution is to make the BillItem Table Divide it into three tables
1 - PurchaseOrderItems (F1 , F2 , F3 , .... PurchaseOrderID(does not allow null))
2 - PurchaseBillItems (F1 , F2 , F3 , .... PurchaseBillID(does not allow null))
1 - PurchaseReturnItems (F1 , F2 , F3 , .... PurchaseReturnID(does not allow null))


now i want to know which of the Solutions is the best...?
thanks Every One.

推荐答案

第二种方法是最好的,适合稳定的DB结构.
Second approach is the best and suits in stable DB stucture.


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

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