•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Database Design section within the Web Development category of DaniWeb, a massive community of 391,564 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,613 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Database Design advertiser:
Views: 387 | Replies: 0
![]() |
•
•
Join Date: Jun 2008
Posts: 8
Reputation:
Rep Power: 0
Solved Threads: 0
Hi
I have a problem with inheritance (Generalization / Specialization). As far as I understand, you can implement inheritance in Relational Data-Base by (zero or one) to one relation, so how to make sure that Lecturer and Student are not the same Person, giving that Lecturer and Student are generalized by Person.
Student
PersonID ..PK,FK
Grade
Lecturer
PersonID ..PK,FK
Salary
Now mistakenly you can give Lecturer and Student the same PersonID.
if this is a common case, and there is no (design way) to prevent this in RDB. How do I prevent this case by triggers, how to use triggers to avoid insertion in one table if it is exist in another, I think it will be efficient only if PersonID is indexed.
Thanks
I have a problem with inheritance (Generalization / Specialization). As far as I understand, you can implement inheritance in Relational Data-Base by (zero or one) to one relation, so how to make sure that Lecturer and Student are not the same Person, giving that Lecturer and Student are generalized by Person.
Student
PersonID ..PK,FK
Grade
Lecturer
PersonID ..PK,FK
Salary
Now mistakenly you can give Lecturer and Student the same PersonID.
if this is a common case, and there is no (design way) to prevent this in RDB. How do I prevent this case by triggers, how to use triggers to avoid insertion in one table if it is exist in another, I think it will be efficient only if PersonID is indexed.
Thanks
Last edited by motofoto : Jul 9th, 2008 at 3:54 am.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb Database Design Marketplace
Other Threads in the Database Design Forum
- Previous Thread: I can't stop thinking about inheritance!!
- Next Thread: Get first number from query into new form


Linear Mode