SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Design Question - Company, Clients, Branches, Departments


Design Question - Company, Clients, Branches, Departments

Author
Message
netpicker9
netpicker9
SSC Journeyman
SSC Journeyman (77 reputation)SSC Journeyman (77 reputation)SSC Journeyman (77 reputation)SSC Journeyman (77 reputation)SSC Journeyman (77 reputation)SSC Journeyman (77 reputation)SSC Journeyman (77 reputation)SSC Journeyman (77 reputation)

Group: General Forum Members
Points: 77 Visits: 43
Hi,

Can any one please let me know how design tables below,

1. Company
2. Client
3. Branch
4. Departments

Points:
a. Some companies do not have any branches and just departments
b. If company happen have any branch, do I need an entry in branch table for corporate office?
c. Is it better to use Branch, Departments tables for Company & Client tables?

I know this is basic but, I need your help!

Thanks
bitbucket-25253
bitbucket-25253
SSCoach
SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)

Group: General Forum Members
Points: 15861 Visits: 25280
What you need to do is to develope an overall requirements document specifying what you management expects to use the database for.
a. What data do people need/want to view
b. How is data collected.
and on and on
Once you have a requirements document finished and reviewed and approved by your managemnt, Then you can concern yourself about individual tables, how they are linked together using foreing keys, etc etc.

If everything seems to be going well, you have obviously overlooked something.

Ron

Please help us, help you -before posting a question please read

Before posting a performance problem please read
PaulB-TheOneAndOnly
PaulB-TheOneAndOnly
SSChampion
SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)

Group: General Forum Members
Points: 14257 Visits: 4639
netpicker9 (12/8/2010)
Can any one please let me know how design tables below,

1. Company
2. Client
3. Branch
4. Departments

Points:
a. Some companies do not have any branches and just departments
b. If company happen have any branch, do I need an entry in branch table for corporate office?
c. Is it better to use Branch, Departments tables for Company & Client tables?

I know this is basic but, I need your help!


I assume this is not being developed for a specific company but it is intended to be used to serve multiple companies you don't even know yet - is that a correct assumption?

If that's the case I'll make an executive decision and say "all companies have at least one branch - which is the company's headquarter"

Then, for a three "branches" company your database will show four e.g. headquarter plus three non-headquarters branches.

Hope this helps.

_____________________________________
Pablo (Paul) Berzukov

Author of Understanding Database Administration available at Amazon and other bookstores.

Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
Toby Harman
Toby Harman
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1209 Visits: 670
Collapse the structure to a single table and use a HIERARCHYID.

That way you can define a flexible heirarchy in this table and attach to specific points.
harinerella
harinerella
SSC Veteran
SSC Veteran (246 reputation)SSC Veteran (246 reputation)SSC Veteran (246 reputation)SSC Veteran (246 reputation)SSC Veteran (246 reputation)SSC Veteran (246 reputation)SSC Veteran (246 reputation)SSC Veteran (246 reputation)

Group: General Forum Members
Points: 246 Visits: 63
An ER diagram will help more to understand the relation ships
harinerella
harinerella
SSC Veteran
SSC Veteran (246 reputation)SSC Veteran (246 reputation)SSC Veteran (246 reputation)SSC Veteran (246 reputation)SSC Veteran (246 reputation)SSC Veteran (246 reputation)SSC Veteran (246 reputation)SSC Veteran (246 reputation)

Group: General Forum Members
Points: 246 Visits: 63
An ER diagram will help more to understand the relationships
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search