- 3
- 0
- 约8.89千字
- 约 53页
- 2018-06-30 发布于上海
- 举报
High-Level Database Models;In a design phase, we address and answer questions about what information will be stored, how information elements will be related to one another, what constraints such as keys or referential integrity may be assumed, and so on.
The notation in which the design is expressed: Entity-Relationship diagram(实体-联系图), UML(统一建模语言), ODL(对象描述语言).;The E/R model(实体/联系模型) allows us to sketch (作图) database designs.
Kinds of data and how they connect.
Not how data changes.
Designs are pictures called entity-relationship diagrams(实体/联系图).;Principal element types:
Entity(实体): “thing” or object.
Entity sets: a collection of similar entities. Similar to a class in object-oriented languages.
Attributes(属性): properties of the entities in an entity set. Attributes are simple values, e.g. integers or character strings.
Relationships(联系): connections among two or more entity sets.;In an entity-relationship diagram:
Entity set = rectangle.
Attribute = oval, with a line to the rectangle representing its entity set.;A relationship is represented by a diamond, with lines to each of the entity sets involved.;For the relationship stars-in, we might have a relationship set like:
;Multiplicity(多样性):
a kind of quantitative restriction of a relationship between entity sets.
Two essential multiplicities:
One: relating to zero or one entity, at most one.
Many: relating to zero or more entities.;Multiplicity of the relationship from entity set A to entity set B:
One-one: if each member of either entity set can be connected to at most one member of the other set.
Many-one (One-many): if each member of B can be connected to zero, one, or many members of A; and each member of A is connected to at most one member of B.
Many-many: if each member of either set can be connected to many members of the other set.;Representing “Multiplicity”:
Show a many-one relationship by an arrow entering the “one” side.
Show a one-one relationship by arrows entering both entity sets.;Example: R
原创力文档

文档评论(0)