Chapter 2 ENTITY RELATIONSHIP MODEL

Size: px
Start display at page:

Download "Chapter 2 ENTITY RELATIONSHIP MODEL"

Transcription

1 INTRODUCTION Chapter 2 ENTITY RELATIONSHIP MODEL Data model is used to describe data, data relationship and constraints on data. A number of different data models have proposed. They can broadly be classified into two categories: Object-based logical models. Record-based logical models. The object-based model can be defined as a collection of conceptual tools for describing data, data relationships, and data constraints. The record-based model describes the data structures and access techniques of a DBMS. There are various different object-based models. Some of the more popular ones are: The entity-relationship model The binary model The infological model The semantic model Of these, the most widely used one is the Entity-Relationship Model. It has gained acceptance as the ideal data model for database design. This model was introduced by Peter Chen in 1976, and since then it has been reformed by several persons. The entity relationship model (E R Model) is based on a perception of real world that is made up of a collection objects or entities and the relationship among these. Conceptual Model Before going to explaining the entity-relationship model, we will briefly discuss database design. Database design involves designing the conceptual design model of the database. The conceptual model reflects the entities and their relationships, based on the data processing needs of the organization. This can be considered equivalent to the conceptual level. The conceptual model is a communication tool between the various users of the data. It is developed without any concern for physical representation. The conceptual model is used to organize, visualize, plan and communicate ideas. It is independent of the database management system. Before actually implementing the database, the conceptual model is designed. At this stage, requirements of all the users are considered to decide upon the actual data to be stored in the system. This conceptual model is then mapped to the DBMS that is actually to be used. Data analysis is the first step in designing a conceptual model. Data analysis begins with collecting information about the data. This usually involves using a questionnaire or a similar method to obtain a list of data that the organization needs. Existing forms, bills, reports are starting points for data collection. The data analysis involves identifying entities, their attributes, and the relationships between attributes. The E-R Model is a way to form and represent the conceptual model of database design

2 Basic concepts of E-R Model: An entity relationship diagram is a graphical representation of an organisation's data storage requirements. Entity relationship diagrams are abstractions of the real world which simplify the problem to be solved while retaining its essential features. Entity relationship diagrams are used to: identify the data that must be captured, stored and retrieved in order to support the business activities performed by an organisation identify the data required to derive and report on the performance measures, that an organisation should be monitoring. Entity relationship diagrams have three different components: 1) ENTITIES 2) ATTRIBUTES 3) RELATIONSHIPS Entity : Entities are the people, places, things, events and concepts of interest to an organisation. In short, anything which an organisation needs to store data about. Entity can be concrete like employee, book, project, publisher etc. and can be abstract or a concept for example title, job, company etc. which have no physical existence. Entity set represents collection of things. For example, an EMPLOYEE entity set might represent a collection of all the employees that work for an organisation. Individual members (employees) of the collection are called instance of the EMPLOYEE entity set. Attribute: Properties or characteristics possessed by an entity are called as attributes. Attributes are same for each entity set but their values may differ from each other. For example, EMPLOYEE entity set has attributes name, age, empid and salary but the values of these attributes may be different for each employee in the entity set. Domain :The set of possible values for an attribute is called the domain of the attribute. Some of the examples are: The domain of attribute marital status is just the four values: single, married, divorced, widowed. The domain of the attribute month is the twelve values ranging from January to December. The domain of attribute empid of EMPLOYEE entity set consist of only positive integers. Key attribute :The attribute (or combination of attributes) that is unique for every entity instance e.g the account number of an account, the employee id of an employee etc. Simple Vs composite attribute Simple attribute: An attribute that cannot be divided into simpler components is called simple attribute. E.g age of an employee, pub-id of a book title of a book entity. Composite attribute: An attribute that can be split into components is called composite attrbute. E.g Date of joining of the employee can be split into day, month and year

3 Single Vs Multi-valued Attribute Single valued : Attributes that can take on only a single value for each entity instance are called single valued attribute. E.g. age of employee, pubid of a publisher Multi-valued: Attributes that can take many values for each entity instance are called multi-valued attributes. E.g. skill set of employee Stored Vs Derived attribute Stored Attribute: Attribute that need to be stored permanently. E.g. name of an employee Derived Attribute: Attribute that can be calculated based on other attributes. E.g. : years of service of employee can be calculated from date of joining and current date Figure 1: Type of attributes Regular Vs. Weak entity type Regular Entity: Entity that has its own key attribute. It is also called independent entity because it does not dependent on any other entity for existence. E.g.: Employee, student, customer, policy holder etc. Weak entity: Entity that depends on other entity for its existence and doesn t have key attribute of its own. It is also called dependent entity because its existence depends on the existence of another entity. E.g. : spouse of employee, the spouse data is identified with the help of the employee id to which it is related. The dependent entity is represented by a double lined rectangle and the identifying relationship by a double lined diamond. the identifying relationship is the one which relates the weak entity with the strong entity on which it depends

4 Employee Has Dependents Figure 2: Weak Entity Null Values :Null value of an attribute is considered if that attribute does not have a value for a particular entity. A null value is a value that is unavailable, unassigned, unknown, or inapplicable. A null value is not the same as zero or a space, because zero is a number, and a space is a character. For example, in phone_no attribute is having Null value then it means the value may not be applicable. Keys :A key is a single attributer or a combination of attributes whose values uniquely identify each tuple in that relation. In other words, no tow entities in an entity set are allowed to have exactly the same value for all attributes. A key allows us to identify a set of attributes that are suffice to distinguish relationships from each others. Superkey :An attribute, or group of attributes, that is sufficient to distinguish every tuple in the relation from every other one. Each super key is called a candidate key Candidate key :A candidate key is any set of one or more columns whose combined value is unique through out that table. Since a null value is not guaranteed to be unique, no component of a candidate key is allowed to be null. There can be number of candidate keys in a table. Primary key :The primary key of any table is any candidate key of that table which the database designer arbitrarily designates as primary. The primary key may be selected for convenience, comprehension, performance or any other reasons. Every entity must have a primary key. The primary key is an attribute or combination of attributes that uniquely identifies an instance of the entity. In other words, no two instances of an entity may have the same value for the primary key. Sometimes it is useful to use more than one attribute to form a primary key. When a primary key for an entity is made up of more than one attribute the key is called a composite key. The terms composite key is also used to describe primary keys that contain multiple attributes. When dealing with a composite primary key it is important to understand that it is the combination of values for all attributes that must be unique. It is not necessary for each attribute in the key to be unique. For example, the entity ENROLLMENT has a composite primary key comprised of the attributes STUDENT_ID and COURSE_ID. Each instance of ENROLLMENT must contain a unique combination of values for StudentID and CourseID. However, there can be duplications of StudentID or CourseID. So, it is possible for many instances of ENROLLMENT to have the value MIS100 for CourseID, but each of those instances must contain different values for StudentID.

5 Figure 3: Primary key Alternate key :The alternate keys of any table are simply those candidate keys which are not currently selected as the primary key. Foreign key: A foreign key is a set of attribute(s) whose values are required to match values of a candidate key in the same or another table. A foreign key is a copy of the whole of its parent candidate key i.e if the candidate key is composite, then so is the foreign key Foreign key values do not (usually) have to be unique Foreign keys can also be null A composite foreign key cannot have some attribute(s) null and others non-null Figure 4 : Foreign key Relationship : A relationship type between two entity types defines the set of all associations between these entity types. Each instance of the relationship between members of these entity types is called a relationship instance. For example: EMPLOYEEs work in a DEPARTMENT LAWYERs advise CLIENTs

6 EQUIPMENT is allocated to PROJECTs TRUCK is a type of VEHICLE Degree of a Relationship : The degree of a relationship is the number of entities associated with the relationship. One - Unary Two - Binary Three Ternary Unary Relationship: A unary or recursive binary relationship occurs when an entity is related to itself. An example might be "some employees are married to other employees". A unary relationship is represented as a diamond which connects one entity to itself as a loop. The relationship below means, some instances of employee manage other instances of Employee. Employee Manages Figure 5: Unary Relationship Binary Relationship: Binary relationship association between two entities is the most common type in the real world. Employee Works for Department Figure 6: Binary Relationship Ternary Relationship: A ternary relationship involves three entities and is used when a binary relationship is inadequate. Many modeling approaches recognize only binary relationships. Ternary or n-ary relationships are decomposed into two or more binary relationships.

