I’m kinda new at SQL databases, so I wanna sumthing about primary keys.
Is it better to use PK that are integer. Or can you use a textfield as a PK.
For example i have a table ‘Groups’ with only Groupnames, they are unique. Groups has a 1->n relation with ‘Tables’. Tables has the following colums: Tablename, Create_priv, Retrieve_priv, Update_priv and Delete_priv. (actually it’s n->m relation but I don’t wanna complicate my question)
Can I use (in this case) the colums Group as a PK in Groups and Tablename as a PK in Tables? Or is it better to use an integer such as Group_ID and Table_ID??
In Filemaker I always used numbers as PK (example 2 in the attachement)…simply becoz I didn’t trust Filemaker enough
Are there any restrictions in using text as a PK. Filemaker had the restricition that it would only index the first 60 characters in portions of max 3x20 characters, so you could use max 3 words of max 20 characters as a PK.
See the attached file for more clarity.