473,786 Members | 2,608 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Question about DB normalisation

mikek12004
200 New Member
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
2 1839
daniel2335
49 New Member
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
Annalyzer
122 New Member
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

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

Similar topics

1
2296
by: Michael | last post by:
I have a question about the design of a database structure. I have a customer that has a pricegroup: Customer PriceGroup 1234 2 3245 3 I have a collegue who like to create a price table this way:
0
1431
by: Michael Lauzon | last post by:
Database Normalisation Advisor Designated Contact: thox, xpl2 Status: Open Open Date: 2004-10-26 11:53 For Project: Lands of Myths & Legends (http://sourceforge.net/projects/lamyle/) Long Description: Our project requires someone to advise us on the database structure for a game that we are planning to create. The key requirements are
1
1614
by: Michael Lauzon | last post by:
Database Normalisation Advisor Designated Contact: thox, xpl2 Status: Open Open Date: 2004-10-26 11:53 For Project: Lands of Myths & Legends (http://sourceforge.net/projects/lamyle/) Long Description: Our project requires someone to advise us on the database structure for a game that we are planning to create. The key requirements are
2
3826
by: James W. | last post by:
Hi everyone, I would like to ask you lot if you know of a great place on the internet for a fool proof idiots guide to Normalisation 1st, 2nd, 3rd. I looked at webopedia but that is just as confusing. I am looking for a complete idiots guide that really is so simple all it needs is pictures to turn it into a kiddies book
11
2475
by: Michael Thomas | last post by:
Hi everyone Not sure if this is the right newsgroup to be posting to for this question, but I am using Access 2002 to develop a database solution for the company that I work for. It's basically as stock control system where I need to keep track of the quantities of products. Our company is a retail chain, and we have eight shops or locations and a head office. The tables that I've set up are as follows
5
376
by: perspolis | last post by:
hi everyone In my accounting database ,there are several account like Persons,Banks,.... I design them in separated table. in your opinion ,it's better to have all in one table or separated table?? thx in advance
3
1472
by: Macbane | last post by:
Hello All, This has been bugging me for too long. I have a database that records medical interventions. I am familiar with the theory behind normalisation but am unsure what to do with the following data. Firstly, I have a main table which records the specifics of the intervention (date, reporter, details, location etc). It has links and the database is normalised ok as far as I can make out. However, I have 6 check box fields in...
1
2118
by: shauna | last post by:
hi, i am an As level student studying Applied ICT, im having problems with normalisation. our problem is to computerise a made up business.mine for example is a beauty salon. below are my attributes and they need to be normalised to 3rd normal form! i have also shown what i have come up with but i am unsure as to whether it is correct! please help as im finding this very difficult. Normalisation The goal of normalisation is to create a...
2
1711
by: hiyamwah | last post by:
Hi i am a little unsure of how you do this problem: A company wishes to allocate staff to a new project that as been proposed by the company. As a result, a new relation was created for this propose as follows: Staff_Project (Staff_No, Proj_Id, Proj_Name Proj_Location, Staff_Hours, Staff_Name, Staff_Address) Assuming that, Staff_No stands for staff number of the employee; Proj_Id is identifies of one of the projects that the...
0
9497
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10363
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10164
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10110
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6748
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5398
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5534
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4067
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.