Friday, February 17, 2012

Design of database tables

Dear sir

I have one SQL Server database.
In this database more than 20 tables exists
that their structures is same.
I have two way for design this tables:
1.Create all tables separately(create more than 20 tables)
2.Create one table and separate each group
by type(add column type to table and assign same
value for each group)

What is better solution?
Please help me.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!From the limited information you present I would say 2 is better. Less
maintenance if the table design changes. Easier selection of data if you
need to present data or compare data on multiple groups.

If there was a reason to create 20 identical tables a better solution might
be to create one table and then 20 views, one for each group.

Perhaps this helps.

CJ

"Homauoon Mahboobi" <hmmahboobi@.yahoo.com> wrote in message
news:3f141d62$0$205$75868355@.news.frii.net...
> Dear sir
> I have one SQL Server database.
> In this database more than 20 tables exists
> that their structures is same.
> I have two way for design this tables:
> 1.Create all tables separately(create more than 20 tables)
> 2.Create one table and separate each group
> by type(add column type to table and assign same
> value for each group)
> What is better solution?
> Please help me.
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!|||>> What is better solution? <<

Only you will know!

A specific logical design is entirely dependant upon a specific business
model. It is the entities, relationships among the entities as well as the
functional dependancies among the attributes which determine the 'right' way
of representing them. Simply grouping & regrouping tables, without
understanding the business predicates makes no sense in logical modelling.

By definition a table should represent one entity type. Thus multiple tables
with 'same' structure seems to be a badly designed schema.

--
- Anith
( Please reply to newsgroups only )|||Homauoon Mahboobi (hmmahboobi@.yahoo.com) writes:
> I have one SQL Server database.
> In this database more than 20 tables exists
> that their structures is same.
> I have two way for design this tables:
> 1.Create all tables separately(create more than 20 tables)
> 2.Create one table and separate each group
> by type(add column type to table and assign same
> value for each group)

2. sounds more appealing, but I have no problem to envision the case where
this would be the wrong way to go. You need to tell more about your data
model, to get some good answer.

--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

No comments:

Post a Comment