Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Design Question - Company, Clients, Branches, Departments Expand / Collapse
Author
Message
Posted Wednesday, December 8, 2010 7:37 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Tuesday, June 5, 2012 4:05 PM
Points: 13, 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
Post #1032258
Posted Wednesday, December 8, 2010 7:59 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Thursday, September 18, 2014 7:50 PM
Points: 5,322, Visits: 25,235
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
Post #1032260
Posted Friday, December 10, 2010 8:43 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Tuesday, January 28, 2014 8:15 AM
Points: 3,065, Visits: 4,639
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.
Post #1033058
Posted Wednesday, December 29, 2010 5:01 PM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Thursday, September 18, 2014 9:56 PM
Points: 405, Visits: 557
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.
Post #1040641
Posted Thursday, December 30, 2010 12:16 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, January 20, 2011 2:18 PM
Points: 190, Visits: 63
An ER diagram will help more to understand the relation ships
Post #1040731
Posted Thursday, December 30, 2010 12:20 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, January 20, 2011 2:18 PM
Points: 190, Visits: 63
An ER diagram will help more to understand the relationships
Post #1040733
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse