entity relationship diagrams don archer. entity relationship diagram erds – depicts data in terms...

29
Entity Relationship Diagrams Don Archer

Post on 21-Dec-2015

227 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Entity Relationship Diagrams Don Archer. Entity Relationship Diagram  ERDs – depicts data in terms of the entities and relationships described by the

Entity Relationship Diagrams

Don Archer

Page 2: Entity Relationship Diagrams Don Archer. Entity Relationship Diagram  ERDs – depicts data in terms of the entities and relationships described by the

Entity Relationship DiagramERDs – depicts data in terms of the

entities and relationships described by the data.

Page 3: Entity Relationship Diagrams Don Archer. Entity Relationship Diagram  ERDs – depicts data in terms of the entities and relationships described by the

Entity DefinitionEntity - is a person, place, thing, or

event of importance to the organization. Anything that can be a noun can be an entity.

Entity Occurrence - One individual instance of a type of entity - the set of data describing an instance of an entity.

Page 4: Entity Relationship Diagrams Don Archer. Entity Relationship Diagram  ERDs – depicts data in terms of the entities and relationships described by the

Identifying Entities

Identify the nouns in the conversation:

Students may enroll in 12 courses. Classes are scheduled during 6 sessions throughout the year and are identified by sections. Each class may contain 18 students. Students may have several registrations for these classes that are held at 6 locations.

Qualified faculty are assigned to various sections of of the classes. Not all faculty are qualified to teach all courses.

Page 5: Entity Relationship Diagrams Don Archer. Entity Relationship Diagram  ERDs – depicts data in terms of the entities and relationships described by the

Identifying Entities

Identify the nouns in the conversation:

STUDENTs may enroll in 12 COURSEs. CLASSes are scheduled during 6 SESSIONs throughout the YEAR and are identified by SECTIONs. Each CLASS may contain 18 STUDENTs. STUDENTs may have several REGISTRATIONs for these CLASSes that are held at 6 LOCATIONs.

QUALIFIED FACULTY are assigned to various SECTIONs of of the CLASSes. Not all FACULTY are qualified to teach all COURSEs.

Page 6: Entity Relationship Diagrams Don Archer. Entity Relationship Diagram  ERDs – depicts data in terms of the entities and relationships described by the

studentidstudent nameaddresscitystatepostal codefacutlyid (FK)

STUDENT

Page 7: Entity Relationship Diagrams Don Archer. Entity Relationship Diagram  ERDs – depicts data in terms of the entities and relationships described by the

studentidstudent nameaddresscitystatepostal codefacutlyid (FK)

STUDENT

course nocourse desccredit hours

COURSE

Page 8: Entity Relationship Diagrams Don Archer. Entity Relationship Diagram  ERDs – depicts data in terms of the entities and relationships described by the

Identifying Relationships

Identify the verbs in the conversation:

STUDENTs may enroll in 12 COURSEs. Classes are scheduled during 6 SESSIONs throughout the YEAR and are identified by SECTIONs. Each class may contain 18 students. Students may have several REGISTRATIONs for these classes that are held at 6 LOCATIONs.

QUALIFIED FACULTY are assigned to various sections of of the classes. Not all FACULTY are qualified to teach all courses.

Page 9: Entity Relationship Diagrams Don Archer. Entity Relationship Diagram  ERDs – depicts data in terms of the entities and relationships described by the

Identifying Relationships

Identify the verbs in the conversation:

Students may ENROLL in 12 courses. Classes are SCHEDULED during 6 sessions throughout the year and are IDENTIFIED by sections. Each class may CONTAIN 18 students. Students may HAVE several registrations for these classes that are HELD at 6 locations.

Qualified faculty are ASSIGNED to various sections of of the classes. Not all faculty are QUALIFIED to teach all courses.

Page 10: Entity Relationship Diagrams Don Archer. Entity Relationship Diagram  ERDs – depicts data in terms of the entities and relationships described by the

Identifying Entities & Relations

studentidstudent nameaddresscitystatepostal codefacutlyid (FK)

STUDENT

course nocourse desccredit hours

COURSE

