Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
bernard2012
Starting Member
2 Posts |
Posted - 2012-06-16 : 16:01:29
|
Hi guyslets 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
15732 Posts |
Posted - 2012-06-16 : 17:24:26
|
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? |
|
|
xhostx
Constraint Violating Yak Guru
277 Posts |
Posted - 2012-06-26 : 09:34:39
|
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-------------------------- |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2012-06-26 : 10:29:03
|
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 |
|
|
|
|
|
|
|