thebatfink
Registered User.
- Local time
- Today, 08:39
- Joined
- Oct 2, 2008
- Messages
- 33
Hi,
I have a database with no relationships and it serves its purpose, but it would probably give experienced database programmers a heart attack I'm looking for the first time personally at introducing relationships for referential integrity (which has to be all considered and performed manually right now) and I have a question.
I have a list of 'Interleaves', within this list I would like to classify each Interleave into one of a handleful of 'Interleave Types'. I want to distinguish between these Interleave Types because in some forms I want to use comboboxes where some will list only one Type of Interleave, whilst other comboboxes will list all Interleaves of all Types.
Having researched, I *think* I should be doing this with two tables and creating a relationship between them. The examples I have come across would have me create the following:
Table: Interleaves
InterleaveID (PK)
InterleaveName
InterleaveWidth
InterleaveTypeID
Table: InterleaveTypes
InterleaveTypeID (PK)
InterleaveTypeName
with the relationship being on the InterleaveTypeID (and I assume a Many to One relationship from Interleaves to InterleaveTypes?).
But I am thinking if Interleaves.InterleaveName and InterleaveTypes.InterleaveTypeName are always unique, can I drop the autonumbering column altogether and have say:
Table: Interleaves
InterleaveName(PK)
InterleaveWidth
InterleaveTypeName
Table: InterleaveTypes
InterleaveTypeName(PK)
Its just all the examples I see, there is ussually this autonumbering primary key field, and I very rarely see a single field table. That makes me think I am making poor design choices. But is what I propose acceptable?
Thanks for any advice
Batfink
I have a database with no relationships and it serves its purpose, but it would probably give experienced database programmers a heart attack I'm looking for the first time personally at introducing relationships for referential integrity (which has to be all considered and performed manually right now) and I have a question.
I have a list of 'Interleaves', within this list I would like to classify each Interleave into one of a handleful of 'Interleave Types'. I want to distinguish between these Interleave Types because in some forms I want to use comboboxes where some will list only one Type of Interleave, whilst other comboboxes will list all Interleaves of all Types.
Having researched, I *think* I should be doing this with two tables and creating a relationship between them. The examples I have come across would have me create the following:
Table: Interleaves
InterleaveID (PK)
InterleaveName
InterleaveWidth
InterleaveTypeID
Table: InterleaveTypes
InterleaveTypeID (PK)
InterleaveTypeName
with the relationship being on the InterleaveTypeID (and I assume a Many to One relationship from Interleaves to InterleaveTypes?).
But I am thinking if Interleaves.InterleaveName and InterleaveTypes.InterleaveTypeName are always unique, can I drop the autonumbering column altogether and have say:
Table: Interleaves
InterleaveName(PK)
InterleaveWidth
InterleaveTypeName
Table: InterleaveTypes
InterleaveTypeName(PK)
Its just all the examples I see, there is ussually this autonumbering primary key field, and I very rarely see a single field table. That makes me think I am making poor design choices. But is what I propose acceptable?
Thanks for any advice
Batfink