29
Entities and Relationships Semantic Objects Database Design Database Design Representation of Users’ Data Users’ Reports, Forms, Queries Semantic Object Model E-R Model I G U R E 4 - 1 sing Different Data Models for Database Designs DATA MODELS AND DATABASE DESIGN

Entities and Relationships Entities and Relationships Semantic Objects Semantic Objects Database Design Database Design Database Design Database Design

Embed Size (px)

Citation preview

Page 1: Entities and Relationships Entities and Relationships Semantic Objects Semantic Objects Database Design Database Design Database Design Database Design

Entitiesand

Relationships

Entitiesand

Relationships

SemanticObjects

SemanticObjects

DatabaseDesign

DatabaseDesign

DatabaseDesign

DatabaseDesign

Representationof Users’ Data

Users’ Reports,Forms, Queries

SemanticObject Model

E-R Model

F I G U R E 4 - 1

Using Different Data Models for Database Designs

DATA MODELS AND DATABASE DESIGN

Page 2: Entities and Relationships Entities and Relationships Semantic Objects Semantic Objects Database Design Database Design Database Design Database Design

SEMANTIC OBJECTS

DEFINITION:A NAMED COLLECITON OF ATTRIBUTES THATSUFFICIENTLY DESCRIBES A DISTINCT IDENTITY.

SEMANTIC OBJECTS ARE GROUPED INTO CLASSES.

EACH SEMANTIC OBJECT IS THEREFORE AN INSTANCE OF A

CLASS.

EACH INSTANCE OF A CLASS IS UNIQUE.

AN OBJECT HAS A COLLECTION OF ATTRIBUTES.

EACH ATTRIBUTE DESCRIBES A CHARACTERISTIC OF THE

IDENTITY.

Page 3: Entities and Relationships Entities and Relationships Semantic Objects Semantic Objects Database Design Database Design Database Design Database Design

ATTRIBUTES OF SEMANTIC OBJECTS

•3 TYPES OF ATTRIBUTES

SIMPLE ATTRIBUTE: An attribute with a single value (ex: ZipCode)