enrolls

Page 11: Entity Relationship Diagrams Don Archer. Entity Relationship Diagram  ERDs – depicts data in terms of the entities and relationships described by the

Identifying Entities

studentidstudent nameaddresscitystatepostal codefacutlyid (FK)

STUDENT

course nocourse desccredit hours

COURSE

enrolls

Many-to-many

Page 12: Entity Relationship Diagrams Don Archer. Entity Relationship Diagram  ERDs – depicts data in terms of the entities and relationships described by the

Identifying Entities

studentidstudent nameaddresscitystatepostal codefacutlyid (FK)

STUDENT

course nocourse desccredit hours

COURSE

enrolls

course nostudentidgrade

SCHEDULED CLASS

Enrolls inConsists of

Page 13: Entity Relationship Diagrams Don Archer. Entity Relationship Diagram  ERDs – depicts data in terms of the entities and relationships described by the

studentidstudent nameaddresscitystatepostal codefacutlyid (FK) (IE)

STUDENT

course nocourse desccredit hours

COURSE

consist of/makes up

registers for/registers

yearsessionsection nocourse nofacultyidlocation code

SCHEDULED CLASS

Is This Correct???

Page 14: Entity Relationship Diagrams Don Archer. Entity Relationship Diagram  ERDs – depicts data in terms of the entities and relationships described by the

studentidstudent nameaddresscitystatepostal codefacutlyid (FK) (IE)

STUDENT

course nocourse desccredit hours

COURSE

consist of/makes up

registers for/registers

yearsessionsection nocourse nofacultyidlocation code

SCHEDULED CLASS

NO!

Many-t

o-man

y

This is a many-to-many relationship

Page 15: Entity Relationship Diagrams Don Archer. Entity Relationship Diagram  ERDs – depicts data in terms of the entities and relationships described by the

studentidstudent nameaddresscitystatepostal codefacutlyid (FK) (IE)

STUDENT

course nocourse desccredit hours

COURSE

consist of/makes up

registers for/registers

yearsessionsection nocourse nofacultyidlocation code

SCHEDULED CLASS

How do you fix a M:M relation?

Page 16: Entity Relationship Diagrams Don Archer. Entity Relationship Diagram  ERDs – depicts data in terms of the entities and relationships described by the

yearsessionsection nocourse nostudentid/1studentid (FK) (IE)

CLASS REGISTRATION

studentidstudent nameaddresscitystatepostal codefacutlyid (FK) (IE)

STUDENT

course nocourse desccredit hours

COURSE

consist of/makes up

registers for/registers

has/is for

yearsessionsection nocourse nofacultyidlocation code

SCHEDULED CLASS

Associative Entity

Page 17: Entity Relationship Diagrams Don Archer. Entity Relationship Diagram  ERDs – depicts data in terms of the entities and relationships described by the

year

YEAR

yearsessionsection nocourse nostudentid/1studentid (FK) (IE)

CLASS REGISTRATION

studentidstudent nameaddresscitystatepostal codefacutlyid (FK) (IE)

STUDENT

course nocourse desccredit hours

COURSE

consist of/makes up

registers for/registers

has/is for

have/is for

yearsessionsection nocourse nofacultyidlocation code

SCHEDULED CLASS

Refinements

Page 18: Entity Relationship Diagrams Don Archer. Entity Relationship Diagram  ERDs – depicts data in terms of the entities and relationships described by the

year

YEAR

session

SESSION

yearsessionsection nocourse nostudentid/1studentid (FK) (IE)

CLASS REGISTRATION

studentidstudent nameaddresscitystatepostal codefacutlyid (FK) (IE)

STUDENT

course nocourse desccredit hours

COURSE

consist of/makes up

registers for/registers

has/is for

have/is for

have/is for

yearsessionsection nocourse nofacultyidlocation code

SCHEDULED CLASS

Refinements

Page 19: Entity Relationship Diagrams Don Archer. Entity Relationship Diagram  ERDs – depicts data in terms of the entities and relationships described by the

year

YEAR

session

SESSION

section no

SECTION

