strhythm
Badges: 7
Rep:
?
#1
Report Thread starter 7 months ago
#1
I've been searching around for a definition but I'm getting mixed information
Is it like a composite key? or is it an index of all primary keys? or something different?
Some help would be appreciated : )
0
reply
nepotism
Badges: 9
Rep:
?
#2
Report 7 months ago
#2
Primary keys are the unique identifier of a record in a database, and when you want to get a record, most likely you will call it by referencing the primary key. However, in some databases, there will be more than one unique identifier. These other identifiers are called "candidates" (basically they haven't been selected as primary, but they could have been if it was another circumstance). The candidates that aren't selected are then called secondary keys.

For example, if you had the fields
Employee_ID
Employee_NI
Employee_Name
Employee_Phone

Employee_ID would likely be the primary key, but the NI number and phone number are highly likely to be unique as well, so you COULD technically set them to primary key. You probably don't want to though as you have the ID field, so that becomes the primary key and the other candidates become secondary keys.

Note that the name would not be considered a secondary key because there isn't really a guarantee that a name would be unique.
0
reply
X

Quick Reply

Attached files
Write a reply...
Reply
new posts
Back
to top
Latest
My Feed

See more of what you like on
The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

Personalise

Which of these would you use to help with making uni decisions?

Webinars (31)
13.84%
Virtual campus tours/open days (50)
22.32%
Live streaming events (21)
9.38%
Online AMAs/guest lectures (21)
9.38%
A uni comparison tool (51)
22.77%
An in-person event when available (50)
22.32%

Watched Threads

View All