设计数据库的更好方法 [英] Better Way To Design Database

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

问题描述



我大约有50个表对象.

我在某些表格中有共同的数据,例如(产品名称,说明,评论....)

例如:杂货,大理石,使用者....

所有表的名称,说明和某些列是通用的.

将来会有更多新表被添加到列中,如果我们需要添加表或列,我需要联系我的数据库.

我想出了

一个具有表列表的表(表的主表)和列主表,其中哪个表中的列是

例如:表格主:杂货,用户..

列主:名称,描述,注释

table_column_Master:用于表主控器和列主控器的关系表:表主控器的PK和列主控器的PK,以及一个运行ID作为此表的PK.

我有一个数据表来存储所有字符串值并维护与table_column_Master的关系.

但我认为执行任何操作的查询都很昂贵.例如:要获取对数据表的userdetails查询的次数很高(为userdetails选择查询num =列数)

我没有任何其他设计.请有人帮我.

问候,

Sekhar

Hi,

I have around 50 table objects.

i have common data in some of the tables like(product name, description,comment....)

ex: groceries, marbles, users, ....

all tables Name, remarks and some of the columns are common.

Future some more new tables are columns may come into addition, if we need to add table or column i need to touch my DB.

i come up with

one table with list of tables (master of tables) and column master table for in which table what are the columns

ex: table master : groceries,users..

column master: name,description,comment

table_column_Master: relation table for tablemaster and column master : PK of table master and PK of column master and one running id as PK for this table.

i have a data table to store all string values and maintaining relation with table_column_Master.

but i am thinking queries to perform any action is expensive. ex: to get userdetails queries to datatable is high (select query num = no.of columns for userdetails )

i am not getting any other design. please some one help me.

Regards,

Sekhar

推荐答案

没有简单的数据库设计方法.数据库设计更多的是艺术而不是科学.每个数据库都是经过定制的,以适合特定的应用程序.它要求勤奋,细致和耐心.数据库设计的基础取决于需求收集和分析的结果和质量.精心设计的数据库将捕获组织的工作流程和业务规则.
您将在设计过程中做出许多决定.在制定此类决策时可以使用指导原则和原则,但通常是关于不该做什么"而不是该做什么".因此,最终您几乎无所事事地做出决定.
参考:
1.10+陷阱+数据库+设计 [ ^ ]
2. 关系数据库设计基础 [
There is no easy way to database design. Database design is more an art than science. Every database is customized to suit a particular application. It calls for hard work, meticulous, and patient. The basis of database design depends on the result and quality of requirements gathering and analysis. A well designed database will capture the workflow and business rules of an orgainization.
You will have to make many decisions in the designing process. Guidelines and principles are available in making such decisions, but they are usually about "what not to do" instead of "what to do". So, ultimately you are left pretty much alone to make the decisions.
Refer:
1. 10+pitfalls+of+database+design[^]
2. Fundamentals of Relational Database Design[^]


将评论发布为解决方案,因为没有其他响应

SQL Server系统表将为您提供数据库中的表及其中的列的列表.如果您在多个表之间复制了公共"数据,则需要了解
数据库规范化 [
Posting comment as solution as there has been no other response

SQL Server system tables will provide you with a list of tables in a database and the columns in them. If you have "common" data replicated across multiple tables then you need to learn about Database Normalization[^]


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

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