Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Composite key
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Example == An example is an entity that represents the modules each student is attending at University. The entity has a {{lang|mis|studentID}} and a {{lang|mis|moduleCode}} as its [[primary key]]. Each of the attributes that makes up the primary key is a simple key because each represents a unique reference when identifying a student in one instance and a module in the other, so this key is a compound key. In contrast, using the same example, imagine we identified a student by their {{lang|mis|firstName}} + {{lang|mis|lastName}} (assuming that people must have different names). In a table representing students our primary key would now be {{lang|mis|firstName}} + {{lang|mis|lastName}}. Because students can have the same {{lang|mis|firstName}} or the same {{lang|mis|lastName}} these attributes are not simple keys. The primary key {{lang|mis|firstName}} + {{lang|mis|lastName}} for students is a composite key.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)