Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Weak entity
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
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== {{original research|date=January 2024}} Consider a database that records customer orders, where an order is for one or more of the items that the enterprise sells. The database would contain a table identifying customers by a customer number ([[primary key]]); another identifying the products that can be sold by a product number ([[primary key]]); and it would contain a pair of tables describing orders. [[File:Weak_entity_ER-example.svg|center|frameless|852x852px]] One of the tables could be called Orders and it would have an order number ([[primary key]]) to identify this order uniquely, and would contain a customer number ([[foreign key]]) to identify who the products are being sold to, plus other information such as the date and time when the order was placed, how it will be paid for, where it is to be shipped to, and so on. The other table could be called {{Mono|OrderItem}}; it would be identified by a compound key consisting of both the order number ([[foreign key]]) and an item line number; with other non-primary key attributes such as the product number ([[foreign key]]) that was ordered, the quantity, the price, any discount, any special options, and so on. There may be zero, one or many {{Mono|OrderItem}} entries corresponding to an Order entry, but no {{Mono|OrderItem}} entry can exist unless the corresponding Order entry exists. (The zero {{Mono|OrderItem}} case normally only applies transiently, when the order is first entered and before the first ordered item has been recorded.) The {{Mono|OrderItem}} table stores ''weak entities'' precisely because an {{Mono|OrderItem}} has no meaning independent of the Order. Some might argue that an {{Mono|OrderItem}} does have some meaning on its own; it records that at some time not identified by the record, somebody not identified by the record ordered a certain quantity of a certain product. This information might be of some use on its own, but it is of limited use. For example, as soon as you want to find seasonal or geographical trends in the sales of the item, you need information from the related Order record. An order would not exist without a product and a person to create the order, so it could be argued that an order would be described as a weak entity and that products ordered would be a multivalue attribute of the order.
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Weak entity
(section)
Add topic