Weak entity

Weak entity

In a relational database, a Weak Entity is an entity that cannot be uniquely identified by its attributes alone; therefore, it must use a foreign key in conjunction with its attributes to create a primary key. The foreign key is typically a primary key of an entity it is related to.

In entity relationship diagrams a weak entity set is indicated by a bold rectangle (the entity) connected by a bold type arrow to a bold diamond (the relationship). This type of relationship is called an identifying relationship and in IDEF1X notation it is represented by an oval entity rather than a square entity for base tables. An identifying relationship is one where the primary key is populated to the child weak entity as a primary key in that entity.

In general (though not necessarily) a weak entity does not have any items in its primary key other than its inherited primary key and a sequence number. There are two types of weak entities associative entities and subtype entities. The latter represents a crucial type of normalization, where the super-type entity inherits its attributes to subtype entities based on the value of the discriminator.

In IDEF1X a government standard for capturing requirements, possible sub-type relationships are:

-- Complete subtype relationship , when all categories are known.

-- Incomplete subtype relationship, when all categories may not be known.

A classic example of a weak entity without a sub-type relationship would be the "header/detail' records in many real world situations such as claims, orders and invoices, where the header captures information common across all forms and the detail captures information specific to individual items.

The standard example of a complete complete subtype relationship is the PARTY entity. Given the discriminator PARTY TYPE (which could be individual, partnership, C Corporation, Sub Chapter S Association, Association, Governmental Unit, Quasi-governmental agency) the two subtype entities are PERSON, which contains individual-specific information such as first and last name and date of birth, and ORGANIZATION, which would contain such attributes as the legal name, and organizational hierarchies such as cost centers.

When sub-type relationships are rendered in a database, the super-type becomes what is referred to as a base table. The sub-types are considered derived tables, which correspond to weak entities. Referential Integrity is enforced via cascading updates and deletes.

Example

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.

One of the tables could be called Order (except in an SQL database, where ORDER is a reserved word); 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 OrderItem; it would be identified by a compound key consisting of the order number (foreign key) and an item line number, plus 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 OrderItem entries corresponding to an Order entry, but no OrderItem entry can exist unless the corresponding Order entry exists. (The zero OrderItem case normally only applies transiently, when the order is first entered and before the first ordered item has been recorded.)

The OrderItem table stores "weak entities" precisely because an OrderItem has no meaning independent of the Order. Some might argue that an 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.

ee also

* Associative entity
* Sub-type entity
* Identifying Relationships"'


Wikimedia Foundation. 2010.

Игры ⚽ Нужно сделать НИР?

Look at other dictionaries:

  • Entity-relationship model — A sample Entity relationship diagram using Chen s notation In software engineering, an entity relationship model (ERM) is an abstract and conceptual representation of data. Entity relationship modeling is a database modeling method, used to… …   Wikipedia

  • Entity-Level Controls — Accountancy Key concepts Accountant · Accounting period · Bookkeeping · Cash and accrual basis · Cash flow management · Chart of accounts  …   Wikipedia

  • Weak agnosticism — Part of a series on Irreligion …   Wikipedia

  • IDEF1X — IDEFIX ( Integration Definition for Information Modeling ) is a data modeling language for the developing of semantic data models. IDEF1X is used to produce a graphical information model which represents the structure and semantics of information …   Wikipedia

  • CERIF — The Common European Research Information Format (CERIF) standard was developed in the late 1980 s by the European Union. It was intended for use by CRIS systems to allow them to store and transfer CRIS data among databases and information systems …   Wikipedia

  • слабое отношение сущностей — — [Л.Г.Суменко. Англо русский словарь по информационным технологиям. М.: ГП ЦНИИС, 2003.] Тематики информационные технологии в целом EN weak entity relation …   Справочник технического переводчика

  • слабый объект — — [Л.Г.Суменко. Англо русский словарь по информационным технологиям. М.: ГП ЦНИИС, 2003.] Тематики информационные технологии в целом EN weak entity …   Справочник технического переводчика

  • ECONOMIC AFFAIRS — THE PRE MANDATE (LATE OTTOMAN) PERIOD Geography and Borders In September 1923 a new political entity was formally recognized by the international community. Palestine, or Ereẓ Israel as Jews have continued to refer to it for 2,000 years,… …   Encyclopedia of Judaism

  • Business and Industry Review — ▪ 1999 Introduction Overview        Annual Average Rates of Growth of Manufacturing Output, 1980 97, Table Pattern of Output, 1994 97, Table Index Numbers of Production, Employment, and Productivity in Manufacturing Industries, Table (For Annual… …   Universalium

  • Economic Affairs — ▪ 2006 Introduction In 2005 rising U.S. deficits, tight monetary policies, and higher oil prices triggered by hurricane damage in the Gulf of Mexico were moderating influences on the world economy and on U.S. stock markets, but some other… …   Universalium

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”