7 Cardinality and Connectivity Figure 7: Ternary Relationship The connectivity of a relationship describes the mapping of associated entity instances in the relationship. The values of connectivity are "one" or "many". The cardinality of a relationship is the actual number of related occurences for each of the two entities. The basic types of connectivity for relations are: one-to-one, one-to-many, and many-tomany. Relationships can have different connectivity one-to-one (1:1) one-to-many (1:N) many-to- One (M:1) many-to-many (M:N) One-toOone (1:1) relationship: A one-to-one (1:1) relationship is when at most one instance of a entity A is associated with one instance of entity B. For example, "each employee in the company has been assigned his own office. For each employee there exists a unique office and for each office there exists a unique employee. P1 P2 P3 P4 C1 C2 C3 C4 PERSON CHAIR Figure 8 : One to One One-to-Many (1:N) relationships A one-to-many (1:N) relationships is when for one instance of entity A, there are zero, one, or many instances of entity B, but for one

8 instance of entity B, there is only one instance of entity A. For example a department has many employees or each employee is assigned to one department. O1 O2 O3 E1 E2 E3 E4 E5 ORGANIZATION Figure 9 : One to Many EMPLOYEE E1 E2 E3 E4 E5 D1 D2 D3 EMPLOYEE DEPARTMENT Figure 10 : Many to one Many-to-Many (M:N) relationship A many-to-many (M:N) relationship, sometimes called non-specific, is when for one instance of entity A, there are zero, one, or many instances of entity B and for one instance of entity B there are zero, one, or many instances of entity A. For example employees can be assigned to no more than two projects at the same time and projects must have assigned at least three employees. Therefore a single employee can be assigned to many projects; conversely, a single project can have assigned to it many employee. Here the cardinality for the relationship between employees and projects is two and the cardinality between project and employee is three.

9 S1 S2 S3 S4 C1 C2 C3 C4 STUDENT COURSE Figure 11: Many to many ER Notations for Cardinality: An entity may be associated with one, none, or many occurrences of another entity. In ER diagrams, the types of relationships are represented as follows: Figure 12: Cardinality Represents zero and represents one. Dashed line between entity box and relationship box represents optional existence A crow foot represents many type of relationship Represents minimum of one and maximum of one existence of entity instances in a relationship A is associated with a minimum of zero Bs and a maximum of 1 B. A R B Figure 13: Minimum of 0 and maximum of 1 relationship

10 A is associated with a minimum of 1B and a maximum of 1 B A R B Figure 14: Minimum of 1 and maximum of 1 relationship A is associated with a minimum of 0 B and maximum of that is any number greater than 1. A R B Figure 15 :Minimum of 0 and maximum of >1 relationship A is associated with a minimum of 1 B and maximum of that is any number greater than 1. A R B Figure 16 : Minimum of 1 and maximum of >1 relationship Relationships can also differ in terms of their cardinality. Maximum cardinality refers to the maximum number of instances of one entity that can be associated with a single instance of a related entity. Minimum cardinality refers to the minimum number of instances of one entity that must be associated with a single instance of a related entity. The following examples of binary relationships illustrate the concept of maximum cardinality. If one CUSTOMER can be related to only one ACCOUNT and one ACCOUNT can be related to only a single CUSTOMER, the cardinality of the CUSTOMER-ACCOUNT relationship is one-to-one (1:1). Customer Have Account Figure 17 : one-to-one (1:1) relationship If an ADVISOR can be related to one or more STUDENTS, but a STUDENT can be related to only a single ADVISOR, the cardinality is one-to-many (1:N).

11 Advisor Advise Student Figure 18: one-to-many (1:N) relationship Finally, the cardinality of the relationship is many-to-many (M:N) if a single STUDENT can be related to zero or more COURSES and a single COURSE can be related to zero or more STUDENTS. Student Take Course Figure 19: many -to-many (M:N) relationship Relationship Participation Total : Every entity instance must be connected through the relationship to another instance of the other participating entity types Partial: All instances need not participate E.g.: Employee and Head-of Department Employee: partial Department: total All employees will not be head-of some department. So only few instances of employee entity participate in the above relationship. But each department will be headed by some employee. So department entity s participation is total and employee entity s participation is partial in the above relationship Employee Head of Department Partial participation Total participation Figure 20 : Relationship participation Partial :All instances of the entity type Employee don t participate in the relationship, Head-of. Every employee doesn t head a department. So, employee entity type is said to partially participate in the relationship. Total : But, every department would be headed by some employee. So, all instances of the entity type Department participate in this relationship. So, we say that it is total participation from the department side.

12 Attribute of a relationship: These attributes best describe the relationship rather than any individual entity Medicine Dosage No. of Days Doctor Prescription Patient Figure 21: Relationship attributes Extended E-R Features Superclass and Subclass: Certain instances of an entity class can include attributes that are not needed in other instances of the same entity class. In these cases, it is useful to use a superclass/subclass structure. This structure is also called a generalization/ specialization hierarchy. i. Subclass: A subgroup an entity type which has attributes that are distinct from those in other subgroups ii. Superclass: An generic entity type that has a relationship with one or more subclasses iii. Inheritance a. Subclass entities inherit values of all attributes of the superclass b. An instance of a subclass is also an instance of the superclass Specialization : Specialization is the process of defining a set of subclasses of an entity type; this entity type is called the superclass of the specialization. The set of subclasses that form a specialization is defined on the basis of some distinguishing characteristics of the entities in the superclass. Consider an entity set EMPLOYEE with attributes Name, Employeeid, Address, Birthdate, Jobtype. An Employee may be further classified as one of the following SECERATRY ENGINEER TEHCNICIAN Each of these employee types is described by a set of attributes that includes all the attributes of entity set employee plus possibly additional attributes. For example, SECERATRY entities my be described further by the attribute TypingSpeed, whereas TECHNICIAN entities may be described further by the attribute Tgrade and ENGINEER entities may be described by EngType. The processof designating subgroupings within an entity set is called specialization. The specialization of EMPLOYEE allow us to distinguish among EMPLOYEES according to whether they are SECERATRY, TECHNICIAN or ENGINEER.

13 We call each of these subgrouping a subclass of the EMPLOYEE entity type, and the EMPLOYEE entity type is called the superclass for each of these subclasses. In terms of E-R diagram, specialization is depicted by a triangle component labeled ISA. The label ISA stands for is a and represents, for example, that a customer is a person. The ISA relationship can also be referred as superclass-subclass relationship. NoOfAxles NoOfPassengers Price Price Tonnage MaxSpeed CAR TRUCK VehicleId VehicleId LicencePlacte No. LicencePlacte No. Figure 22(a) Price VehicleId LicencePlacteNo VEHICLE ISA MaxSpeed Tonnage NoOfPasseng ers NoOfAxle s CAR TRUCK Figure 22 : Specialization

14 Generalization: Generalization is a reverse process of abstraction which suppress the differences among several entity types. It is a form of abstraction that specifies that two or more entities that share common attributes can be generalized into a higher level entity type called a supertype or generic entity. The lower-level of entities become the subtype, or categories, to the supertype. Subtypes are dependent entities. For example, consider the entity types CAR and TRUCK shown in Figure 22(a). Because they have several common attributes, they can be generalized into the entity type VEHICLE, as shown in Figure 22 (b) Generalization process can be viewed as inverse of specialization process. Therefore in figure 1(b) we can view {CAR,TRUCK} as a specialization of VEHICLE, rather than viewing VEHICLE as a generalization of CAR and TRUCK. Constraints and characteristics of Specialization : To model an enterprise more accurately, the database designer may choose to place certain constraints on a particular specialization. These constraints could be of various types. Birthdate Employeei Address Name EMPLOYEE JobType ISA TypingSpeed TGrade EngType SECRETARY TECHNICIAN ENGINEER Figure 23: Condition defined constraint Condition-defined Vs User-defined constraint : In some specialization we can determine exactly the entities that will members of each subclass by placing a condition on the value of some attribute of the superclass. Such subclasses are called conditiondefined. When we don t have a condition for determining membership in a subclass, the subclass is called user-defined

