I am not exactly clear what a Primary Key does, I mean, I know what it is, but I guess I don't grasp the importance of defining a Key all the time.
I am buidling my first access based database and so far have 5 tables. The first four tables have an obvious Key, the fifth does not.
The fifth table is the largest of the set - while the others are more-or-less static tables that will be between 10 - 500 rows, the fifth table grows by about 200 records per day.
Technically the key would be the combination of the first 5 columns in the table (user ID, Date, Activity, Sub Activity, Category) but there are only 8 columns total.
Should I go ahead and assign the key to those 5 fields? Would it be better to add an autonumber Key instead?
Appreciate the advice, thanks
Hi shadestreet,
Building a "compound" primary key as you suggest is quite possible, but you should acknowledge a limit in the number of components to that key (five is probably a bit much). You'll discover that an autonumber primary key for that table will pay off with convenience once you start writing queries to this table.
Cheers,
Docendo discimus.
Please consider:
- Thanking those who helped you. Click the reputation icon
in the contributor's post and add Reputation.
- Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.
Thank you for the feedback, if you or anyone doesn't mind, I would appreciate a bit of a lesson on why the autonumber will be helpful to me in the future?
I can't see every using it in a meaningful way when I query.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks