By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,996 Members | 1,193 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,996 IT Pros & Developers. It's quick & easy.

Question about DB normalisation

mikek12004
100+
P: 200
I have a table for categories (id->the primary key, and name) and I want to add another column parent (one category might be inside another) with the id's range of values so in fact parent will be a foreign key of the id right?Can I declare a foreign key of a primary key in the same table as that primary key or it is better make a seperate table for the relationships between categories? (lately been reading about db normalisation and wandering which the right thing to do)
PS any good tutorials on DB normalisation ?
Jun 18 '09 #1
Share this Question
Share on Google+
2 Replies


P: 49
I got the most from these tutorials.

http://www.keithjbrown.co.uk/vworks/mysql/mysql_p7.php

But normalisation has to be one of the hardest things involved in designing a website. Especially with around 10-20 tables and hundreds of columns. I just dont seem to be able to learn it. ;p just read it over and over and it sort of gets a little clearer but never clear. Good luck.
Jun 30 '09 #2

100+
P: 122
No, you can't create a foreign key in its own table. To be foreign, it must be the primary key in another table. This is why you call it foreign. Otherwise I think you would have to call it a "native" key. ;-)
Jul 4 '09 #3

Post your reply

Sign in to post your reply or Sign up for a free account.