divadiva Posted December 8, 2008 Share Posted December 8, 2008 I am doing reverse engineering to create an Entity Relation Model(Database design) for existing database.I am not able to get the right solution. I have two tables: ******* create table school(id int( PRIMARY KEY, name varchar(20)) Name is an index BTREE in MYSQL table. ******** Then I have a name table: create table name(name varchar(20)); Name is an index BTREE here. It doesnt have any PRIMARY KEY. How should I link them together?I know name from name table passes its value to school table. Should I show foreign key relationshhip in ERdiagram?But in mysql datbase it is not defined.Code is defined in front end which is doing that.Can someone guide me on this ,I will appreciate that. Quote Link to comment https://forums.phpfreaks.com/topic/136107-foreign-key-issue/ Share on other sites More sharing options...
Mchl Posted December 8, 2008 Share Posted December 8, 2008 In my opinion, yes you should mark it as a foreign key. Even if it is not defined as such in database structure, there's a front-end code taking care of it. Of course there's always a risk, that data could be manipulated directly in back-end bypassing the front-end, and then the FK could be corrupted. But if all data manipulation goes through the front-end, then all should work just fine (or as fine, as fine the front-end code is ) Quote Link to comment https://forums.phpfreaks.com/topic/136107-foreign-key-issue/#findComment-709738 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.