表设计策略sql server [英] table design policy sql server

查看:77
本文介绍了表设计策略sql server的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我为我的大学有一个小型销售系统的项目
我有一个用于交易的表,一个用于交易项的表(该交易中的商品)
我是真的?????????????????????
您向我推荐了哪些表和关系政策?
请帮助我,谢谢

hi all pro
i have a project for my university that is a small sale system
i have a table for Transaction and one for TransactionItems (Goods within that Transaction)
am i true???????????????????
what Tables and Relations Policy Do you Recommended to me?
please help me , thanks

推荐答案

表及其关系取决于您项目的要求.

但是,在您的示例中,事务很可能应该具有一个primaryy键,可能是一个代理,并且事务对象将具有一个引用事务表的外键列.定义外键以便将对事务表的删除操作级联到transactionitem表也很有可能.
The tables and their relations depend on the requirements of your project.

However in your example most likely the transaction should have a primarey key, possibly a surrogate and the transactioitem would have a foreign key column referencing the transaction table. Also it most likely would make sense to define the foreign key to cascade delete operations on transaction table to the transactionitem table.


这篇关于表设计策略sql server的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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