Presentation is loading. Please wait.

Presentation is loading. Please wait.

Creating an ERD Part 1 Define the Problem

Similar presentations


Presentation on theme: "Creating an ERD Part 1 Define the Problem"— Presentation transcript:

1 Creating an ERD Part 1 Define the Problem
CGS2540C Database Management

2 The Problem Draw an entity-relationship diagram that describes the following business environment. The city of Chicago, IL, wants to maintain information about its extensive system of high schools, including its teachers and their university degrees, its students, administrators, and the subjects that it teaches. This presentation demonstrates the steps necessary to create an ERD. Remember, the ERD is part of the logical design for the database. This is a process like that needed to complete your assignment for this chapter. Read the problem several times to completely understand its scope. When designing a real database you may receive information not related to the specific problem to be solved. What is the problem to be solved above? cgs2540c_creating_an_erd_1.ppt

3 Identify Potential Entities
The city of Chicago, IL, wants to maintain information about its extensive system of high schools, including its teachers and their university degrees, its students, administrators, and the subjects that it teaches. You should identify potential entities by highlighting all the nouns in your narrative. Entities are people, places, or things about which we wish to store data. Nouns are also people, places, or things. Don’t include duplicates. Not all nouns will be an appropriate entity but all entities will be nouns. cgs2540c_creating_an_erd_1.ppt

4 Eliminate Unneeded Entities
The city of Chicago, IL, wants to maintain information about its extensive system of high schools, including its teachers and their university degrees, its students, administrators, and the subjects that it teaches. For this problem we don’t need to track information about a city. Therefore city can be eliminated as a potential entity. This problem is very detailed so there is not a lot of extra information. This won’t be true when you design databases for real projects. cgs2540c_creating_an_erd_1.ppt

5 List the Remaining Entities
School Teacher Degree Student Administrator Subject Only the valid entities remain once you eliminate the unneeded entities. For this problem the appropriate entities are listed. Notice the entities are singular not plural. The problem description indicates we need to track more than just degrees so we will change the Degree entity to University and include degree info there. cgs2540c_creating_an_erd_1.ppt

6 Identify Relationships
Student attends school. Teacher are employed at a school. Teacher teach subject to student. Teacher attended an university Administrator run the school. Teacher supervise other teachers. The next step is to identify the relationship between the entities. The goal is to determine what entities relate to or need to “interact” with other entities. The problem description should provide the appropriate information. In our problem, you can see these relationships. cgs2540c_creating_an_erd_1.ppt

7 Determine Type of Relationship
Student attends school. “… the school system is only interested in keeping track of which school a student currently attends” This is a binary one-to-many relationship. A student attends one school but a school can have many students. The relationship type refers to the connectivity. Is the connectivity 1:1, 1:M, or M:N? You may need to make some assumptions about the relationship as is done in the example above. We assumed “currently” means the student attends one and one school. Any previous schools attended do not need to be tracked. Always verify these assumptions with the appropriate employee when creating databases for a business. cgs2540c_creating_an_erd_1.ppt

8 Determine Type of Relationship
Teacher is employed at a school “Teachers tend to periodically move from school to school and the school system wants to keep track of the history of which schools the teacher has taught in, including the current school. ” This is a binary many-to-many relationship A school can employ many teachers and a teacher may have been employed by many schools. The many-to-many relationship is the result of the need to track previous schools at which the teacher taught. cgs2540c_creating_an_erd_1.ppt

9 Determine Type of Relationship
Teacher teach subject to student. “…wants to keep track of which teacher taught which student which subject…” This is a ternary many-to-many relationship. A teacher can teach multiple subjects to many students. A student can take many subjects from many teachers. A subject can be taken by many students and taught by many teachers. Many times a ternary relationship can and should be broken into two binary relationships. This cannot be done in this situation. The reason is because of the need to track which teacher taught which student which subject. Implementing this as two binary relationships would cause information for the entity left out to be lost. For example, a student to teacher binary relationship means we would wouldn’t be able to track which subject a given teacher taught to a given student. cgs2540c_creating_an_erd_1.ppt

10 Determine Type of Relationship
Teacher attends an university. “The school system wants to keep track of the universities that each teacher attended…” This is a binary many-to-many relationship A teacher could attend many universities and a given university could have been attended by many teachers. We will include degree information in the univeversity entity. cgs2540c_creating_an_erd_1.ppt

11 Determine Type of Relationship
Administrator runs school “Each school has several administrators, such as the principal and assistant principals.” This is a binary one-to-many relationship Each school has several administrators but each administrator works at one school. A binary one-to-many relationship is the most common and most ideal relationship to implement in a relational database. cgs2540c_creating_an_erd_1.ppt

12 Determine Type of Relationship
Teacher supervises other teachers. “Some teachers, as department heads, supervise other teachers. The school system wants to keep track of these supervisory relationships but only for teachers’ current supervisors.” This is a unary one-to-many relationship. A teacher many supervise many teachers but each teacher has a single supervisor. Note this is a unary relationship. There is only one entity involved – Teacher. Also note that it is one-to-many because we only need to track the current supervisor. cgs2540c_creating_an_erd_1.ppt

13 This completes part one of the video!
cgs2540c_creating_an_erd_1.ppt


Download ppt "Creating an ERD Part 1 Define the Problem"

Similar presentations


Ads by Google