Hi Guys,
I'm trying to figure out whether I should have a primary key or not.
Here is my situation..
I have a primary table, say: ptable that stores id (autoincrement primary key),name (varchar)
Then I'll have lots of child tables that store various properties but those properties are linked directly (via foreign key) to the ptable.id. There will never be any duplicates in the child tables (no single table will ever have 2 entries for the same ptable.id).
So, is it necessary to have primary keys in the children
even though they will never actually be used for anything?
I know it's good practice to always have them, just not sure if there is an imortant thing i'm missing here.
Speed and size are important to me because there will be a lot of records.
Thanks!
I'm trying to figure out whether I should have a primary key or not.
Here is my situation..
I have a primary table, say: ptable that stores id (autoincrement primary key),name (varchar)
Then I'll have lots of child tables that store various properties but those properties are linked directly (via foreign key) to the ptable.id. There will never be any duplicates in the child tables (no single table will ever have 2 entries for the same ptable.id).
So, is it necessary to have primary keys in the children
even though they will never actually be used for anything?
I know it's good practice to always have them, just not sure if there is an imortant thing i'm missing here.
Speed and size are important to me because there will be a lot of records.
Thanks!