Presentation is loading. Please wait.

Presentation is loading. Please wait.

COP Introduction to Database Structures

Similar presentations


Presentation on theme: "COP Introduction to Database Structures"— Presentation transcript:

1 COP 3540 - Introduction to Database Structures
DBMS Design, ER Model

2 ER Model ER model is a top-down approach to database design that begins by identifying important data called entities and relationship between the data that must be represented in the model. We then add more details, such as attributes and any constraints on the entities, relationships, and attributes.

3 ER Model Entity type represents a group of objects in the real world with the same properties. Relationship type is a set of associations between one or more participating entity types. Normally, a relationship is named using a verb (e.g., supervises or managers) Attributes is a property of an entity or a relationship type. Domain is a set of allowable values for one or more attributes.

4 ER Model Attribute can be classified as being: simple or composite, single-valued or multi-valued, or derived. Single attribute is composed of a single component with an independent existence. Composite attribute is composed of multiple components, each with an independent existence. Single-valued attribute holds a single value for each occurrence of an entity type. Multi-valued attribute holds multiple values for each occurrence of an entity type. Derived attribute represents a value that is derivable from the value of a related attribute or set of attributes, not necessarily in the same entity type.

5 ER Model Example of Derived attribute
The value of the duration attribute of the Lease entity is calculated from rentStart and rentFinish attributes of the Lease entity type. The total number of staff (totalStaff) attribute of the Staff entity type can be calculated by counting the total number of Staff entity occurrences. The value of the deposit attribute of the Lease entity type is derived from the rent attribute of the PropertyForRent entity type.

6 ER Model Candidate key is the minimal set of attributes that uniquely identifies each occurrence of an entity type. Composite key is a candidate key that consists of two or more attributes. Primary key is the candidate key that is selected to uniquely identify each occurrence of an entity type. The choice of primary key for an entity is based on considerations of attribute length, the minimal number of attributes required, and the future certainty of uniqueness.

7 ER Model Weak entity type is an entity type that is existence-dependent on some other entity type. A characteristic of a weak entity is that each entity occurrence cannot be uniquely identified using only the attributes associated with that entity type. Weak entity types are sometimes referred to as child, dependent, or subordinates entities and strong entity types as parent, owner, or dominant entities.

8 ER Model The degree of a relationship is the number of entity types that participate in that relationship (e.g., binary unary, and ternary). Cardinality describes the maximum number of possible relationship occurrence for an entity participating in a given relation types. Binary relationships are generally referred to as being one-to-one (1:1), one-to-many (1:*), or many-to-many (*:*). Example) A member of staff manages a branch. A member of staff oversees properties for rent. Newspapers advertise for rent.

9 ER Model Participation determines whether all or only some entity occurrences participate in a relationship.

10 Example Which one is better? Branch Division Staff Staff Has Division
Operators Branch Division Operators Branch Has Staff

11 Example Which one is better? Branch Has Staff Oversees
Property For Rent Branch Has Staff Oversees Property For Rent Offers

12 Example The entity sets are Movies, Stars, and Studios. name address
Stars-in title year Movies name address length genre Studios Owns


Download ppt "COP Introduction to Database Structures"

Similar presentations


Ads by Google