GROUP ATTRIBUTE: Composites of single attributes (ex: Address

consisting of {Street, City, State, Zip}

SEMANTIC OBJECT ATTRIBUTE: An attribute which establishes a

relationship with another semantic object.

•EXAMPLEF I G U R E 4 - 2

DEPARTMENT Object

Diagram:

(a) DEPARTMENT

Object and

(b) DEPARTMENT

Object with Cardinalities

DEPARTMENTID DepartmentName

CampusAddress

Building Office Number

PhoneNumber

FaxPhoneNumber

DEPARTMENTID DepartmentName

CampusAddress

Building Office Number

PhoneNumber

FaxPhoneNumber

COLLEGE

PROFESSOR

STUDENT

(a)

DEPARTMENTID DepartmentName

CampusAddress

Building 1.1

Office Number 1.1

PhoneNumber

FaxPhoneNumber 0.1

DEPARTMENTID DepartmentName

CampusAddress

Building 1.1

Office Number 1.1

PhoneNumber

FaxPhoneNumber 0.1

COLLEGE

PROFESSOR

STUDENT1.N

1.N

1.1

(b)

0.1

1.1

1.N

Page 4: Entities and Relationships Entities and Relationships Semantic Objects Semantic Objects Database Design Database Design Database Design Database Design

ATTRIBUTES OF SEMANTIC OBJECTS

•ATTRIBUTE CARDINALITY

MINIMUM CARDINALITY: The # of instances that must exist for an object

to be valid (usually 0 or 1).

MAXIMUM CARDINALITY: The largest # of instances an object can have.

Cardinalities are represented as min.max with default 0.1 assumed for simple

attributes.

•OBJECT IDENTIFIERS

One or more attributes that uniquely identify each object.

•ATTRIBUTE DOMAIN

The description of an attribute’s possible values.

Example: Enumerated List (“male”, “female” for attribute Gender) Integer Integer with Range (5<n<31 for attribute NPSClassSize) Real Real with Range (0<n<100 for degrees Celsius) Character of Specified Length Date (dd-mm-yy)

Page 5: Entities and Relationships Entities and Relationships Semantic Objects Semantic Objects Database Design Database Design Database Design Database Design

HIGHLINE DESIGN - COLLEGE REPORT

College of BusinessMary B. Jefferson, Dean

Department

Accounting

Finance

Info Systems

Management

Production

Chairperson

Jackson Seymour P

Heufeng Susan

Brammer Nathaniel

Tottle Christing A

Barnes Jack T

Total Majors

318

211

247

184

212

Phone

232-1841

232-1434

236-0011

236-9988

236-1184

Phone :232-1187Campus Address:

Business Building, Room 100

F I G U R E 4 - 5

Example COLLEGE Report

COLLEGEID CollegeName

DeanName

PhoneNumber

CampusAddress Building 1.1

Office Number

COLLEGEID CollegeName

DeanName

PhoneNumber

CampusAddress Building 1.1

Office Number

DEPARTMENT

1.1

1.N

0.1

DEPARTMENTID DepName

Chairperson

PhoneNumber

TotalMajors

DEPARTMENTID DepName

Chairperson

PhoneNumber

TotalMajors

COLLEGE1.1

F I G U R E 4 - 6

First Version of

COLLEGE and

DEPARTMENT

Objects

Why isn’t thisan OBJECTattribute?

Why isn’t this a groupattribute likeCampusAddress?

Page 6: Entities and Relationships Entities and Relationships Semantic Objects Semantic Objects Database Design Database Design Database Design Database Design

HIGHLINE DESIGN - DEPARTMENT REPORT

F I G U R E 4 - 8

Adjusted

DEPARTMENT and

New PROFESSOR

Objects

F I G U R E 4 - 7

Example

DEPARTMENT

Report

Information Systems DepartmentCollege of Business

Chairperson:Phone:Campus Address:

Brammer, Nathaniel D236-0011Social Science Building, Room 213

Professor

Jones Paul D

Parks Mary B

Wu Elizabeth

Office

Social Science, 219

Social Science, 308

Social Science, 207

Phone

232-7713

232-5791

232-9112

Why is this 1.1?What if a professorcould have a jointappointment?

PROFESSORID ProfessorName

CampusAddress Building 1.1

Office Number 1.1

PhoneNumber

PROFESSORID ProfessorName

CampusAddress Building 1.1

Office Number 1.1

PhoneNumber

DEPARTMENT

0.1

1.1

DEPARTMENTID DepName Chairperson PhoneNumber TotalMajors CampusAddress Building 1.1

Office Number 1.1

DEPARTMENTID DepName Chairperson PhoneNumber TotalMajors CampusAddress Building 1.1

Office Number 1.1

PROFESSOR1.N

0.1

COLLEGE1.1

Page 7: Entities and Relationships Entities and Relationships Semantic Objects Semantic Objects Database Design Database Design Database Design Database Design

HIGHLINE DESIGN - DEPARTMENT REPORT

F I G U R E 4 - 1 0

Adjusted

DEPARTMENT and

New STUDENT

Objects

F I G U R E 4 - 9

Second Example

DEPARTMENT

Report

Student Major ListInformation Systems Department

Chairperson: Brammer, Nathaniel D Phone: 232-4146

Major’s Name

Jackson, Robin R.

Lincoln, Fred J.

Madison, Janice A.

Student Number

12345

48127

37512

Phone

237-8713

237-5613

237-0003

STUDENT

ID StudentName

ID StudentNumber

PhoneNumber

STUDENT

ID StudentName

ID StudentNumber

PhoneNumber

DEPARTMENT

1.1

1.1

1.1

DEPARTMENTID DepName Chairperson PhoneNumber TotalMajors

CampusAddress Building 1.1

Office Number 1.1

DEPARTMENTID DepName Chairperson PhoneNumber TotalMajors

CampusAddress Building 1.1

Office Number 1.1

PROFESSOR1.N

0.1

COLLEGE1.1

STUDENT1.N

Page 8: Entities and Relationships Entities and Relationships Semantic Objects Semantic Objects Database Design Database Design Database Design Database Design

HIGHLINE DESIGN - ACCEPTANCE LETTER

Mr. Fred Parks123 Elm StreetLos Angeles, CA 98002

Dear Mr. Parks:

You have been admitted as a major in the Accounting Department at HighlineUniversity, starting in the Fall Semester, 1993. The office of the AccountingDepartment is located in the Business Building, Room 210.

Your adviser is Professor Elizabeth Johnson, whose telephone number is 232-8740 and whose office is located in the Business building, Room 227. Pleaseschedule an appointment with your adviser as soon as you arrive on campus.

Congratulations and welcome to Highline University.

Sincerely,

Jan P. SmathersPresident

JPS/rkp

Mr. Fred Parks123 Elm StreetLos Angeles, CA 98002

Dear Mr. Parks:

You have been admitted as a major in the Accounting Department at HighlineUniversity, starting in the Fall Semester, 1993. The office of the AccountingDepartment is located in the Business Building, Room 210.

Your adviser is Professor Elizabeth Johnson, whose telephone number is 232-8740 and whose office is located in the Business building, Room 227. Pleaseschedule an appointment with your adviser as soon as you arrive on campus.

Congratulations and welcome to Highline University.

Sincerely,

Jan P. SmathersPresident

JPS/rkp

F I G U R E 4 - 1 1

Acceptance Letter

F I G U R E 4 - 1 2

Adjusted

PROFESSOR and

STUDENT Objects

PROFESSORID ProfessorName

FirstName 0.1

LastName 1.1

CampusAddressBuilding 1.1

OfficeNumber 1.1

PhoneNumber

PROFESSORID ProfessorName

FirstName 0.1

LastName 1.1

CampusAddressBuilding 1.1

OfficeNumber 1.1

PhoneNumber

DEPARTMENT

STUDENT

1.1

0.1

1.1

1.N

STUDENTID StudentName

FirstName 0.1

LastName 1.1

ID StudentNumberPhoneNumberHomeAddress

Street 0.1

City 1.1

State 1.1

Zip 1.1

TitleEnrollmentDate

STUDENTID StudentName

FirstName 0.1

LastName 1.1

ID StudentNumberPhoneNumberHomeAddress

Street 0.1

City 1.1

State 1.1

Zip 1.1

TitleEnrollmentDateDEPARTMENT

PROFESSOR

1.1

1.1

1.1

1.1

Page 9: Entities and Relationships Entities and Relationships Semantic Objects Semantic Objects Database Design Database Design Database Design Database Design

HIGHLINE FINAL DESIGN

F I G U R E 4 - 1 3

A Complete Set of

Semantic Object

Diagrams

COLLEGEID CollegeName

DeanNameFirstName 0.1

LastName 1.1

PhoneNumberCampusAddress

Building 1.1

OfficeNumber 1.1

COLLEGEID CollegeName

DeanNameFirstName 0.1

LastName 1.1

PhoneNumberCampusAddress

Building 1.1

OfficeNumber 1.1

1.1

DEPARTMENT

0.1

1.N

DEPARTMENTID DeptName

ChairpersonFirstName 0.1

LastName 1.1

PhoneNumberTotalMajorsCampusAddress

Building 1.1

OfficeNumber 1.1

DEPARTMENTID DeptName

ChairpersonFirstName 0.1

LastName 1.1

PhoneNumberTotalMajorsCampusAddress

Building 1.1

OfficeNumber 1.1

1.1

COLLEGE

0.1

1.1

PROFESSOR

STUDENT1.N

1.N

PROFESSORID ProfessorName

FirstName 0.1

LastName 1.1

CampusAddress Building 1.1

OfficeNumber 1.1

PhoneNumber

PROFESSORID ProfessorName

FirstName 0.1

LastName 1.1

CampusAddress Building 1.1

OfficeNumber 1.1

PhoneNumber

1.1

DEPARTMENT

0.1

1.1

ADVISEE1.N

STUDENTID StudentName

FirstName 0.1

LastName 1.1

ID StudentNumberPhoneNumberHomeAddress

Street 0.1

City 0.1

State 1.1

Zip 1.1

TitleEnrollmentDate

STUDENTID StudentName

FirstName 0.1

LastName 1.1

ID StudentNumberPhoneNumberHomeAddress

Street 0.1

City 0.1

State 1.1

Zip 1.1

TitleEnrollmentDate

1.1

1.1

DEPARTMENT

ADVISER1.1

1.1

Page 10: Entities and Relationships Entities and Relationships Semantic Objects Semantic Objects Database Design Database Design Database Design Database Design

OBJECT SPECIFICATIONS FOR HIGHLINE DESIGN

(a)

ObjectName

ObjectName

COLLEGE

DEPARTMENT

PROFESSOR

STUDENT

COLLEGE

DEPARTMENT

PROFESSOR

STUDENT

PropertyName

PropertyName

CollegeNameDeanNamePhoneNumberCampusAddress Building OfficeNumberDEPARTMENT

DepNameChairpersonPhoneNumberTotalMajorsCampusAddressCOLLEGEPROFESSORSTUDENT

ProfessorNameCampusAddress Building OfficeNumberPhoneNumberDEPARTMENTADVISEE

StudentNameStudentNumberPhoneNumberHomeAddressTitleEnrollmentDateDEPARTMENTADVISER

CollegeNameDeanNamePhoneNumberCampusAddress Building OfficeNumberDEPARTMENT

DepNameChairpersonPhoneNumberTotalMajorsCampusAddressCOLLEGEPROFESSORSTUDENT

ProfessorNameCampusAddress Building OfficeNumberPhoneNumberDEPARTMENTADVISEE

StudentNameStudentNumberPhoneNumberHomeAddressTitleEnrollmentDateDEPARTMENTADVISER

MinCard

MinCard

1001111

10001111

1011011

11010011

1001111

10001111

1011011

11010011

MaxCard

MaxCard

111111N

111111NN

111111N

11111111

111111N

111111NN

111111N

11111111

KeyStatus

KeyStatus

ID

ID

ID

IDID

ID

ID

ID

IDID

DomainName

DomainName

CollegeNamePersonNamePhoneCampusAddressBuildingOfficeNumberDEPARTMENT

DepNamePersonNamePhoneMajorFormulaCampusAddressCOLLEGEPROFESSORSTUDENT

PersonNameCampusAddressBuildingOfficeNumberPhoneDEPARTMENTSTUDENT

PersonNameStudentNumberPhoneAddressTitleQuarterDateDEPARTMENTPROFESSOR

CollegeNamePersonNamePhoneCampusAddressBuildingOfficeNumberDEPARTMENT

DepNamePersonNamePhoneMajorFormulaCampusAddressCOLLEGEPROFESSORSTUDENT

PersonNameCampusAddressBuildingOfficeNumberPhoneDEPARTMENTSTUDENT

PersonNameStudentNumberPhoneAddressTitleQuarterDateDEPARTMENTPROFESSOR

F I G U R E 4 - 1 4

Object Specifications for the Highline University Database:(a) Semantic Object Specifications and (b) Domain Specifications

Page 11: Entities and Relationships Entities and Relationships Semantic Objects Semantic Objects Database Design Database Design Database Design Database Design

DOMAIN SPECIFICATIONS FOR HIGHLINE DESIGN

(b)

aF = formula G = Group S = SimpleSO = semantic object

NameName TypeaTypea

Semantic DescriptionSemantic Description Physical DescriptionPhysical Description

Address

Building

CampusAddress

CityCOLLEGE

CollegeName

DEPARTMENT

DeptName

FirstName

LastName

MajorCount

OfficeNumber

PersonName

Phone

PROFESSOR

QuarterDate

State

Street

STUDENT

StudentNumber

Title

Zip

Address

Building

CampusAddress

CityCOLLEGE

CollegeName

DEPARTMENT

DeptName

FirstName

LastName

MajorCount

OfficeNumber

PersonName

Phone

PROFESSOR

QuarterDate

State

Street

STUDENT

StudentNumber

Title

Zip

G

S

G

SSO

S

SO

S

S

S

F

S

G

S

SO

S

S

S

SO

S

S

S

G

S

G

SSO

S

SO

S

S

S

F

S

G

S

SO

S

S

S

SO

S

S

S

A U.S. address

A name of a building oncampusAn address on campus

A city nameOne of Highline’s tencollegesThe official name of acollege at HighlineAn academic departmenton campusThe official name of anacademic departmentThe first-name portion ofPersonNameThe last-name portion ofPersonNameCount of the studentsassigned to a givendepartmentThe number of an office oncampusFirst and last names of anadministrator, professor, orstudentPhone number within localarea codeThe name of a full-timemember of Highline’sfacultyAn academic quarter andyear

A two-digit stateabbreviation

A street address

A person who has beenadmitted for study atHighlineThe ID assigned to astudent admitted toHighlineThe title of individuals tobe used in addressesA nine-digit zip code

A U.S. address

A name of a building oncampusAn address on campus

A city nameOne of Highline’s tencollegesThe official name of acollege at HighlineAn academic departmenton campusThe official name of anacademic departmentThe first-name portion ofPersonNameThe last-name portion ofPersonNameCount of the studentsassigned to a givendepartmentThe number of an office oncampusFirst and last names of anadministrator, professor, orstudentPhone number within localarea codeThe name of a full-timemember of Highline’sfacultyAn academic quarter andyear

A two-digit stateabbreviation

A street address

A person who has beenadmitted for study atHighlineThe ID assigned to astudent admitted toHighlineThe title of individuals tobe used in addressesA nine-digit zip code

StreetCityStateZipText 20

BuildingOffice NumberText 25See semantic objectspecification tableText 25

See semantic objectspecification tableText 25

Text 20

Text 30

Integer; values (0 to999); format 999.

Text 4

FirstNameLastName

Text 4

See semantic objectspecification table

Text 3; values (q99,where q = one of (“F”,“W”, “S”, “M”) AND 99 isdecimal number from00 to 99.)Text 2

Text 30

See semantic objectspecification table

Integer; values (10000to 99999); format99999Text 3; values (Mr.,Ms.)Text 10;format 99999-9999

StreetCityStateZipText 20

BuildingOffice NumberText 25See semantic objectspecification tableText 25

See semantic objectspecification tableText 25

Text 20

Text 30

Integer; values (0 to999); format 999.

Text 4

FirstNameLastName

Text 4

See semantic objectspecification table

Text 3; values (q99,where q = one of (“F”,“W”, “S”, “M”) AND 99 isdecimal number from00 to 99.)Text 2

Text 30

See semantic objectspecification table

Integer; values (10000to 99999); format99999Text 3; values (Mr.,Ms.)Text 10;format 99999-9999

Page 12: Entities and Relationships Entities and Relationships Semantic Objects Semantic Objects Database Design Database Design Database Design Database Design

TYPES OF OBJECTS

SIMPLE OBJECT contains only single-value, non-object attributes.

COMPOSITE OBJECT contains one or more multi valued, non-objectattributes

COMPOUND OBJECT contains at least one object attribute

HYBRID OBJECT contains at least one multi valued group attribute thatincludes an object attribute.

ASSOCIATION OBJECT relates two or more objects and stores datapeculiar to that relationship.

PARENT/SUBTYPE OBJECT models generalization, inheritance, and IS-A relationships.

ARCHETYPE/VERSION OBJECT is an object which produces otherobjects representing versions, releases, or editions of the archetype.

Page 13: Entities and Relationships Entities and Relationships Semantic Objects Semantic Objects Database Design Database Design Database Design Database Design

SIMPLE OBJECTS

SIMPLE OBJECT contains only single-valued, non-object attributes.

F I G U R E 4 - 1 5

Example of a Simple Object: (a) Reports Based on a Simple Object and

(b) EQUIPMENT Simple Object

EQUIPMENT TAGEquipmentNumber 100 Description DeskAcquisitionDate 2/27/93 PurchaseCost $350.00

EQUIPMENT TAGEquipmentNumber 100 Description DeskAcquisitionDate 2/27/93 PurchaseCost $350.00

EQUIPMENT TAGEquipmentNumber 200 Description DeskAcquisitionDate 3/1/93 PurchaseCost $350.00

EQUIPMENT TAGEquipmentNumber 200 Description DeskAcquisitionDate 3/1/93 PurchaseCost $350.00

EQUIPMENTID EquipmentNumber

DescriptionAcquisitionDatePurchase Cost

EQUIPMENTID EquipmentNumber

DescriptionAcquisitionDatePurchase Cost

(a)

(b)

Page 14: Entities and Relationships Entities and Relationships Semantic Objects Semantic Objects Database Design Database Design Database Design Database Design

COMPOSITE OBJECTS

COMPOSITE OBJECT contains one or more multi-valued, non-object attributes.

(b)

HOTEL-BILLID InvoceNumber

ArrivalDate 1.1

ID CustomerName 1.1

LineItemServiceDate 1.1

ServiceDescription 1.1

Price 1.1

TotalDue 1.1

HOTEL-BILLID InvoceNumber

ArrivalDate 1.1

ID CustomerName 1.1

LineItemServiceDate 1.1

ServiceDescription 1.1

Price 1.1

TotalDue 1.1

0.N

F I G U R E 4 - 1 6

Example of a Composite Object: (a) Report Based on a

Composite Object and (b) HOTEL-BILL Composite Object

(a)

GRANDVIEW HOTEL Sea Bluffs, California

Invoice Number: 1234 Arrival Date: 10/12/93Customer Name: Mary Jones

10/12/93 Room $ 99.0010/12/93 Food $ 37.5510/12/93 Phone $ 2.5010/12/93 Tax $ 15.00

10/13/93 Room $ 99.0010/13/93 Food $ 47.9010/13/93 Tax $ 15.00

Total Due $ 315.00

Page 15: Entities and Relationships Entities and Relationships Semantic Objects Semantic Objects Database Design Database Design Database Design Database Design

F I G U R E 4 - 1 7A Composite Object with Two Groups: (a) HOTEL-BILL with MultivaluedCustomer names and (b) HOTEL-BILL with Two Multivalued Groups

(a)

COMPOSITE OBJECTS

(b)

HOTEL-BILLID InvoceNumber ArrivalDate 1.1

ID CustomerName 1.1

LineItem ServiceDate 1.1

ServiceDescription1.1

SubService Subdescription 1.1

Subprice 1.1

LineItemPrice 1.1

TotalDue 1.1

HOTEL-BILLID InvoceNumber ArrivalDate 1.1

ID CustomerName 1.1

LineItem ServiceDate 1.1

ServiceDescription1.1

SubService Subdescription 1.1

Subprice 1.1

LineItemPrice 1.1

TotalDue 1.1

1.N

0.N

F I G U R E 4 - 1 8A Composite Object with Nested Groups: (a) HOTEL-BILL with ServiceSubdescriptions and (b) HOTEL-BILL with Nested Multivalued Groups

(b)

HOTEL-BILLID InvoceNumber

ArrivalDate 1.1

ID CustomerName 1.N

LineItemServiceDate 1.1

ServiceDescription 1.1

Price 1.1

TotalDue 1.1

HOTEL-BILLID InvoceNumber

ArrivalDate 1.1

ID CustomerName 1.N

LineItemServiceDate 1.1

ServiceDescription 1.1

Price 1.1

TotalDue 1.1

0.N

GRANDVIEW HOTELSea Bluffs, California

Invoice Number: 1234 Arrival Date: 10/12/93Customer Name: Mary Jones

Fred Jones Sally Jones

10/12/93 Room $ 99.0010/12/93 Food $ 37.5510/12/93 Phone $ 2.5010/12/93 Tax $ 15.00

10/13/93 Room $ 99.0010/13/93 Food $ 47.9010/13/93 Tax $ 15.00

Total Due $ 315.00

(a)

GRANDVIEW HOTEL Sea Bluffs, California

Invoice Number: 1234 Arrival Date: 10/12/93Customer Name: Mary Jones

10/12/93 Room $ 99.0010/12/93 Food

Breakfast $ 15.25Dinner $ 22.30

$ 37.5510/12/93 Phone $ 2.5010/12/93 Tax $ 15.00

10/13/93 Room $ 99.0010/13/93 Food $ 15.25

Breakfast $ 5.50Snack $ 27.15Dinner $ 47.90

10/13/93 Tax $ 15.00

Total Due $ 315.95

Page 16: Entities and Relationships Entities and Relationships Semantic Objects Semantic Objects Database Design Database Design Database Design Database Design

COMPOUND OBJECTS

VEHICLE DATA

COMPOUND OBJECT contains at least one object attribute.

F I G U R E 4 - 2 2

Four Types of Compound Objects

F I G U R E 4 - 1 9

Compound Objects with 1:1 Paired Properties: (a) Example Vehicle and Employee

Data Entry Forms and (b) EMPLOYEE and VEHICLE Compound Objects

(a)

(b)

Object1 Can Contain

ManyMany

One

ManyManyOne

1:1 1:N1:N

M:1M:1 M:NM:N

Object2

Can

Contain

VEHICLE DATAVEHICLE DATA

License number Serial numberMake Type Year ColorEmployee assignment

License number Serial numberMake Type Year ColorEmployee assignment

EMPLOYEE WORK DATAEMPLOYEE WORK DATA

Employee name Employee IDMailing address Division PhonePay code Skill code Hire date Vehicle assigned

Employee name Employee IDMailing address Division PhonePay code Skill code Hire date Vehicle assigned

EMPLOYEEID EmployeeNameID EmployeeNumber MailStop Division Phone PayCode SkillCode HireDate

EMPLOYEEID EmployeeNameID EmployeeNumber MailStop Division Phone PayCode SkillCode HireDate

0.1

VEHICLE

VEHICLEID LicenseNumberID SerialNumber Make Type Year Color

VEHICLEID LicenseNumberID SerialNumber Make Type Year Color

1.1

EMPLOYEE

Page 17: Entities and Relationships Entities and Relationships Semantic Objects Semantic Objects Database Design Database Design Database Design Database Design

DORMITORYID DormNameID ResidentAssistant

Phone

DORMITORYID DormNameID ResidentAssistant

Phone

STUDENT1.N

COMPOUND OBJECTS

F I G U R E 4 - 2 0

Compound Objects with 1:N Paired Properties: (a) Example Dormitory Reportand Student Data Form and (b) DORMITORY and STUDENT CompoundObjects

(a)

(b)

Student Name Student Number

Major Adviser

Class High School

Prior College

Local Address

Phone

Permanent Address

Phone

STUDENT DATA FORM

DORMITORY OCCUPANCY REPORTDormitory Resident Assistant Phone

Ingersoll Sarah and Allen French 3-5567

Student Name Student Number Class

Adams, Elizabeth 710 SOBaker, Rex 104 FRBaker, Brydie 744 JNCharles, Stewart 319 SOScott, Sally 447 SOTaylor, Lynne 810 FR

STUDENTID StudentNameID StudentNumber

MajorAdviserClassHighSchoolLocalAddressLocalPhoneHighSchoolPermanentAddressPermanentPhone

STUDENTID StudentNameID StudentNumber

MajorAdviserClassHighSchoolLocalAddressLocalPhoneHighSchoolPermanentAddressPermanentPhone

0.1

DORMITORY

Page 18: Entities and Relationships Entities and Relationships Semantic Objects Semantic Objects Database Design Database Design Database Design Database Design

COMPOUND OBJECTS

F I G U R E 4 - 2 1

Compound Objects with N:M Paired Properties: (a) Bookstore Data Entry Formsand (b) BOOK and AUTHOR Objects

Carbon River BookshopBooks in Stock, by Author

AUTHOR:AUTHOR DATES:

Campbell, Joseph1904-1987

TITLES WE CARRY: The Hero with a Thousand Faces The Inner Reaches of Outer Space The Mythic Image Myths to Live By The Power of Myth

BOOKID TitleID ISBN

Publisher

BOOKID TitleID ISBN

Publisher

AUTHOR1.N

AUTHORID AuthorName AuthorDates

BOOK1.N

(a)

(b)

Carbon River BookshopBook Stock Data

Title

Author(s)

ISBN

Publisher

Copyright Date

Page 19: Entities and Relationships Entities and Relationships Semantic Objects Semantic Objects Database Design Database Design Database Design Database Design

HYBRID OBJECTS

HYBRID OBJECT contains at least one multi valued group attribute thatincludes an object attribute.

F I G U R E 4 - 2 3

DORMITORY Hybrid Object: (a) Dormitory Report with Rent Property(b) Correct DORMITORY and STUDENT Objects, and (c) IncorrectDORMITORY and Correct STUDENT Objects

(a)

(b)

(c)

DORMITORY OCCUPANCY REPORTDormitory Resident Assistant Phone

Ingersoll Sarah and Allen French 3-5567

Student Name Student Number Rent

Adams, Elizabeth 710 $175.00Baker, Rex 104 $225.00Baker, Brydie 744 $175.00Charles, Stewart 319 $135.00Scott, Sally 447 $225.00Taylor, Lynne 810 $175.00

DORMITORYID DormName

ResidentAssistantPhoneStudentRent

Rent 0.1

DORMITORYID DormName

ResidentAssistantPhoneStudentRent

Rent 0.1

1.1

1.N

STUDENT

STUDENTID StudentNameID StudentNumber1.1

STUDENTID StudentNameID StudentNumber1.1

0.1

DORMITORY

DORMITORYID DormName

ResidentAssistantPhone

Rent 0.N

DORMITORYID DormName

ResidentAssistantPhone

Rent 0.N

1.N

STUDENT

STUDENTID StudentNameID StudentNumber

STUDENTID StudentNameID StudentNumber

0.1

DORMITORY

Page 20: Entities and Relationships Entities and Relationships Semantic Objects Semantic Objects Database Design Database Design Database Design Database Design

HYBRID OBJECTS

F I G U R E 4 - 2 4

Hybrid SALES-ORDER

and Related Objects

(a) Sales Order Form

and (b) Objects to Model

Sales Order Form

(a)

(b)

SALES-ORDERID SalesOrderNumber

Date

LineItemQuantity 1.1

ExtendedPrice 1.1

Subtotal 1.1

Tax 1.1

Total 1.1

SALES-ORDERID SalesOrderNumber

Date

LineItemQuantity 1.1

ExtendedPrice 1.1

Subtotal 1.1

Tax 1.1

Total 1.1

1.1

1.1

1.1

1.N

SALESPERSON

CUSTOMER

ITEM

ITEMID ItemNumber ItemDescription UnitPrice 1.1

ITEMID ItemNumber ItemDescription UnitPrice 1.1

SALES-ORDER0.N

SALESPERSONID SalesPersonNameID SalesPersonCode 1.1

SALESPERSONID SalesPersonNameID SalesPersonCode 1.1

SALES-ORDER0.N

CUSTOMERID CustomerName Address City State ZipIDPhone

CUSTOMERID CustomerName Address City State ZipIDPhone

SALES-ORDER0.N

CARBON RIVER OFFICE FURNITURESales Order Form

Sales Order Number 12990 Date 5/3/93

Customer Carbon River BookshopAddress 1145 Elm Street State ZipCity Carbon RiverPhone 232-0010

Salesperson Name Elmira Salesperson Code EZ-1

Qty114

Item Number230426902799

DescriptionExecutive DeskConference TableSide Chairs

Unit Price$199.00$345.00$ 99.00

Extended Price$199.00$345.00$396.00

SubtotalTaxTotal

$940.00$ 47.94$987.94

Page 21: Entities and Relationships Entities and Relationships Semantic Objects Semantic Objects Database Design Database Design Database Design Database Design

F I G U R E 4 - 2 5

Examples of the Four Cases of Maximum Cardinality in a Hybrid Object:

(a) ITEM in One LineItem of One ORDER, (b) ITEM in (Possibly)

Many LineItems of One Order, (c) ITEM in One LineItem of (Possibly)

Many Orders, and (d) ITEM in (Possibly) Many LineItems of

(Possibly) Many ORDERs

(a)

(b)

HYBRID OBJECTS

SALES-ORDERID SalesOrderNumber

Date

LineItemQuantity 1.1

ID

ExtendedPrice 1.1

Subtotal 1.1

Tax 1.1

Total 1.1

SALES-ORDERID SalesOrderNumber

Date

LineItemQuantity 1.1

ID

ExtendedPrice 1.1

Subtotal 1.1

Tax 1.1

Total 1.1

1.1

1.1

1.1

1.N

SALESPERSON

CUSTOMER

ITEM

SALES-ORDERID SalesOrderNumber

Date

LineItemQuantity 1.1

ExtendedPrice 1.1

Subtotal 1.1

Tax 1.1

Total 1.1

SALES-ORDERID SalesOrderNumber

Date

LineItemQuantity 1.1

ExtendedPrice 1.1

Subtotal 1.1

Tax 1.1

Total 1.1

1.1

1.1

1.1

1.N

SALESPERSON

CUSTOMER

ITEM

ITEMID ItemNumber ItemDescription UnitPrice 1.1

ITEMID ItemNumber ItemDescription UnitPrice 1.1

SALES-ORDER0.1

ITEMID ItemNumber ItemDescription UnitPrice 1.1

ITEMID ItemNumber ItemDescription UnitPrice 1.1

SALES-ORDER0.1

Page 22: Entities and Relationships Entities and Relationships Semantic Objects Semantic Objects Database Design Database Design Database Design Database Design

F I G U R E 4 - 2 5

Continued

(c)

(d)

HYBRID OBJECTS

SALES-ORDERID SalesOrderNumber

Date

LineItemQuantity 1.1

ID

ExtendedPrice 1.1

Subtotal 1.1

Tax 1.1

Total 1.1

SALES-ORDERID SalesOrderNumber

Date

LineItemQuantity 1.1

ID

ExtendedPrice 1.1

Subtotal 1.1

Tax 1.1

Total 1.1

1.1

1.1

1.1

1.N

SALESPERSON

CUSTOMER

ITEM

SALES-ORDERID SalesOrderNumber

Date

LineItemQuantity 1.1

ExtendedPrice 1.1

Subtotal 1.1

Tax 1.1

Total 1.1

SALES-ORDERID SalesOrderNumber

Date

LineItemQuantity 1.1

ExtendedPrice 1.1

Subtotal 1.1

Tax 1.1

Total 1.1

1.1

1.1

1.1

1.N

SALESPERSON

CUSTOMER

ITEM

ITEMID ItemNumber ItemDescription UnitPrice 1.1

ITEMID ItemNumber ItemDescription UnitPrice 1.1

SALES-ORDER0.N

ITEMID ItemNumber ItemDescription UnitPrice 1.1

ITEMID ItemNumber ItemDescription UnitPrice 1.1

SALES-ORDER0.N

Page 23: Entities and Relationships Entities and Relationships Semantic Objects Semantic Objects Database Design Database Design Database Design Database Design

ASSOCIATION OBJECTS

F I G U R E 4 - 2 6

Example of an Association Object: (a) Example Flight Report and Formsand (b) FLIGHT, PILOT, AIRPLANE Objects

(a)

ASSOCIATION OBJECT relates two or more objects and stores datapeculiar to that relationship.

FLY CHEAP INTERNATIONALAirplane Data Form

Tail Number: N12324FIManufacturer: BoeingType: 747-SPTotal Airframe Hours: 112,384Total Engine Hours: 57,998Engine Hours Since Overhaul: 3,212Current Capacity: 148Range as Configured: 4,200 NM

FLY CHEAP INTERNATIONALPilot Summary Data Form

FCI-ID

Name Social Security Number

Address

City City Zip

Phone Emergency Phone

Date of Last Checkout Hours

Date of Last Physical

FLIGHT NUMBER FC-17 DATE 7/30/93ORIGINATING CITY Seattle DESTINATION Hong KongFUEL ON TAKEOFF

WEIGHT ON TAKEOFF

AIRPLANETotal Number N1234FIType 747-SPCapacity 148

PILOTName Michael NilsonBase Los Angeles InternationalFI-ID 33489-ZFlight Hours 18,348

FLY CHEAP INTERNATIONALFlight Planning Data Report

Page 24: Entities and Relationships Entities and Relationships Semantic Objects Semantic Objects Database Design Database Design Database Design Database Design

FLIGHTID FlightID

FlightNumberDate

OriginatingCityDestinationFuelOnTakeOffWeightOnTakeOff

FLIGHTID FlightID

FlightNumberDate

OriginatingCityDestinationFuelOnTakeOffWeightOnTakeOff

PILOT1.1

AIRPLANE1.1

AIRPLANEID TailNumber Manufacturer Type TotalAirframeHours TotalEngineHours EngHoursPastOH CurrentCapacity RangeAsConfig

AIRPLANEID TailNumber Manufacturer Type TotalAirframeHours TotalEngineHours EngHoursPastOH CurrentCapacity RangeAsConfig

FLIGHT0.N

PILOTID FCI-IDID NameID SocialSecurityNumber

Street City State Zip

PhoneEmergPhoneDateOfLastCheckOutHoursDateOfLastPhysical

PILOTID FCI-IDID NameID SocialSecurityNumber

Street City State Zip

PhoneEmergPhoneDateOfLastCheckOutHoursDateOfLastPhysical

FLIGHT0.N

F I G U R E 4 - 2 6

Continued

ASSOCIATION OBJECTS

F I G U R E 4 - 2 7

ASSIGNMENT Association Object: (a) Example Assignment Reportand (b) Assignment Object with Semantic Object ID

(a)

(a)

(b)

Assignment StartsAssignment EndsMaximum Budgeted HoursMaximum Cost

12/15/933/15/94

345$27,500$ 5,000

Project NameProject ManagerProject StartProject End

Abernathy HouseSmith, J11/11/93

Architect AssignedPhoneOffice Number

Jackson, B.232-8878J-1133

Project Assignment Report

ASSIGNMENTID AssignmentID

AssignmentStarts AssignmentEnds MaxHours MaxLaborCost MaxMaterialCost

ASSIGNMENTID AssignmentID

AssignmentStarts AssignmentEnds MaxHours MaxLaborCost MaxMaterialCost

PROJECT

ARCHITECT1.1

1.1

PROJECTID ProjectName ProjectManager ProjectStart ProjectEnd

PROJECTID ProjectName ProjectManager ProjectStart ProjectEnd

1.N

ASSIGNMENT

ARCHITECTID Name Phone Office

ARCHITECTID Name Phone Office

1.N

ASSIGNMENT

Page 25: Entities and Relationships Entities and Relationships Semantic Objects Semantic Objects Database Design Database Design Database Design Database Design

PARENT/SUBTYPE OBJECTS

PARENT/SUBTYPE OBJECT models generalization, inheritance, and IS-A relationship

F I G U R E 4 - 2 8

Need forMANAGERSubtype: (a)EMPLOYEE WithoutSubtype and(b) EMPLOYEE withMANAGER Subtype

EMPLOYEEID EmployeeNumberID EmployeeName HireDate Salary

EMPLOYEEID EmployeeNumberID EmployeeName HireDate Salary

MANAGER0.ST

EMPLOYEEID EmployeeNumberID EmployeeName HireDate Salary

EMPLOYEEID EmployeeNumberID EmployeeName HireDate Salary

MANAGER0.ST

PROGRAMMER0.ST

((A)(b)(b)

(a)

F I G U R E 4 - 2 9

EMPLOYEE with TwoSubtype Properties

EMPLOYEEID EmployeeNumber 1.1

ID EmployeeName 1.1

HireDate Salary

ManagerTitle MgmtLevel MgmtBonusEarned MgmtBonusPaid

EMPLOYEEID EmployeeNumber 1.1

ID EmployeeName 1.1

HireDate Salary

ManagerTitle MgmtLevel MgmtBonusEarned MgmtBonusPaid

Employee Data

Manager Data

MANAGER

ManagerTitleMgmtLevelMgmtBonusEarnedMgmtBonusPaid

MANAGER

ManagerTitleMgmtLevelMgmtBonusEarnedMgmtBonusPaid

EMPLOYEEP

PROGRAMMER

Language 0.N

OperatingSystem 0.N

PROGRAMMER

Language 0.N

OperatingSystem 0.N

EMPLOYEEP

MANAGER

ManagerTitleMgmtLevelMgmtBonusEarnedMgmtBonusPaid

MANAGER

ManagerTitleMgmtLevelMgmtBonusEarnedMgmtBonusPaid

EMPLOYEEP

(a)

(b)

Page 26: Entities and Relationships Entities and Relationships Semantic Objects Semantic Objects Database Design Database Design Database Design Database Design

PARENT/SUBTYPE OBJECTS

CLIENTID ClientNumberID ClientName Phone

CLIENTID ClientNumberID ClientName Phone

0.ST

INDIVIDUAL

0.ST

PARTNERSHIP

0.ST

CORPORATION

0.1.1

F I G U R E 4 - 3 0

Exclusive (a) and Nested (b) Subtypes

(a)

(b)

INDIVIDUAL

SocSecNumberNetWorth

INDIVIDUAL

SocSecNumberNetWorth

CLIENTP

PARTNERSHIP

TaxiIDManagingPartner

PARTNERSHIP

TaxiIDManagingPartner

CLIENTP

CORPORATION

TaxiIDBalanceContactNameContactPhone

CORPORATION

TaxiIDBalanceContactNameContactPhone

CLIENTP

CORPORATION

TaxIDBalanceContactNameContactPhone

CORPORATION

TaxIDBalanceContactNameContactPhone

0.ST

NONTAXABLE CORP0.ST

TAXABLE CORP

1.1.1

CLIENTP

TAXABLE CORP

TaxRate

TAXABLE CORP

TaxRate

CORPORATIONP

NONTAXABLE CORP

ExemptionID

NONTAXABLE CORP

ExemptionID

0.ST

SCHOOL0.ST

GOV-AGENCY

1.1.1

CORPORATIONP

GOV-AGENCY

FederalIDNumber

GOV-AGENCY

FederalIDNumberNONTAXABLE CORPP

SCHOOL

SchoolDistrictName

SCHOOL

SchoolDistrictName

NONTAXABLE CORPP

Page 27: Entities and Relationships Entities and Relationships Semantic Objects Semantic Objects Database Design Database Design Database Design Database Design

ARCHETYPE/VERSION OBJECTS

ARCHETYPE/VERSION OBJECT is an object which produces otherobjects representing versions, releases, or editions of the archetype.

TEXTBOOKID ISBN

TitleAuthorPublisher

TEXTBOOKID ISBN

TitleAuthorPublisher

1.N

EDITION

BUILDINGID Name

AddressStreetCityStateZip

NumberOfStories

BUILDINGID Name

AddressStreetCityStateZip

NumberOfStories

1.N

APARTMENT

1.1

F I G U R E 4 - 3 1

Example of an Archetype/Version Object

F I G U R E 4 - 3 2

Another example of an Archetype/Version Object

EDITIONID EditionID

EditionNumber 1.1

PublicationDateNumberOfPages

EDITIONID EditionID

EditionNumber 1.1

PublicationDateNumberOfPages

1.1

1.1

TEXTBOOK

APARTMENTID ApartmentID

ApartmentNumber1.1

NumberOfBedroomsSquareFeet

APARTMENTID ApartmentID

ApartmentNumber1.1

NumberOfBedroomsSquareFeet

1.1

1.1

BUILDING

Page 28: Entities and Relationships Entities and Relationships Semantic Objects Semantic Objects Database Design Database Design Database Design Database Design

COUNTERPARTS OF E-R AND SOM DATA MODELS

ARTIFACT E-RREPRESENTATION

SOMREPRESENTATION

Noun, Thing, Identity

Instance of Noun, Thing,Identity

Characteristic of Noun,Thing, Identity

Kinds of Attributes

Relationship

Types of Relationships

Cardinality

Generalization,Inheritance, IS-A

Entity

Entity Instance

Attribute

Simple, Identifier

Relationship

Binary, N-ary (N>2)

Minimum,Maximum

Subtype Entity

Object Class

Object

Attribute

Simple, Identifier, Group,Object

Object Attribute

Object Attribute,Association Object

Minimum, Maximum

Parent/Subtype Object

Page 29: Entities and Relationships Entities and Relationships Semantic Objects Semantic Objects Database Design Database Design Database Design Database Design

E-R VS SEMANTIC OBJECT MODEL

F I G U R E 4 - 3 4

Entity Relationship Model ofSALES-ORDER and CUSTOMER

F I G U R E 4 - 3 3

SALES-ORDER and Related Semantic Objects

CUSTOMERID CustomerNumber CustomerName Address Street City State Zip

CUSTOMERID CustomerNumber CustomerName Address Street City State Zip

0.N

1.1

SALES-ORDER

ITEMID ItemNumber Name Description

ITEMID ItemNumber Name Description

0.N

SALES-ORDER

ENTITIES VS OBJECTS: Objects are more self-contained.Objects are more “modern”.

ITEM

SALES-ORDER

CUSTOMER SALESPERSON

1:N

1:N N:1

LINEITEM

1:N

SALE-ORDERID OrderNumber

Date

LineItemQuantity

ID

ExtendedPriceSubtotalTaxTotal

SALE-ORDERID OrderNumber

Date

LineItemQuantity

ID

ExtendedPriceSubtotalTaxTotal

1.1

CUSTOMER

1.N

SALESPERSON

ITEM

1.1

SALESPERSONSalespersonName

ID SalespersonCode

SALESPERSONSalespersonName

ID SalespersonCode

0.N

SALES-ORDER