MySQL Forums
Forum List  »  Ruby

Re: foreign key
Posted by: david collins
Date: November 11, 2007 10:33AM

Hello, im a bit of a noob with mysql and databases all together.

Im trying to design/create a database to support a project that im doing at Uni.

The project is based around an employer employee job website.

Because i will have various users on the website (employers, employees and administrators) i thought id have some basic inheritance, all these sub tables below a super table (user) it seems the logical thing to do as they will all have a username, password and email. Anyhow, please see the basic model i knocked up to show what im trying to achieve:

Link to model: http://h1.ripway.com/davidcollinsmusic/db2.JPG

What i want to do is have a foreign key in administrator/employer and employee of the table userID, for example heres what i tried to create in mysql:

Link: http://h1.ripway.com/davidcollinsmusic/db.JPG

After attempting to execute this, it throws up the following error:

Link: http://h1.ripway.com/davidcollinsmusic/dberror.JPG

I know that its related to the foreign key issue, im not sure exactly what the problem could be?

Regards

David.

Options: ReplyQuote


Subject
Written By
Posted
October 31, 2006 04:01PM
October 31, 2006 04:23PM
May 03, 2007 01:22AM
July 18, 2007 07:58AM
July 18, 2007 07:54AM
Re: foreign key
November 11, 2007 10:33AM
February 21, 2008 05:30AM
July 14, 2008 05:11AM
October 20, 2008 06:22AM
October 23, 2008 12:57AM
October 23, 2008 12:58AM
October 23, 2008 12:59AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.