yearsessionsection nocourse nostudentid/1studentid (FK) (IE)

CLASS REGISTRATION

studentidstudent nameaddresscitystatepostal codefacutlyid (FK) (IE)

STUDENT

course nocourse desccredit hours

COURSE

consist of/makes up

registers for/registers

has/is for

have/is for

have/is for

have/is for

yearsessionsection nocourse nofacultyidlocation code

SCHEDULED CLASS

Refinements

Page 20: Entity Relationship Diagrams Don Archer. Entity Relationship Diagram  ERDs – depicts data in terms of the entities and relationships described by the

year

YEAR

session

SESSION

section no

SECTION

yearsessionsection nocourse nostudentid/1studentid (FK) (IE)

CLASS REGISTRATION

studentidstudent nameaddresscitystatepostal codefacutlyid (FK) (IE)

STUDENT

course nocourse desccredit hours

COURSE

facutlyidfaculty nameaddresscitystatezipemphasisfacutlyid/1 (FK) (IE)

FACULTY

consist of/makes up

registers for/registers

has/is for

is assigned to/has assigned

held at/hosts

have/is for

have/is for

have/is for

location codeloc description

LOCATION

yearsessionsection nocourse nofacultyidlocation code

SCHEDULED CLASS

Location

& Faculty

Page 21: Entity Relationship Diagrams Don Archer. Entity Relationship Diagram  ERDs – depicts data in terms of the entities and relationships described by the

year

YEAR

session

SESSION

section no

SECTION

yearsessionsection nocourse nostudentid/1studentid (FK) (IE)

CLASS REGISTRATION

studentidstudent nameaddresscitystatepostal codefacutlyid (FK) (IE)

STUDENT

course nocourse desccredit hours

COURSE

facutlyidfaculty nameaddresscitystatezipemphasisfacutlyid/1 (FK) (IE)

FACULTY

course nofacutlyid (FK)

QUALIFIED FACULTY

consist of/makes up

registers for/registers

has/is for

becomes/consitst of

held at/hosts

have/is for

have/is for

have/is for

location codeloc description

LOCATION

yearsessionsection nocourse nofacultyidlocation code

SCHEDULED CLASS

qualified for/qualified by

Page 22: Entity Relationship Diagrams Don Archer. Entity Relationship Diagram  ERDs – depicts data in terms of the entities and relationships described by the

year

YEAR

session

SESSION

section no

SECTION

yearsessionsection nocourse nostudentid/1studentid (FK) (IE)

CLASS REGISTRATION

studentidstudent nameaddresscitystatepostal codefacutlyid (FK) (IE)

STUDENT

course nocourse desccredit hours

COURSE

facutlyidfaculty nameaddresscitystatezipemphasisfacutlyid/1 (FK) (IE)

FACULTY

course nofacutlyid (FK)

QUALIFIED FACULTY

consist of/makes up

registers for/registers

has/is for

becomes/consitst of

is assigned to/has assigned

held at/hosts

have/is for

have/is for

have/is for

location codeloc description

LOCATION

yearsessionsection nocourse nofacultyidlocation code

SCHEDULED CLASS

qualified for/qualified by

Page 23: Entity Relationship Diagrams Don Archer. Entity Relationship Diagram  ERDs – depicts data in terms of the entities and relationships described by the

year

YEAR

session

SESSION

section no

SECTION

yearsessionsection nocourse nostudentid/1studentid (FK) (IE)

CLASS REGISTRATION

studentidstudent nameaddresscitystatepostal codefacutlyid (FK) (IE)

STUDENT

course nocourse desccredit hours

COURSE

facutlyidfaculty nameaddresscitystatezipemphasisfacutlyid/1 (FK) (IE)

FACULTY

course nofacutlyid (FK)

QUALIFIED FACULTY

consist of/makes up

registers for/registers

has/is for

advised by/advises

becomes/consitst of

is assigned to/has assigned

held at/hosts

have/is for

have/is for

have/is for

location codeloc description

LOCATION

yearsessionsection nocourse nofacultyidlocation code

SCHEDULED CLASS

qualified for/qualified by

