Transcript
Page 1: Entity Relationship Diagrams

3.3.1

Page 2: Entity Relationship Diagrams

• What is an Entity

• What is an Entity Relationship Diagram?

• Different types of relationships

Page 3: Entity Relationship Diagrams

• Systems can be confusing things.

• To help people understand what they are trying to design they often use diagrams.

• There are different styles of diagrams including:– Entity Relationship Diagrams– State Transition Diagrams– Data Flow Diagrams– Flowcharts

• The type of diagram used will depend on the system being designed but a combination of diagrams can be used on the same project.

Page 4: Entity Relationship Diagrams
Page 5: Entity Relationship Diagrams

• Entities are ‘things’.

• Each entity is made up of attributes.

• For example, a is an entity.

• It is made up of leaves... and other things.

Page 6: Entity Relationship Diagrams

• Strictly speaking...

• The is also an entity...as it too is

made up of different attributes!

Page 7: Entity Relationship Diagrams

• There are different types of relationship which you need to be aware of:

– One-to-One– One-to-Many– Many-to-Many

Page 8: Entity Relationship Diagrams

• Assuming a teacher only taught in one classroom in a school...

TeacherTeacher ClassroomClassroom

Page 9: Entity Relationship Diagrams

• A teacher has many lessons but a lesson can only have one teacher.

TeacherTeacher LessonLesson

Page 10: Entity Relationship Diagrams

• A teacher has many students and a student can have many teachers.

• Many-to-Many relationships are never ideal so a third table is often created.

TeacherTeacher StudentsStudents

Page 11: Entity Relationship Diagrams

• A third table is added to create two One-to-Many relationships.

TeacherTeacher StudentsStudents

ClassClass

Page 12: Entity Relationship Diagrams
Page 13: Entity Relationship Diagrams

Recommended