180 likes | 191 Views
Learn the fundamentals of designing a DBMS using Entity-Relationship (ER) model, understand entity and relationship sets, and establish functional associations among data entities. Practice database design for a video store project.
E N D
Chapter Two( Database Design) Objectives Learn how to design a DBMS Introduction to Data Models Entity-Relationship Data Models
Design a DBMS Entity Relationship (ER) Model
Entity-Relationship Model (ER-Model) Purpose of ER Model is to allow the description of an enterprise to be written without the attention to the efficiency or the physical design.
Entity-Relationship Model (ER-Model) • A set of basic objects called Entity, and a set of Relationships among objects (Entities)
Entity and Entity Set: Entity: • An object that exists and is distinguishable from other objects • Car ? • VW? • Entity Set: • A set of entities of the same type • Entity set needs not be disjoint (Faculty vs Student)
Entity and Entity Set: (Continued) • An entity is represented by a set of attributes Student(Name, Id, Gpa) • Each attribute has a set of permitted values called Domain (value set) Id: positive integer
Entity and Entity Set: (Continued) Examples: (Name, Mary), (ID,23), … Entity Set: Students Faculty Courses
Practice: • Identify entity sets in your video store.
Relationship and Relationship Sets: • Relationship is an association among two or more entities Faculty and Course • Relationship Set: is a set of similar relationships
Practice: • Identify the relationships among the entities in your video store project.
Functionality (Type of relationships) Association among several entities • One_To_One Relationship • Each entity in either set has at most one association with the member of the other set Example: Chair and Person Students and Address AB a1 b1 a2 b2 a3 b3 a4
Functionality(Continued) • One_To_Many Relationship One entity in set one is associated with zero or more entities in set two, but each entity in set two is associated with at most one entity in set one Example: StudentsAddress John 84 Main St. Frostburg 12 1st Street Washington Lori
Functionality(Continued) • Many_To_Many Relationship No restriction on the either sets of pair of entities Example: Mark 21 1st Washington 84 Main St. Frostburg Lori 62 3rd Ave Cumberland
Practice: • Identify the types of relationships in your video store project.
Entity Relationship Diagram • Rectangular: Entity sets • Circles: Attributes • Diamonds: Relationship sets • Lines: Attribute to entity set and Entity set to relationship
Title Course Number Cr Id Student Course GPA Name Entity Relationship Diagram Courses Student
Steps in designing a database using ER Model • Identify • Entity sets • Relationship sets • Identify semantic Info. In the relationship sets (functionality among entities) • Define the value sets of attributes (Domain) • Organize data into Entity/Relationships Diagram
Practice: • Design your Database for the video store using ER Model.