15 a) Condition-defined: In condition defined lower-level entity sets, membership is evaluated on the basis of whether or not an entity satisfies an explicit condition or predicate. For example, if the EMPLOYEE entity type has an attribute JobType, as shown in Figure 23 we can specify the condition of membership in the SECRETARY subclass by the condition (JobType= Secretary ), which we call the defining predicate of the subclass. The condition is a constraint specifying that exactly those entities of the EMPLOYEE entity type whose attribute value for JobType is Secretary belong to the subclass. This type of specialization is also called attribute-defined. b) User-defined:. Membership in such a subclass is determined by the database users when they apply the operation to add an entity to the subclass therefore the membership is specified individually for each entity by the user, not by any condition that may be evaluated automatically. For instance, let us assume that, after 3 months of employment, the employees of a software company are assigned to one of four work team. We therefore represent the teams as four lower-level entity sets of the higher-level employee entity set. A given employee is not assigned to a specific team entity automatically on the basis of an explicit defining condition. Instead, the user in charge of this decision makes the team assignment on an individual basis. This assignment is implemented by an operation that adds an entity to an entity set. Disjoint V/S Overlapping constraint : A second type of constraint relates to whether or not entities may belong to more than one lower-level entity set within a single generalization. The lower-level entity sets may be one of the following: a) Disjoint: In a disjoint hierarchy, an entity instance can be in only one subtype. For example, the entity EMPLOYEE, may have two subtypes, CLASSIFIED and WAGES. An employee may be one type or the other but not both. Figure 23 shows disjoint and Figure (b) overlapping generalization hierarchy EMPLOYEE ISA CLASSIFIED WAGES. Figure 23 Disjoint generalization b) Overlapping: An overlapping category is when an entity instance may be in two or more subtypes. An example would be a person who works for a university could also be a student at that same university. Overlapping in lower-level entity set is the default case. We can denote disjointedness constraint in an E-R diagram by adding the word disjoint next to the triangle symbol.

16 Completeness constraint The third constraint on specialization is called the completeness constraint, which may be total or partial. PERSON ISA FACULTY STAFF STUDENT Total v/s Partial Spcialization Figure 24 : Overlapping generalization a) Total Specialization: A total specialization constraint specifies that every entity in the superclass must be a member of least one subclass in the specialization. For example, if every employee must be either an HOURLY_EMPLOYEE or a SALARIED_EMPLOYEE, then the spcialization{hourly_employee, SALARIED_EMPLOYEE} is a total specialization. (figure 2.23) b) Partial specialization: In partial specialization some of higher-level entities may not belong to any lower-level entity set. For example, if some EMPLOYEE entities do not belong to any of the subclass {SECRETARY, ENGINEER, TECHNICIAN}, then that specialization is partial.( Figure 2. 21) Partial generalization is the default. We can specify total generalization in an E-R diagram by using a double line to connect the box representing the higher-level entity set to the triangle symbol. The disjointedness and completeness constraints are independent. Therefore, we have the following four possible constraints on specialization: 1) Disjoint, total 2) Disjoint, partial 3) Overlapping, total 4) Overlapping, partial EMPLOYEE ISA HOURLY_EMPLOYEE SALARIED_EMPLOYEE Figure 24: Total Specialization

17 AGGREGATION The E-R model has one limitation that it is not possible to express relationships among relationships. In such situations we use aggregation. Aggregation, is an approach of modeling a relationship set as a higher level entity set or, in other words, aggregation helps to model the participation of one relationship set into other relationship set. For example, consider publisher database in which an author writes a particular book and a publisher publishes the book on a specific date written by a particular author. To model the situation, an E-R diagram is shown in fig. 25. Author Write Book Works_For Publish Publisher Figure 25 E-R Diagram with Redundant Relationship The situation is modelled by associating publisher with entity set author and book through a relationship publish as shown in fig. 25. But this model produces redundant information since every author-book pair in publish is also in writes so better method to model the situation is aggregation. Aggregation is an abstraction through which relationships are treated as higher level entities. We can treat the relationships set writes along with the entity sets author and Book as a higher level entity set called author-book as shown in fig. 26.

18 Author Write Book Publish Publisher Figure 26 E-R Diagram with Aggregation So, Aggregation allow us to indicate that a relationship set participates in another relationship set. Aggregation is depicted by a rectangle as shown in fig. 26. Writes relationship can be represented as a ternary relationship involving publisher, author and Book. But it is not correct as publish and writes are two different relationships having different attributes, as publish has the attribute pub_date which specifies the date of publication and writes has the attribute from which specifies the time since the author is writing a particular book. Steps in ER Modeling Step 1: Identify the Entities Step 2: Find the relationships Step 3: Identify the key attributes Step 4: Identify other relevant attributes Step 5: Draw complete E-R diagram with all attributes including Primary Key Case Study 1 : ER Model For a college Database Assumptions : A college contains many departments Each department can offer any number of courses Many instructors can work in a department An instructor can work only in one department For each department there is a Head An instructor can be head of only one department Each instructor can take any number of courses A course can be taken by only one instructor A student can enroll for any number of courses Each course can have any number of students

19 Step 1: Identify the Entities DEPARTMENT STUDENT COURSE INSTRUCTOR Step 2: Find the relationships One course is enrolled by multiple students and one student enrolls for multiple courses, hence the cardinality between course and student is Many to Many. The department offers many courses and each course belongs to only one department, hence the cardinality between department and course is One to Many. One department has multiple instructors and one instructor belongs to one and only one department, hence the cardinality between department and instructor is one to Many. Each department there is a Head of department and one instructor is Head of department, hence the cardinality is one to one. One course is taught by only one instructor, but the instructor teaches many courses, hence the cardinality between course and instructor is many to one. Step 3: Identify the key attributes Deptname is the key attribute for the Entity Department, as it identifies the Department uniquely. Course# (CourseId) is the key attribute for Course Entity. Student# (Student Number) is the key attribute for Student Entity. Instructor Name is the key attribute for Instructor Entity. Step 4: Identify other relevant attributes For the department entity, the relevant attribute is location For course entity, course name, duration, prerequisite For instructor entity, room#, telephone For student entity, student name, date of birth Step 5: Draw complete E-R diagram with all attributes including Primary Key

20 Figure 27 Case Study2 Banking Business Scenario Assumptions : There are multiple banks and each bank has many branches. Each branch has multiple customers Customers have various types of accounts Some Customers also had taken different types of loans from these bank branches One customer can have multiple accounts and Loans

21 Step 1: Identify the Entities BANK BRANCH LOAN ACCOUNT CUSTOMER Step 2: Find the relationships One Bank has many branches and each branch belongs to only one bank, hence the cardinality between Bank and Branch is One to Many. One Branch offers many loans and each loan is associated with one branch, hence the cardinality between Branch and Loan is One to Many. One Branch maintains multiple accounts and each account is associated to one and only one Branch, hence the cardinality between Branch and Account is One to Many One Loan can be availed by multiple customers, and each Customer can avail multiple loans, hence the cardinality between Loan and Customer is Many to Many. One Customer can hold multiple accounts, and each Account can be held by multiple Customers, hence the cardinality between Customer and Account is Many to Many Step 3: Identify the key attributes BankCode (Bank Code) is the key attribute for the Entity Bank, as it identifies the bank uniquely. Branch# (Branch Number) is the key attribute for Branch Entity. Customer# (Customer Number) is the key attribute for Customer Entity. Loan# (Loan Number) is the key attribute for Loan Entity. Account No (Account Number) is the key attribute for Account Entity. Step 4: Identify other relevant attributes For the Bank Entity, the relevant attributes other than BankCode would be Name and Address. For the Branch Entity, the relevant attributes other than Branch# would be Name and Address. For the Loan Entity, the relevant attribute other than Loan# would be Loan Type. For the Account Entity, the relevant attribute other than Account No would be Account Type. For the Customer Entity, the relevant attributes other than Customer# would be Name, Telephone# and Address.

