Re: how to code an 'IS - A' relationship ?
Morten, I'd like to help you with actual code, but I can't, because the version of MySQL I use doesn't implement foreign key constraints. In my own code (written in the C API), I plan on checking these constraints myself. But I can't implement them in the tables themselves. Best, Steve Fromm -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: how to code an 'IS - A' relationship ?
> Hello MySQL programmers, > > suppose we have an Enhanced ER diagram, > with entities as classes/ subclasses connected through > some IS-A relationship. > > How can this be Coded in MySQL Please? > > My prerequisites are the basic database texts from > > http://www-db.stanford.edu/~ullman/dscb.html > > http://www.aw-bc.com/info/database/elmasri.html My copy of elmasri has a section "EER-to_Relational Mapping," which I followed when I wanted to do the same thing. It lists 4 methods for modelling EER class/subclass relationships in terms of the relational database model. For me, I did it as follows. Suppose A and B are subclasses of C. Then for C, I had an INT for primary key, plus an ENUM to describe whether the object was in A or B (here, the enum might have two values, 'a' and 'b'). The primary key of A was the same as that of C; similarly for B. The pk of A should satisfy a foreign key constraint with regard to C (similarly for B). If an object cannot belong to both A and B, one has to also check that no pk in C belongs to both A and B. That's not hard to do, but it's not clear to me that it falls under one of the standard integrity issues in the relational model. HTH, sjfromm -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
how to code an 'IS - A' relationship ?
Hello MySQL programmers, suppose we have an Enhanced ER diagram, with entities as classes/ subclasses connected through some IS-A relationship. How can this be Coded in MySQL Please? My prerequisites are the basic database texts from http://www-db.stanford.edu/~ullman/dscb.html http://www.aw-bc.com/info/database/elmasri.html Yours Sincerely Morten Gulbrandsen -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
how to code an IS - a relationship ?
Hello MySQL programmers, suppose we have an Enhanced ER diagram, with entities as classes/ subclasses connected through some IS-A relationship. How can this be Coded in MySQL Please? My prerequisites are the basic database texts from http://www-db.stanford.edu/~ullman/dscb.html http://www.aw-bc.com/info/database/elmasri.html Yours Sincerely Morten Gulbrandsen -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]