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
Relational model
(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!
=== Database === An idealized, very simple example of a description of some [[relvar]]s ([[relation (database)|relation]] variables) and their attributes: * Customer ('''<u>Customer ID</u>''', Name) * Order ('''<u>Order ID</u>''', <u>Customer ID</u>, <u>Invoice ID</u>, Date) * Invoice ('''<u>Invoice ID</u>''', <u>Customer ID</u>, <u>Order ID</u>, Status) In this [[design]] we have three relvars: Customer, Order, and Invoice. The bold, underlined attributes are ''[[candidate key]]s''. The non-bold, underlined attributes are ''[[foreign key]]s''. Usually one [[candidate key]] is chosen to be called the [[primary key]] and used in [[preference]] over the other candidate keys, which are then called [[alternate key]]s. A ''candidate key'' is a unique [[identifier]] enforcing that no [[tuple]] will be duplicated; this would make the [[Relation (database)|relation]] into something else, namely a [[bag (mathematics)|bag]], by violating the basic definition of a [[set (mathematics)|set]]. Both foreign keys and superkeys (that includes candidate keys) can be composite, that is, can be composed of several attributes. Below is a tabular depiction of a relation of our example Customer relvar; a relation can be thought of as a value that can be attributed to a relvar.
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)