22 Step 5: Draw complete E-R diagram with all attributes including Figure 28 Reduction of an E-R Schema to Tables Convert ER model into relational schema (a specification of the table definitions and their foreign key links) There are well defined rules for this conversion Converting Strong entity types: i) Each entity type becomes a table ii) Each single-valued attribute becomes a column iii) Derived attributes are ignored iv) Composite attributes are represented by components v) Multi-valued attributes are represented by a separate table vi) The key attribute of the entity type becomes the primary key of the table

23 Street Floor Building Date of Joining Address Name Years of Service E# Employee Skillset Figure 29 Strong Entity example Here address is a composite attribute Years of service is a derived attribute (can be calculated from date of joining and current date) Skill set is a multi-valued attribute The final Relational Schema: Employee (E#, Name, Street, Floor, Building, Date_Of_Joining) Emp_Skillset( E#, Skillset) Figure 30 Conversion of strong entity to tables As per the rules: Derived attributes are ignored Composite attributes are represented by components Multi-valued attributes are represented by a separate table

24 Converting weak entity types Weak entity types are converted into a table of their own, with the primary key of the strong entity acting as a foreign key in the table. This foreign key along with the key of the weak entity form the composite primary key of this table Figure 31 Weak Entity example The Relational Schema: Employee (E#,Name,.) Dependent (Employee, Dependent_ID, Name, Address) Here dependent is a weak entity. Dependent doesn t mean anything to the problem without the information on for which employee the person is a dependent. Figure 32 Conversion of weak entity to tables Converting relationships The way relationships are represented depends on the cardinality and the degree of the relationship. The possible cardinalities are: 1:1 1:M M:N The degrees are: Unary Binary Ternar Binary (1:1) Case 1: Combination of participation types: In binary (1:1) relationship if combination of participation exists, the primary key of the partial participation will become the

25 foreign key of the total participation. In figure 33 there is a partial participation of Employee entity in the relationship HeadOf, because only one Employee can become head of the department. But there is a total participation of Department entity because every Department must have a head of department. Therefore the relational schema would be Employee(E#, Name.) Department (Dept#, Name,., Head) Figure 33 Binary (1:1) Combination of Participation type Figure 34 Conversion of total and partial participation to tables Case 2: Uniform participation type: If both the entities take uniform participation in the Binary (1:1) relationship the primary key of either of the participants can become a foreign key in the other.

26 Figrure 35 Binary (1:1) Uniform participation Figure 36 Conversion of Uniform participation to tables Binary (1:N) : The primary key of the 1 side of the relationship becomes a foreign key in the relation on the N side. Figure 37 Binary (1:N) relationship

27 Figure 38: Conversion of Binary (1:N) relationship to tables Binary (M:N) : A new table is created to represent the relationship. The new table contains two foreign keys- one from each of the participating entities. The primary key of the new table is the combination of the two foreign keys. Figure 39 : Binary (M:N) relationship Figure 40 : Conversion of Binary (M:N) relationship to tables

28 Unary (1:1) : In unary 1:1 relationship the primary key field itself will become foreign key in the same table. Figure 41 Unary (1:1) Relationship Figure 42 Conversion of Unary (1:1) Relationship to table Unary (1:N): In unary 1:N relationship the primary key field itself will become foreign key in the same table. Figure 2.42 Unary (1:N) Relationship

29 Figure 44 Conversion of Unary (1:N) Relationship to table Unary (M:N): In unary M:N relationship, there would be two resulting table, one to represent the entity and another to represent many to many relationship. The primary key of the entity will be copied two times in the new table, and will become a composite primary key. Figure 45 Unary (M:N) Relationship Figure 46: Conversion of Unary (M:N) Relationship to tables Ternary Relationship : Ternary relationship will be represented by a new table. This table will contain three foreign keys- one from each of the participating entities. The primary key of the new table is the combination of all three foreign keys. If relationship has any attributes it will become the attributes of the new table.

30 Medicine Dosage No. of Days Doctor Prescription Patient Figure 47: Ternary Relationship Figure 48 Conversion of Ternary Relationship to table Converting specialization Generalization is concept of representing entity sets in the form of hierarchy. Higher level entity set is represented by table containing attribute common to lower level entity set. Lower level entity set is represented by table containing column as primary key of higher level entity set and a specialized attribute corresponding to that lower level entity set.

31 E# Ename DOB EMPLOYEE Address ISA NoOfHrs BasicSal HOURLY_EMPLOYEE SALARIED_EMPLOYEE Figure 2.48 Specialization EMPLOYEE HOURL_EMPLOYEE E# PK E# PK Ename NoOfHrs DOB Address SALARAIED_EMPLOYEE E# PK BasicSal Figure 50 Conversion of specialization to table Converting Aggregation If an aggregated entity set combines two entity sets with one relationship and this aggregated entity set is related with one more entity than Each entity set is represented by one table The relationship between aggregated entity set is represented by one table, and the final table structure depends upon the relationship between the tables. The relationship between aggregated entity set and related entity is represented by one table, containing primary key from each table. Deriving Logical Schema for Banking Application (Figure 26) 1) Each Entity represented in the E-R model can be defined as a table in the relational scheme. All the attributes of the Entity will become columns of the table. 1. We can translate this Entity to a CUSTOMER table with the following columns. CUSTOMER Customer#,Name,Telephone#,Address)

32 2. Similarly a Bank table can be created with Bank Bankcode, Name and Address columns BANK (BankCode, Name, Address) 3. Weak Entity types are converted into a table of their own, with the primary key of the strong Entity acting as a foreign key in the table. This Foreign key along with the key of the Weak Entity form the composite primary key of this table.as per this guideline, a Branch table can be created with the following structure. BRANCH (BankCode, Branch#, Name, Address) 4. Each relationship can be defined as separate table in relational schema. Key attributes of participating entities will become key attribute of the Relationship. We can define Loan_Detail table with Loan# and Customer# together as primary key with other relevant attributes like DateOfSanction, InterestRate, LoanAmount, Duration etc. LOAN_DETAILS (Loan#, Customer#, DateofSanction, InterestRate, LoanAmount, Duration) 5. In a Many to Many relationship, it is necessary to create separate tables for participating entities and relationships. In the banking application we have Customer and Loan Entities have a Many to Many relationship. Hence one should create separate tables for CUSTOMER LOANS LOAN_DETAILS.

Entity-Relationship Model

Entity-Relationship Model Entity-Relationship Model Data Models High-level or conceptual data models provide concepts that are close to the way many users perceive data, whereas low-level or physical data models provide concepts

More information

Conceptual Data Models for Database Design

Conceptual Data Models for Database Design Conceptual Data Models for Database Design Entity Relationship (ER) Model The most popular high-level conceptual data model is the ER model. It is frequently used for the conceptual design of database

More information

Chapter 2: Entity-Relationship Model

Chapter 2: Entity-Relationship Model Chapter 2: Entity-Relationship Model! Entity Sets! Relationship Sets! Design Issues! Mapping Constraints! Keys! E-R Diagram! Extended E-R Features! Design of an E-R Database Schema! Reduction of an E-R

More information

Chapter (4) Enhanced Entity-Relationship and Object Modeling

Chapter (4) Enhanced Entity-Relationship and Object Modeling Chapter (4) Enhanced Entity-Relationship and Object Modeling Objectives Concepts of subclass and superclass and the related concepts of specialization and generalization. Concept of category, which is

More information

Chapter 7: Entity-Relationship Model

Chapter 7: Entity-Relationship Model Chapter 7: Entity-Relationship Model Database System Concepts, 6 th Ed. See www.db-book.com for conditions on re-use Chapter 7: Entity-Relationship Model Design Process Modeling Constraints E-R Diagram

More information

Chapter 7: Entity-Relationship Model

Chapter 7: Entity-Relationship Model Chapter 7: Entity-Relationship Model Database System Concepts, 6 th Ed. See www.db-book.com for conditions on re-use Chapter 7: Entity-Relationship Model Design Process Modeling Constraints E-R Diagram

More information

Chapter 4. Enhanced Entity- Relationship Modeling. Enhanced-ER (EER) Model Concepts. Subclasses and Superclasses (1)

Chapter 4. Enhanced Entity- Relationship Modeling. Enhanced-ER (EER) Model Concepts. Subclasses and Superclasses (1) Chapter 4 Enhanced Entity- Relationship Modeling Enhanced-ER (EER) Model Concepts Includes all modeling concepts of basic ER Additional concepts: subclasses/superclasses, specialization/generalization,

More information

Entity-Relationship Modelling. Entities Attributes Relationships Mapping Cardinality Keys Reduction of an E-R Diagram to Tables

Entity-Relationship Modelling. Entities Attributes Relationships Mapping Cardinality Keys Reduction of an E-R Diagram to Tables Entity-Relationship Modelling Entities Attributes Relationships Mapping Cardinality Keys Reduction of an E-R Diagram to Tables 1 Entity Sets A enterprise can be modeled as a collection of: entities, and

More information

Chapter 7: Entity-Relationship Model

Chapter 7: Entity-Relationship Model Chapter 7: Entity-Relationship Model Database System Concepts, 6 th Ed. See www.db-book.com for conditions on re-use Chapter 7: Entity-Relationship Model Design Process Modeling Constraints E-R Diagram

More information

0. Database Systems 1.1 Introduction to DBMS Information is one of the most valuable resources in this information age! How do we effectively and efficiently manage this information? - How does Wal-Mart

More information

Chapter 6: Entity-Relationship Model

Chapter 6: Entity-Relationship Model Chapter 6: Entity-Relationship Model Database System Concepts, 5th Ed. See www.db-book.com for conditions on re-use Chapter 6: Entity-Relationship Model Design Process Modeling Constraints E-R Diagram

More information

Enhanced Entity- Relationship Models (EER)

Enhanced Entity- Relationship Models (EER) Enhanced Entity- Relationship Models (EER) LECTURE 3 Dr. Philipp Leitner philipp.leitner@chalmers.se @xleitix LECTURE 3 Covers Small part of Chapter 3 Chapter 4 Please read this up until next lecture!

More information

Chapter 6: Entity-Relationship Model

Chapter 6: Entity-Relationship Model Chapter 6: Entity-Relationship Model Database System Concepts, 5th Ed. See www.db-book.com for conditions on re-use Chapter 6: Entity-Relationship Model Design Process Modeling Constraints E-R Diagram

More information

MIS Database Systems Entity-Relationship Model.

MIS Database Systems Entity-Relationship Model. MIS 335 - Database Systems Entity-Relationship Model http://www.mis.boun.edu.tr/durahim/ Ahmet Onur Durahim Learning Objectives Database Design Main concepts in the ER model? ER Diagrams Database Design

More information

COIS Databases

COIS Databases Faculty of Computing and Information Technology in Rabigh COIS 342 - Databases Chapter 4 Enhanced Entity-Relationship and UML Modeling Adapted from Elmasri & Navathe by Dr Samir BOUCETTA First Semester

More information

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe CHAPTER 4 Enhanced Entity-Relationship (EER) Modeling Slide 1-2 Chapter Outline EER stands for Enhanced ER or Extended ER EER Model Concepts Includes all modeling concepts of basic ER Additional concepts:

More information

1. Considering functional dependency, one in which removal from some attributes must affect dependency is called

1. Considering functional dependency, one in which removal from some attributes must affect dependency is called Q.1 Short Questions Marks 1. Considering functional dependency, one in which removal from some attributes must affect dependency is called 01 A. full functional dependency B. partial dependency C. prime

More information

Roadmap of This Lecture. Weak Entity Sets Extended E-R Features Reduction to Relation Schemas Database Design UML*

Roadmap of This Lecture. Weak Entity Sets Extended E-R Features Reduction to Relation Schemas Database Design UML* E-R Model (II) 1 Roadmap of This Lecture Weak Entity Sets Extended E-R Features Reduction to Relation Schemas Database Design UML* 2 Weak Entity Sets An entity set that does not have a primary key is referred

More information

Intro to DB CHAPTER 6

Intro to DB CHAPTER 6 Intro to DB CHAPTER 6 DATABASE DESIGN &THEER E-R MODEL Chapter 6. Entity Relationship Model Design Process Modeling Constraints E-R Diagram Design Issues Weak Entity Sets Extended E-R Features Design of

More information

Module 2 : Entity-Relationship Model 15

Module 2 : Entity-Relationship Model 15 Module 2 : Entity-Relationship Model 15 Module-02 Entity Relationship Data Model 2.1 Motivation Data modeling is an essential step in the process of creating any Database Application. It helps Database

More information

Copyright 2007 Ramez Elmasri and Shamkant B. Navathe Slide 4-1

Copyright 2007 Ramez Elmasri and Shamkant B. Navathe Slide 4-1 Copyright 2007 Ramez Elmasri and Shamkant B. Navathe Slide 4-1 Chapter 4 Enhanced Entity-Relationship (EER) Modeling Copyright 2007 Ramez Elmasri and Shamkant B. Navathe Chapter Outline EER stands for

More information

Chapter 2: Entity-Relationship Model. Entity Sets. Entity Sets customer and loan. Attributes. Relationship Sets. A database can be modeled as:

Chapter 2: Entity-Relationship Model. Entity Sets. Entity Sets customer and loan. Attributes. Relationship Sets. A database can be modeled as: Chapter 2: Entity-Relationship Model Entity Sets Entity Sets Relationship Sets Design Issues Mapping Constraints Keys E-R Diagram Extended E-R Features Design of an E-R Database Schema Reduction of an

More information

Enhanced Entity-Relationship (EER) Modeling

Enhanced Entity-Relationship (EER) Modeling CHAPTER 4 Enhanced Entity-Relationship (EER) Modeling Copyright 2017 Ramez Elmasri and Shamkant B. Navathe Slide 1-2 Chapter Outline EER stands for Enhanced ER or Extended ER EER Model Concepts Includes

More information

Chapter 7: Entity-Relationship Model

Chapter 7: Entity-Relationship Model Chapter 7: Entity-Relationship Model, 7th Ed. See www.db-book.com for conditions on re-use Chapter 7: Entity-Relationship Model Design Process Modeling Constraints E-R Diagram Design Issues Weak Entity

More information

E-R Model. Hi! Here in this lecture we are going to discuss about the E-R Model.

E-R Model. Hi! Here in this lecture we are going to discuss about the E-R Model. E-R Model Hi! Here in this lecture we are going to discuss about the E-R Model. What is Entity-Relationship Model? The entity-relationship model is useful because, as we will soon see, it facilitates communication

More information

Entity Relationship Data Model. Slides by: Shree Jaswal

Entity Relationship Data Model. Slides by: Shree Jaswal Entity Relationship Data Model Slides by: Shree Jaswal Topics: Conceptual Modeling of a database, The Entity-Relationship (ER) Model, Entity Types, Entity Sets, Attributes, and Keys, Relationship Types,

More information

LECTURE 3: ENTITY-RELATIONSHIP MODELING

LECTURE 3: ENTITY-RELATIONSHIP MODELING LECTURE 3: ENTITY-RELATIONSHIP MODELING Ref. Chapter11 + Appendix F from Database Systems: A Practical Approach to Design, Implementation and Management. Thomas Connolly, Carolyn Begg. 1 IS220 : D a t

More information

Lecture3: Data Modeling Using the Entity-Relationship Model.

Lecture3: Data Modeling Using the Entity-Relationship Model. College of Computer and Information Sciences - Information Systems Dept. Lecture3: Data Modeling Using the Entity-Relationship Model. Ref. Chapter12 Prepared by L. Nouf Almujally & Aisha AlArfaj Rev. by

More information

Advance Database Management System

Advance Database Management System Advance Database Management System Conceptual Design Lecture- A simplified database design process Database Requirements UoD Requirements Collection and Analysis Functional Requirements A simplified database

More information

Represent entities and relations with diagrams

Represent entities and relations with diagrams LEARNING OBJECTIVES Define data modeling terms Describe E-R Model Identify entities and relations Represent entities and relations with diagrams WHAT IS DATA MODELING? A data model is a collection of concepts

More information

CSIT5300: Advanced Database Systems

CSIT5300: Advanced Database Systems CSIT5300: Advanced Database Systems L01: Entity Relationship (ER) Model Dr. Kenneth LEUNG Department of Computer Science and Engineering The Hong Kong University of Science and Technology Hong Kong SAR,

More information

COMP Instructor: Dimitris Papadias WWW page:

COMP Instructor: Dimitris Papadias WWW page: COMP 5311 Instructor: Dimitris Papadias WWW page: http://www.cse.ust.hk/~dimitris/5311/5311.html Textbook Database System Concepts, A. Silberschatz, H. Korth, and S. Sudarshan. Reference Database Management

More information

Chapter 6: Entity-Relationship Model. The Next Step: Designing DB Schema. Identifying Entities and their Attributes. The E-R Model.

Chapter 6: Entity-Relationship Model. The Next Step: Designing DB Schema. Identifying Entities and their Attributes. The E-R Model. Chapter 6: Entity-Relationship Model The Next Step: Designing DB Schema Our Story So Far: Relational Tables Databases are structured collections of organized data The Relational model is the most common

More information

System Analysis And Design Methods ENTITY RELATIONSHIP DIAGRAM (ERD) Prof. Ali Khaleghi Eng. Hadi Haedar

System Analysis And Design Methods ENTITY RELATIONSHIP DIAGRAM (ERD) Prof. Ali Khaleghi Eng. Hadi Haedar 1 System Analysis And Design Methods ENTITY RELATIONSHIP DIAGRAM (ERD) Prof. Ali Khaleghi Eng. Hadi Haedar Overview DATABASE ARCHITECTURE 2 External level concerned with the way individual users see the

More information

IS 263 Database Concepts

IS 263 Database Concepts IS 263 Database Concepts Lecture 1: Database Design Instructor: Henry Kalisti 1 Department of Computer Science and Engineering The Entity-Relationship Model? 2 Introduction to Data Modeling Semantic data

More information

Chapter 6: Entity-Relationship Model. E-R Diagrams

Chapter 6: Entity-Relationship Model. E-R Diagrams Chapter 6: Entity-Relationship Model A database can be modeled as: a collection of entities, relationship among entities. An entity is an object that exists and is distinguishable from other objects. Example:

More information

The En'ty Rela'onship Model

The En'ty Rela'onship Model The En'ty Rela'onship Model Debapriyo Majumdar DBMS Fall 2016 Indian Statistical Institute Kolkata Slides re-used, with minor modification, from Silberschatz, Korth and Sudarshan www.db-book.com Outline

More information

The Next Step: Designing DB Schema. Chapter 6: Entity-Relationship Model. The E-R Model. Identifying Entities and their Attributes.

The Next Step: Designing DB Schema. Chapter 6: Entity-Relationship Model. The E-R Model. Identifying Entities and their Attributes. Chapter 6: Entity-Relationship Model Our Story So Far: Relational Tables Databases are structured collections of organized data The Relational model is the most common data organization model The Relational

More information

CS403- Database Management Systems Solved Objective Midterm Papers For Preparation of Midterm Exam

CS403- Database Management Systems Solved Objective Midterm Papers For Preparation of Midterm Exam CS403- Database Management Systems Solved Objective Midterm Papers For Preparation of Midterm Exam Question No: 1 ( Marks: 1 ) - Please choose one Which of the following is NOT a feature of Context DFD?

More information

Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition. Chapter 7 Data Modeling with Entity Relationship Diagrams

Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition. Chapter 7 Data Modeling with Entity Relationship Diagrams Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition Chapter 7 Data Modeling with Entity Relationship Diagrams Objectives In this chapter, students will learn: The

More information

Chapter 7: Entity-Relationship Model. Chapter 7: Entity-Relationship Model

Chapter 7: Entity-Relationship Model. Chapter 7: Entity-Relationship Model Chapter 7: Entity-Relationship Model Database System Concepts, 6 th Ed. See www.db-book.com for conditions on re-use Chapter 7: Entity-Relationship Model Design Process Modeling Constraints E-R Diagram

More information

6.1 RELATIONSHIP CONCEPTS

6.1 RELATIONSHIP CONCEPTS 1 SYLLABUS 6.1 Basic Entity Relationship Concepts: Entities, Relationship, Attributes 6.2 E R Diagram symbols 6.3 Conversion of Entity Relationship Model into Relations 6.4 Problems with Enitty Relationship

More information

CS403- Database Management Systems Solved MCQS From Midterm Papers. CS403- Database Management Systems MIDTERM EXAMINATION - Spring 2010

CS403- Database Management Systems Solved MCQS From Midterm Papers. CS403- Database Management Systems MIDTERM EXAMINATION - Spring 2010 CS403- Database Management Systems Solved MCQS From Midterm Papers April 29,2012 MC100401285 Moaaz.pk@gmail.com Mc100401285@gmail.com PSMD01 CS403- Database Management Systems MIDTERM EXAMINATION - Spring

More information

Chapter 4. In this chapter, you will learn:

Chapter 4. In this chapter, you will learn: Chapter Entity Relationship (ER) Modeling Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel 1 In this chapter, you will learn: The main characteristics of entity

More information

A database can be modeled as: + a collection of entities, + a set of relationships among entities.

A database can be modeled as: + a collection of entities, + a set of relationships among entities. The Relational Model Lecture 2 The Entity-Relationship Model and its Translation to the Relational Model Entity-Relationship (ER) Model + Entity Sets + Relationship Sets + Database Design Issues + Mapping

More information

ER to Relational Mapping

ER to Relational Mapping ER to Relational Mapping 1 / 19 ER to Relational Mapping Step 1: Strong Entities Step 2: Weak Entities Step 3: Binary 1:1 Relationships Step 4: Binary 1:N Relationships Step 5: Binary M:N Relationships

More information

Database Systems. A Practical Approach to Design, Implementation, and Management. Database Systems. Thomas Connolly Carolyn Begg

Database Systems. A Practical Approach to Design, Implementation, and Management. Database Systems. Thomas Connolly Carolyn Begg Database Systems A Practical Approach to Design, Implementation, and Management For these Global Editions, the editorial team at Pearson has collaborated with educators across the world to address a wide

More information

Conceptual Database Design (ER modeling) Chapter Three

Conceptual Database Design (ER modeling) Chapter Three Conceptual Database Design (ER modeling) Chapter Three 1 Agenda (Chapter Three) Overview-database design Conceptual Design (E-R Modeling) Structural Constraints EER- Generalization and Specialization Reducing

More information

CMPT 354 Database Systems I

CMPT 354 Database Systems I CMPT 354 Database Systems I Chapter 2 Entity Relationship Data Modeling Data models A data model is the specifications for designing data organization in a system. Specify database schema using a data

More information

4. Entity Relationship Model

4. Entity Relationship Model 4. Entity Relationship Model a) ER-Model: Used to construct conceptual data model, representing the structure and constraints of a database, which is not dependent on a software (like DBMS) or any data

More information

CSE 530A. ER Model. Washington University Fall 2013

CSE 530A. ER Model. Washington University Fall 2013 CSE 530A ER Model Washington University Fall 2013 Database Design Requirements Analysis Conceptual Database Design Creates an abstract model Logical Database Design Converts abstract model to concrete

More information

Conceptual Data Modeling

Conceptual Data Modeling Conceptual Data odeling A data model is a way to describe the structure of the data. In models that are implemented it includes a set of operations that manipulate the data. A Data odel is a combination

More information

Relational Model (cont d) & Entity Relational Model. Lecture 2

Relational Model (cont d) & Entity Relational Model. Lecture 2 Relational Model (cont d) & Entity Relational Model Lecture 2 Relational Database Operators Relational algebra Defines theoretical way of manipulating table contents using relational operators: SELECT

More information

Database Management Systems. Chapter 2 Part 2

Database Management Systems. Chapter 2 Part 2 Database Management Systems Chapter 2 Part 2 Introduction to Database Design Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 1 Class Hierarchies Classify entities sets into Super-class and

More information

Non-overlappingoverlapping. Final outcome of the worked example On pages R&C pages R&C page 157 Fig 3.52

Non-overlappingoverlapping. Final outcome of the worked example On pages R&C pages R&C page 157 Fig 3.52 Objectives Computer Science 202 Database Systems: Entity Relation Modelling To learn what a conceptual model is and what its purpose is. To learn the difference between internal models and external models.

More information

2. E-R Model. Entity Sets Relationship Sets Attributes

2. E-R Model. Entity Sets Relationship Sets Attributes 3. E R Model 2. E-R Model Entity-Relationship Model Graphical Representation of Database Equivalent to Flow-Chart in Programming It makes easy to understand Database Prior Step to implement Actual Database

More information

LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP MODELING (EER)

LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP MODELING (EER) LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP MODELING (EER) Ref. Chapter12 from Database Systems: A Practical Approach to Design, Implementation and Management. Thomas Connolly, Carolyn Begg. IS220 : D at

More information

Chapter 6: Entity-Relationship Model

Chapter 6: Entity-Relationship Model Chapter 6: Entity-Relationship Model Database System Concepts, 5th Ed. See www.db-book.com for conditions on re-use Chapter 6: Entity-Relationship Model Design Process Modeling Constraints E-R Diagram

More information

The DBMS accepts requests for data from the application program and instructs the operating system to transfer the appropriate data.

The DBMS accepts requests for data from the application program and instructs the operating system to transfer the appropriate data. Managing Data Data storage tool must provide the following features: Data definition (data structuring) Data entry (to add new data) Data editing (to change existing data) Querying (a means of extracting

More information

Data Analysis 1. Chapter 2.1 V3.1. Napier University Dr Gordon Russell

Data Analysis 1. Chapter 2.1 V3.1. Napier University Dr Gordon Russell Data Analysis 1 Chapter 2.1 V3.1 Copyright @ Napier University Dr Gordon Russell Entity Relationship Modelling Overview Database Analysis Life Cycle Components of an Entity Relationship Diagram What is

More information

Database Systems: Design, Implementation, and Management Tenth Edition. Chapter 4 Entity Relationship (ER) Modeling

Database Systems: Design, Implementation, and Management Tenth Edition. Chapter 4 Entity Relationship (ER) Modeling Database Systems: Design, Implementation, and Management Tenth Edition Chapter 4 Entity Relationship (ER) Modeling 4.1 The Entity Relationship Model (ERM) ER model forms the basis of an ER diagram ERD

More information

Entity Relationship Modelling

Entity Relationship Modelling Entity Relationship Modelling Overview Database Analysis Life Cycle Components of an Entity Relationship Diagram What is a relationship? Entities, attributes, and relationships in a system The degree of

More information

Database Applications (15-415)

Database Applications (15-415) Database Applications (15-415) The Entity Relationship Model Lecture 2, January 15, 2014 Mohammad Hammoud Today Last Session: Course overview and a brief introduction on databases and database systems

More information

Chapter 4 Entity Relationship Modeling In this chapter, you will learn:

Chapter 4 Entity Relationship Modeling In this chapter, you will learn: Chapter Entity Relationship Modeling In this chapter, you will learn: What a conceptual model is and what its purpose is The difference between internal and external models How internal and external models

More information

Database Design with Entity Relationship Model

Database Design with Entity Relationship Model Database Design with Entity Relationship Model Vijay Kumar SICE, Computer Networking University of Missouri-Kansas City Kansas City, MO kumarv@umkc.edu Database Design Process Database design process integrates

More information

Lecture 10 - Chapter 7 Entity Relationship Model

Lecture 10 - Chapter 7 Entity Relationship Model CMSC 461, Database Management Systems Spring 2018 Lecture 10 - Chapter 7 Entity Relationship Model These slides are based on Database System Concepts 6th edition book and are a modified version of the

More information

CMP-3440 Database Systems

CMP-3440 Database Systems CMP-3440 Database Systems Database Architecture Lecture 02 zain 1 Database Design Process Application 1 Conceptual requirements Application 1 External Model Application 2 Application 3 Application 4 External

More information

ER modeling. Lecture 4

ER modeling. Lecture 4 ER modeling Lecture 4 1 Copyright 2007 STI - INNSBRUCK Today s lecture ER modeling Slides based on Introduction to Entity-relationship modeling at http://www.inf.unibz.it/~franconi/teaching/2000/ct481/er-modelling/

More information

Overview of db design Requirement analysis Data to be stored Applications to be built Operations (most frequent) subject to performance requirement

Overview of db design Requirement analysis Data to be stored Applications to be built Operations (most frequent) subject to performance requirement ITCS 3160 Data Base Design and Implementation Jing Yang 2010 Fall Class 12: Data Modeling Using the Entity-Relationship (ER) Model Overview of db design Requirement analysis Data to be stored Applications

More information

CS 338 The Enhanced Entity-Relationship (EER) Model

CS 338 The Enhanced Entity-Relationship (EER) Model CS 338 The Enhanced Entity-Relationship (EER) Model Bojana Bislimovska Spring 2017 Major research Outline EER model overview Subclasses, superclasses and inheritance Specialization and generalization Modeling

More information

SOFTWARE ENGINEERING Prof.N.L.Sarda Computer Science & Engineering IIT Bombay. Lecture #10 Process Modelling DFD, Function Decomp (Part 2)

SOFTWARE ENGINEERING Prof.N.L.Sarda Computer Science & Engineering IIT Bombay. Lecture #10 Process Modelling DFD, Function Decomp (Part 2) SOFTWARE ENGINEERING Prof.N.L.Sarda Computer Science & Engineering IIT Bombay Lecture #10 Process Modelling DFD, Function Decomp (Part 2) Let us continue with the data modeling topic. So far we have seen

More information

Design Process Modeling Constraints E-R Diagram Design Issues Weak Entity Sets Extended E-R Features Design of the Bank Database Reduction to

Design Process Modeling Constraints E-R Diagram Design Issues Weak Entity Sets Extended E-R Features Design of the Bank Database Reduction to Design Process Modeling Constraints E-R Diagram Design Issues Weak Entity Sets Extended E-R Features Design of the Bank Database Reduction to Relation Schemas Database Design UML A database can be modeled

More information

Database Systems. Overview - important points. Lecture 5. Some introductory information ERD diagrams Normalization Other stuff 08/03/2015

Database Systems. Overview - important points. Lecture 5. Some introductory information ERD diagrams Normalization Other stuff 08/03/2015 Lecture 5 Database Systems Instructor: M.Imran Khalil Imrankhalil3@gmail.com Resource:Imrankhalil3.wordpress.com University of Sargodha Canal Campus Lahore Overview - important points Some introductory

More information

Overview of Database Design Process Example Database Application (COMPANY) ER Model Concepts

Overview of Database Design Process Example Database Application (COMPANY) ER Model Concepts Chapter Outline Overview of Database Design Process Example Database Application (COMPANY) ER Model Concepts Entities and Attributes Entity Types, Value Sets, and Key Attributes Relationships and Relationship

More information

MTAT Introduction to Databases

MTAT Introduction to Databases MTAT.03.105 Introduction to Databases Lecture #4 Entity-Relationship Modelling Ljubov Jaanuska (ljubov.jaanuska@ut.ee) Lecture 3. Summary So far we have been dealing with a relational database (PCA.db)

More information

Database Management Systems LECTURE NOTES 2

Database Management Systems LECTURE NOTES 2 Database Management Systems LECTURE NOTES 2 Relation: A table; Tuple: A row in a table; Attribute: A column in a table Degree: number of attributes; Cardinality: number of tuples Entity and Entity Sets:

More information

Chapter 17. Methodology Logical Database Design for the Relational Model

Chapter 17. Methodology Logical Database Design for the Relational Model Chapter 17 Methodology Logical Database Design for the Relational Model Chapter 17 - Objectives How to derive a set of relations from a conceptual data model. How to validate these relations using the

More information

Mapping ER Diagrams to. Relations (Cont d) Mapping ER Diagrams to. Exercise. Relations. Mapping ER Diagrams to Relations (Cont d) Exercise

Mapping ER Diagrams to. Relations (Cont d) Mapping ER Diagrams to. Exercise. Relations. Mapping ER Diagrams to Relations (Cont d) Exercise CSC 74 Database Management Systems Topic #6: Database Design Weak Entity Type E Create a relation R Include all simple attributes and simple components of composite attributes. Include the primary key

More information

DATABASE DESIGN I - 1DL300

DATABASE DESIGN I - 1DL300 DATABASE DESIGN I - 1DL300 Fall 2009 An introductury course on database systems http://user.it.uu.se/~udbl/dbt1-ht2009/ alt. http://www.it.uu.se/edu/course/homepage/dbastekn/ht09/ Kjell Orsborn Uppsala

More information

Conceptual Data Modeling and the Entity- Relationship Model. Department of Computer Science Northern Illinois University September 2014

Conceptual Data Modeling and the Entity- Relationship Model. Department of Computer Science Northern Illinois University September 2014 Conceptual Data Modeling and the Entity- Relationship Model Department of Computer Science Northern Illinois University September 2014 Data Models A means of describing the structure of the data A set

More information

Database Design Process

Database Design Process Database Design Process Real World Functional Requirements Requirements Analysis Database Requirements Functional Analysis Access Specifications Application Pgm Design E-R Modeling Choice of a DBMS Data

More information

OVERVIEW OF DATABASE DEVELOPMENT

OVERVIEW OF DATABASE DEVELOPMENT DATABASE SYSTEMS I WEEK 2: THE ENTITY-RELATIONSHIP MODEL OVERVIEW OF DATABASE DEVELOPMENT Requirements Analysis / Ideas High-Level Database Design Conceptual Database Design / Relational Database Schema

More information

The Entity-Relationship Model. Steps in Database Design

The Entity-Relationship Model. Steps in Database Design The Entity-Relationship Model Steps in Database Design 1) Requirement Analysis Identify the data that needs to be stored data requirements Identify the operations that need to be executed on the data functional

More information

Entity Relationship Diagram (ERD): Basics

Entity Relationship Diagram (ERD): Basics Entity Relationship Diagram (ERD): Basics CIS 3730 Designing and Managing Data J.G. Zheng Fall 2010 Overview: 3 Level Database Design Creating an Entity Relationship Diagram (ERD) and associated data dictionary

More information

Database Management System (15ECSC208) UNIT I: Chapter 2: Relational Data Model and Relational Algebra

Database Management System (15ECSC208) UNIT I: Chapter 2: Relational Data Model and Relational Algebra Database Management System (15ECSC208) UNIT I: Chapter 2: Relational Data Model and Relational Algebra Relational Data Model and Relational Constraints Part 1 A simplified diagram to illustrate the main

More information

1/24/2012. Chapter 7 Outline. Chapter 7 Outline (cont d.) CS 440: Database Management Systems

1/24/2012. Chapter 7 Outline. Chapter 7 Outline (cont d.) CS 440: Database Management Systems CS 440: Database Management Systems Chapter 7 Outline Using High-Level Conceptual Data Models for Database Design A Sample Database Application Entity Types, Entity Sets, Attributes, and Keys Relationship

More information

More on the Chen Notation

More on the Chen Notation More on the Chen Notation Reference: http://www.vertabelo.com/blog/technical-articles/chen-erd-notation Peter Chen, who developed entity-relationship modeling and published his work in 1976, was one of

More information

Example: specific person, company, event, plant

Example: specific person, company, event, plant A database can be modeled as: a collection of entities, relationship among entities. An entity is an object that exists and is distinguishable from other objects. Example: specific person, company, event,

More information

Conceptual Database Design. COSC 304 Introduction to Database Systems. Entity-Relationship Modeling. Entity-Relationship Modeling

Conceptual Database Design. COSC 304 Introduction to Database Systems. Entity-Relationship Modeling. Entity-Relationship Modeling COSC 304 Introduction to Database Systems Entity-Relationship Modeling Dr. Ramon Lawrence University of British Columbia Okanagan ramon.lawrence@ubc.ca Conceptual Database Design Conceptual database design

More information

2004 John Mylopoulos. The Entity-Relationship Model John Mylopoulos. The Entity-Relationship Model John Mylopoulos

2004 John Mylopoulos. The Entity-Relationship Model John Mylopoulos. The Entity-Relationship Model John Mylopoulos XVI. The Entity-Relationship Model The Entity Relationship Model The Entity-Relationship Model Entities, Relationships and Attributes Cardinalities, Identifiers and Generalization Documentation of E-R

More information

UNIT II A. ENTITY RELATIONSHIP MODEL

UNIT II A. ENTITY RELATIONSHIP MODEL UNIT II A. ENTITY RELATIONSHIP MODEL Agenda En0ty & En0ty Sets A6ributes Rela0onship & Rela0onship Sets Constraints Mapping Cardinali0es, Par0cipa0on Constraints, Keys E-R Diagrams & Design of Database

More information

Chapter 9: Relational DB Design byer/eer to Relational Mapping Relational Database Design Using ER-to- Relational Mapping Mapping EER Model

Chapter 9: Relational DB Design byer/eer to Relational Mapping Relational Database Design Using ER-to- Relational Mapping Mapping EER Model Chapter 9: Relational DB Design byer/eer to Relational Mapping Relational Database Design Using ER-to- Relational Mapping Mapping EER Model Constructs to Relations Relational Database Design by ER- and

More information

Weak Entity Sets. A weak entity is an entity that cannot exist in a database unless another type of entity also exists in that database.

Weak Entity Sets. A weak entity is an entity that cannot exist in a database unless another type of entity also exists in that database. Weak Entity Sets A weak entity is an entity that cannot exist in a database unless another type of entity also exists in that database. Weak entity meets two conditions Existence-dependent Cannot exist

More information

Unit1: Introduction. Database System Concepts, 6 th Ed. Silberschatz, Korth and Sudarshan See for conditions on re-use

Unit1: Introduction. Database System Concepts, 6 th Ed. Silberschatz, Korth and Sudarshan See   for conditions on re-use Unit1: Introduction Database System Concepts, 6 th Ed. See www.db-book.com for conditions on re-use Outline Introduction to Database Management Systems, Purpose of Database Systems, Database-System Applications,

More information

Lecture 14 of 42. E-R Diagrams, UML Notes: PS3 Notes, E-R Design. Thursday, 15 Feb 2007

Lecture 14 of 42. E-R Diagrams, UML Notes: PS3 Notes, E-R Design. Thursday, 15 Feb 2007 Lecture 14 of 42 E-R Diagrams, UML Notes: PS3 Notes, E-R Design Thursday, 15 February 2007 William H. Hsu Department of Computing and Information Sciences, KSU KSOL course page: http://snipurl.com/va60

More information

Chapter 6: Entity-Relationship Model

Chapter 6: Entity-Relationship Model Chapter 6: Entity-Relationship Model Database System Concepts, 5th Ed. See www.db-book.com for conditions on re-use Chapter 6: Entity-Relationship Model Design Process Modeling Constraints E-R Diagram

More information

Chapter 3 Database Modeling and Design II. Database Modeling

Chapter 3 Database Modeling and Design II. Database Modeling Chapter 3 Database Modeling and Design II. Database Modeling Dr. Eng. Shady Aly 1 Data modeling تمثيل مجرد A data model is abstract representation of the data on which the IS application is to be based

More information

Entity-Relationship Models

Entity-Relationship Models Entity-Relationship Models 1 / 24 Entity-Relationship Models Entities Attributes Relationships 2 / 24 The Role of Conceptual Models High-level but concrete view of data understandable by end users and

More information

The Entity-Relationship Model. Overview of Database Design

The Entity-Relationship Model. Overview of Database Design The Entity-Relationship Model Chapter 2, Chapter 3 (3.5 only) Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 1 Overview of Database Design Conceptual design: (ER Model is used at this stage.)

More information

Database Systems: Design, Implementation, and Management Tenth Edition. Chapter 4 Entity Relationship (ER) Modeling

Database Systems: Design, Implementation, and Management Tenth Edition. Chapter 4 Entity Relationship (ER) Modeling Database Systems: Design, Implementation, and Management Tenth Edition Chapter 4 Entity Relationship (ER) Modeling Objectives In this chapter, students will learn: The main characteristics of entity relationship

More information