dbTalk Databases Forums  

schema design question

microsoft.public.sqlserver.programming microsoft.public.sqlserver.programming


Discuss schema design question in the microsoft.public.sqlserver.programming forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Smokey Grindel
 
Posts: n/a

Default schema design question - 08-25-2009 , 09:25 AM






With the use of schemas (instead of just dbo as the schema) now, there is a
design question I have... Say you have three entities that have tables
representing them such as People, Accounts and Businesses... how would you
represent this schema wise? Our business logic says users don't necessarily
have access to all three... so we figured that people related information is
under a "People" schema... like PersonalInformation table... etc.., and
Account information is its own Accounts schema... so we have
AccountInformation, AccountOrders (since orders are from accounts only)..
does this make sense from a schema point of view? each of the three have
different security setups... so it seemed to make sense from that point of
view...

now the real question... people accounts and businesses can all have
addresses... how would you set this up? would you make one address table and
make a one to many table to link them (as a person could have more then one
address, as also an account...) or would you make address tables at each
schema level ... so People.Addresses, Accounts.Addresses... kind of like how
the AdventureWorks database does for the different departmental schemas...

what are the pro's opinions? thanks!

Reply With Quote
  #2  
Old   
TheSQLGuru
 
Posts: n/a

Default Re: schema design question - 08-25-2009 , 01:18 PM






I am squarely in the camp that you shouldn't use something just because it
is available. Things are MUCH simpler if you use dbo as the schema for all
objects. You may want/need to do otherwise in certain situations, but I try
to avoid non-dbo when at all possible.

--
Kevin G. Boles
Indicium Resources, Inc.
SQL Server MVP
kgboles a earthlink dt net


"Smokey Grindel" <nospam (AT) nospam (DOT) com> wrote

Quote:
With the use of schemas (instead of just dbo as the schema) now, there is
a design question I have... Say you have three entities that have tables
representing them such as People, Accounts and Businesses... how would you
represent this schema wise? Our business logic says users don't
necessarily have access to all three... so we figured that people related
information is under a "People" schema... like PersonalInformation
table... etc.., and Account information is its own Accounts schema... so
we have AccountInformation, AccountOrders (since orders are from accounts
only).. does this make sense from a schema point of view? each of the
three have different security setups... so it seemed to make sense from
that point of view...

now the real question... people accounts and businesses can all have
addresses... how would you set this up? would you make one address table
and make a one to many table to link them (as a person could have more
then one address, as also an account...) or would you make address tables
at each schema level ... so People.Addresses, Accounts.Addresses... kind
of like how the AdventureWorks database does for the different
departmental schemas...

what are the pro's opinions? thanks!

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.