Page 24: Entity Relationship Diagrams Don Archer. Entity Relationship Diagram  ERDs – depicts data in terms of the entities and relationships described by the

year

YEAR

session

SESSION

section no

SECTION

yearsessionsection nocourse nostudentid/1studentid (FK) (IE)

CLASS REGISTRATION

studentidstudent nameaddresscitystatepostal codefacutlyid (FK) (IE)

STUDENT

course nocourse desccredit hours

COURSE

facutlyidfaculty nameaddresscitystatezipemphasisfacutlyid/1 (FK) (IE)

FACULTY

course nofacutlyid (FK)

QUALIFIED FACULTY

mentors/is mentored by

consist of/makes up

registers for/registers

has/is for

advised by/advises

becomes/consitst of

is assigned to/has assigned

held at/hosts

have/is for

have/is for

have/is for

location codeloc description

LOCATION

yearsessionsection nocourse nofacultyidlocation code

SCHEDULED CLASS

qualified for/qualified by

Recursive

Page 25: Entity Relationship Diagrams Don Archer. Entity Relationship Diagram  ERDs – depicts data in terms of the entities and relationships described by the

Business rules Each STUDENT may HAVE one or more CLASS REGISTRATIONS. Each CLASS REGISTRATION must be ASSIGNED to one & only one

STUDENT.

Each CLASS may HAVE one or more CLASS REGISTRATIONs. Each CLASS REGISTRATION must BE FOR one & only one CLASS.

Each COURSE may BE ASSIGNED to one or more SCHEDULED CLASSes.

Each SCHEDULED CLASS must CONSIST on one & only one COURSE.

Page 26: Entity Relationship Diagrams Don Archer. Entity Relationship Diagram  ERDs – depicts data in terms of the entities and relationships described by the

Business rules Each LOCATION may be ASSIGNED one or more SCHEDULED

CLASSes. Each SCHEDULED CLASS must BE ASSIGNED to one & only one

LOCATION.

Each YEAR may be ASSIGNED one or more SCHEDULED CLASSes. Each SCHEDULED CLASS must BE ASSIGNED to one & only one

YEAR.

Each SECTION may be ASSIGNED one or more SCHEDULED CLASSes.

Each SCHEDULED CLASS must BE ASSIGNED to one & only one SECTION.

Page 27: Entity Relationship Diagrams Don Archer. Entity Relationship Diagram  ERDs – depicts data in terms of the entities and relationships described by the

Business rules Each FACULTY may ADVISE one or more STUDENTs. Each STUDENT must be ADVISED BY one & only one ADVISOR.

Each QUALIFIED FACULTY must be ASSIGNED to one & only one COURSE.

Each COURSE may be QUALIFIED by one or more QUALIFIED FACULTY.

Each QUALIFIED FACULTY must CONSIST of one & only one FACULTY.

Each FACULTY may be QUALIFIED for one or more QUALIFIED FACULTY positions.

Page 28: Entity Relationship Diagrams Don Archer. Entity Relationship Diagram  ERDs – depicts data in terms of the entities and relationships described by the

year

YEAR

session

SESSION

section no

SECTION

yearsessionsection nocourse nostudentid/1studentid (FK) (IE)

CLASS REGISTRATION

studentidstudent nameaddresscitystatepostal codefacutlyid (FK) (IE)

STUDENT

course nocourse desccredit hours

COURSE

facutlyidfaculty nameaddresscitystatezipemphasisfacutlyid/1 (FK) (IE)

FACULTY

course nofacutlyid (FK)

QUALIFIED FACULTY

mentors/is mentored by

consist of/makes up

registers for/registers

has/is for

advised by/advises

becomes/consitst of

is assigned to/has assigned

held at/hosts

have/is for

have/is for

have/is for

location codeloc description

LOCATION

yearsessionsection nocourse nofacultyidlocation code

SCHEDULED CLASS

qualified for/qualified by

Visio

Page 29: Entity Relationship Diagrams Don Archer. Entity Relationship Diagram  ERDs – depicts data in terms of the entities and relationships described by the

Other Questions?