SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 Database Design and Application Architecture
 question about weak or strong entities
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

bernard2012
Starting Member

2 Posts

Posted - 06/16/2012 :  16:01:29  Show Profile  Reply with Quote
Hi guys

lets say you are designing a database for a university.

The university is made up of colleges, which in turn is made up of departments (maths, science, english etc...)

I am pretty certain that college should be considered a strong entity. However would you consider departments to be a weak entity?

my guess is yes it is, as the department is logically dependent on the college. ie the departments cannot exist unless the college exists.

Would you agree? Or is my logic off?

robvolk
Most Valuable Yak

USA
15559 Posts

Posted - 06/16/2012 :  17:24:26  Show Profile  Visit robvolk's Homepage  Reply with Quote
I haven't heard the term "strong" or "weak" applied to entities. It sounds like you intend the university to be a top-level entity in a hierarchy, and the colleges, departments and classes to be secondary level entities in that hierarchy.

You can certainly model your tables as Universities, Colleges, Departments, and so on, with declared relationships (foreign keys) between them. For this limited application there's no problem with it, but one question to consider: what happens if two universities merge? Do they become a new entity? Is there a higher-level entity that encompasses the two existing universities? How would you model that?

And what happens if a college decides to branch off and no longer be part of a university?
Go to Top of Page

xhostx
Constraint Violating Yak Guru

USA
261 Posts

Posted - 06/26/2012 :  09:34:39  Show Profile  Reply with Quote
I think what you mean here is that Dependancies, which mean, the existance of a department will never be possible unless the college existed. However, you developping a model that will at least involve one college in the minimum. you have to consider a relationship between College/dept using foreign keys. As well, you can use Super/Sub types relation to inheret the properties when needed.

Please consult some Data Modeling tutorials, and Consider robvolk cases too.

good luck,

--------------------------
Get rich or die trying
--------------------------
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

USA
6997 Posts

Posted - 06/26/2012 :  10:29:03  Show Profile  Reply with Quote
One of the most import things in data modeling is to create a model that covers all cases, not just the usual ones.

It really depends on how the entities are related in the real world. Could a college exist without being related to a university?Could a department exist that is related to the university but not a college? Could a department exist without being related to a college or university?

http://en.wikipedia.org/wiki/Weak_entity
"In a relational database, a weak entity is an entity that cannot be uniquely identified by its attributes alone; therefore, it must use a foreign key in conjunction with its attributes to create a primary key. The foreign key is typically a primary key of an entity it is related to."



CODO ERGO SUM
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000