35
1 . Ching, Ph.D. • MIS • California State University, Sacramento Week 9 Week 9 October 24 October 24 Modeling with ERD Modeling with ERD

Week 9 October 24

  • Upload
    khoi

  • View
    27

  • Download
    0

Embed Size (px)

DESCRIPTION

Week 9 October 24. Modeling with ERD. Entity Relationship (ER) Model (applies to relational data model). High-level conceptual model Describes the structure of the database, and the associated retrieval and update transactions on the database Composed of Entity types Relationship types - PowerPoint PPT Presentation

Citation preview

Page 1: Week 9 October 24

1

R. Ching, Ph.D. • MIS • California State University, Sacramento

Week 9Week 9October 24October 24

• Modeling with ERDModeling with ERD

Page 2: Week 9 October 24

2

R. Ching, Ph.D. • MIS • California State University, Sacramento

Entity Relationship (ER) ModelEntity Relationship (ER) Model(applies to relational data model)(applies to relational data model)

• High-level conceptual model High-level conceptual model

– Describes the structure of the database, and the Describes the structure of the database, and the associated retrieval and update transactions on the associated retrieval and update transactions on the databasedatabase

– Composed of Composed of

• Entity types Entity types

• Relationship typesRelationship types

• AttributesAttributes

Page 3: Week 9 October 24

3

R. Ching, Ph.D. • MIS • California State University, Sacramento

ERD NotationERD Notation

Music_categoriesMusic_categories

music_category_code {PK}music_category_code {PK}music_category_titlemusic_category_title

CDsCDs

stock_number {PK}stock_number {PK}CD_titleCD_titleartistartistmusic_category_code music_category_code record_label_coderecord_label_code

Entity typeEntity typePrimary keyPrimary key

AttributesAttributes

Relationship nameRelationship name

ClassifyClassify

1..11..1 0..*0..*

Relationship typeRelationship type

Degree of the Relationship: BinaryDegree of the Relationship: Binary

Multiplicity (constraint)Multiplicity (constraint)

Page 4: Week 9 October 24

4

R. Ching, Ph.D. • MIS • California State University, Sacramento

ERD NotationERD NotationAlternativelyAlternatively

Music_categoriesMusic_categories

Music_category_codeMusic_category_codeMusic_category_titleMusic_category_title

CDsCDs

Stock_numberStock_numberCD_titleCD_titleArtistArtistMusic_category_code Music_category_code Record_label_codeRecord_label_code

ClassifyClassify

Entity typeEntity typePrimary key (underscored)Primary key (underscored)

AttributesAttributes

Relationship typeRelationship type

Relationship nameRelationship name

ManyMany(crows feet)(crows feet)

CardinalityCardinality

ZeroZero(circle)(circle)

MinimumMinimum(inside)(inside)MaximumMaximum

(outside)(outside)

Page 5: Week 9 October 24

5

R. Ching, Ph.D. • MIS • California State University, Sacramento

ERDERD

• Entity type – A group of objects with the same properties, Entity type – A group of objects with the same properties, which are identified by the enterprise as having an which are identified by the enterprise as having an independent existenceindependent existence

• Relationship type – A set of meaningful associations Relationship type – A set of meaningful associations among entity typesamong entity types

• Attributes – A property of an entity or a relationship typeAttributes – A property of an entity or a relationship type

Page 6: Week 9 October 24

6

R. Ching, Ph.D. • MIS • California State University, Sacramento

Degree of Relationship TypeDegree of Relationship Type

• The number of participating entity types in a relationshipThe number of participating entity types in a relationship• Binary (two entity types)Binary (two entity types)

• Ternary (three entity types)Ternary (three entity types)

EmployeeEmployee Employee AwardsEmployee AwardsReceivesReceives

1..11..1 0..10..1

EmployeeEmployee Emp_BenefitsEmp_Benefits

Emp_TaxEmp_Tax

Net payNet pay

ReceivesReceives

Attribute of a relationship typeAttribute of a relationship type

Page 7: Week 9 October 24

7

R. Ching, Ph.D. • MIS • California State University, Sacramento

Recursive RelationshipRecursive Relationship

• A relationship type where the same entity participates A relationship type where the same entity participates more tan once in different rolesmore tan once in different roles

EmployeeEmployee

ManagesManages

ManagerManager

StaffStaff

A manager is an employeeA manager is an employee

Managers and staff are employees.Managers and staff are employees.

Staff are managed Staff are managed by managersby managers

1..*1..*

0..*0..*

Role name indicates the purpose an Role name indicates the purpose an entity type plays in a relationship typeentity type plays in a relationship type

Page 8: Week 9 October 24

8

R. Ching, Ph.D. • MIS • California State University, Sacramento

AttributesAttributes

Property of an entity or relationship typeProperty of an entity or relationship type

• Attribute domainAttribute domain

– Set of values that may be assigned to a single-valued Set of values that may be assigned to a single-valued attributeattribute

Cust_account Cust_name Cust_address Cust_phone Soc_Sec_NumCust_account Cust_name Cust_address Cust_phone Soc_Sec_NumCust_account Cust_name Cust_address Cust_phone Soc_Sec_NumCust_account Cust_name Cust_address Cust_phone Soc_Sec_Num

CustomersCustomers

Cust_account Current_balance Credit_limit Active_date Expire_dateCust_account Current_balance Credit_limit Active_date Expire_dateCust_account Current_balance Credit_limit Active_date Expire_dateCust_account Current_balance Credit_limit Active_date Expire_date

Customer_AccountsCustomer_Accounts

Page 9: Week 9 October 24

9

R. Ching, Ph.D. • MIS • California State University, Sacramento

Attributes of AttributesAttributes of Attributes

• Simple (atomic attributes) - composed of a single Simple (atomic attributes) - composed of a single componentcomponent

• Composite - composed of multiple componentsComposite - composed of multiple components• Single valued - one value for an entitySingle valued - one value for an entity• Multi-valued - one or more values for an entityMulti-valued - one or more values for an entity• Derived - value derived from a related attribute or set of Derived - value derived from a related attribute or set of

attributesattributes

Student_ID Semester Course_IDStudent_ID Semester Course_IDStudent_ID Semester Course_IDStudent_ID Semester Course_ID

Student_ID FName MName LNameStudent_ID FName MName LNameStudent_ID FName MName LNameStudent_ID FName MName LName

Multi-valuedMulti-valued

Single-valuedSingle-valued

More than one More than one semestersemester, more than one , more than one course_idcourse_id

Page 10: Week 9 October 24

10

R. Ching, Ph.D. • MIS • California State University, Sacramento

Attribute DomainAttribute Domain

Cust_account Cust_name Cust_address Cust_phone Soc_Sec_NumCust_account Cust_name Cust_address Cust_phone Soc_Sec_NumCust_account Cust_name Cust_address Cust_phone Soc_Sec_NumCust_account Cust_name Cust_address Cust_phone Soc_Sec_Num

CustomersCustomers

JohnJohnWilliamWilliamAnitaAnitaHomerHomer

BrownBrownTellTellBreakeBreakeSimpsonSimpson

• On an ER model, On an ER model, should customer should customer name be shown as a name be shown as a composite or simple composite or simple attribute? attribute?

• What is the attribute What is the attribute domain of domain of Cus_name?Cus_name?

Cust_first_nameCust_first_nameCust_first_nameCust_first_name Cust_last_nameCust_last_nameCust_last_nameCust_last_name

CompositeComposite

Page 11: Week 9 October 24

11

R. Ching, Ph.D. • MIS • California State University, Sacramento

Derived AttributesDerived Attributes

• Derived - value derived from a related attribute or set of Derived - value derived from a related attribute or set of attributesattributes

Units Units xx Grade = Grade point Grade = Grade point

Student_ID Semester Course_ID Units Grade Grade_pointStudent_ID Semester Course_ID Units Grade Grade_pointStudent_ID Semester Course_ID Units Grade Grade_pointStudent_ID Semester Course_ID Units Grade Grade_pointStudent_ID Semester Course_ID Units Grade Grade_pointStudent_ID Semester Course_ID Units Grade Grade_pointStudent_ID Semester Course_ID Units Grade Grade_pointStudent_ID Semester Course_ID Units Grade Grade_point

Student_ID Semester Course_ID Units Grade Grade_pointStudent_ID Semester Course_ID Units Grade Grade_pointStudent_ID Semester Course_ID Units Grade Grade_pointStudent_ID Semester Course_ID Units Grade Grade_point

Derived attributeDerived attribute

Page 12: Week 9 October 24

12

R. Ching, Ph.D. • MIS • California State University, Sacramento

Attributes as KeysAttributes as Keys

Primary keyPrimary keyPrimary keyPrimary key

Candidate keyCandidate keyCandidate keyCandidate key

• Alternate key - candidate that can also be used to access Alternate key - candidate that can also be used to access an entityan entity

• Composite key - composed of multiple attributes Composite key - composed of multiple attributes (components)(components)

Uniquely identifies an entityUniquely identifies an entity

• Keys cannot change their values Keys cannot change their values (good for the life of the entity)(good for the life of the entity)

• An An efficientefficient means for identifying means for identifying an entityan entity

Page 13: Week 9 October 24

13

R. Ching, Ph.D. • MIS • California State University, Sacramento

Attribute Diagrammatic RepresentationAttribute Diagrammatic Representation

Composite attributeComposite attribute

CustomersCustomers

Cust_account {PK}Cust_account {PK}Cust_nameCust_name First_nameFirst_name Middle_nameMiddle_name Last_nameLast_nameCust_addressCust_address Street_numberStreet_number Zip_code (fk)Zip_code (fk)Cust_phoneCust_phoneSoc_sec_numSoc_sec_num

CustomersCustomers

Cust_account {PK}Cust_account {PK}Cust_nameCust_name First_nameFirst_name Middle_nameMiddle_name Last_nameLast_nameCust_addressCust_address Street_numberStreet_number Zip_code (fk)Zip_code (fk)Cust_phoneCust_phoneSoc_sec_numSoc_sec_num

Composite attributeComposite attribute

KeyKey

Foreign keyForeign key

Page 14: Week 9 October 24

14

R. Ching, Ph.D. • MIS • California State University, Sacramento

Attribute Diagrammatic RepresentationAttribute Diagrammatic Representation

Composite keyComposite key

Customer_PurchasesCustomer_Purchases

Cust_account {PK}Cust_account {PK}Transaction_number {PK}Transaction_number {PK}DateDateStore_numberStore_numberPayment_typePayment_type

Customer_PurchasesCustomer_Purchases

Cust_account {PK}Cust_account {PK}Transaction_number {PK}Transaction_number {PK}DateDateStore_numberStore_numberPayment_typePayment_type

Foreign keyForeign key

A customer may have more than one purchaseA customer may have more than one purchase

Foreign keyForeign key

Page 15: Week 9 October 24

15

R. Ching, Ph.D. • MIS • California State University, Sacramento

Strong vs. Weak Entity TypesStrong vs. Weak Entity Types

• Strong Entity Type – An entity type that is not existence-Strong Entity Type – An entity type that is not existence-dependent on some other entity typedependent on some other entity type

– Often referred to as Often referred to as parentparent, , ownerowner or or dominantdominant entities entities

• Weak Entity Type – An entity type that is existence-Weak Entity Type – An entity type that is existence-dependent on some other entity type.dependent on some other entity type.

– Often referred to as Often referred to as childchild, , dependentdependent or or subordinate subordinate entities entities

Page 16: Week 9 October 24

16

R. Ching, Ph.D. • MIS • California State University, Sacramento

Definition of a Weak Entity TypeDefinition of a Weak Entity Type

“ “An entity type that borrows all or part of its primary key. An entity type that borrows all or part of its primary key. Identifying relationships indicate the entity types that Identifying relationships indicate the entity types that supply components of the borrowed primary key.”supply components of the borrowed primary key.”

Mannino, 1999Mannino, 1999

Page 17: Week 9 October 24

17

R. Ching, Ph.D. • MIS • California State University, Sacramento

Strong vs. Weak Entity TypesStrong vs. Weak Entity Types

Customer_accountsCustomer_accounts

AccountNumber {PK}AccountNumber {PK}FirstNameFirstNameMiddleNameMiddleNameLastNameLastNameAddressAddressZipCodeZipCodeMembershipDateMembershipDate

Customer_PurchasesCustomer_Purchases

AccountNumber {PK}AccountNumber {PK}StoreNumber {PK}StoreNumber {PK}TransactionDate {PK}TransactionDate {PK}TransactionNumber {PK}TransactionNumber {PK}PaymentTypePaymentType

PurchasePurchase

1..11..1 0..*0..*

Which is the strong and weak entity type?Which is the strong and weak entity type?How can you tell?How can you tell?

Page 18: Week 9 October 24

18

R. Ching, Ph.D. • MIS • California State University, Sacramento

Strong vs. Weak Entity TypesStrong vs. Weak Entity Types

Customer_accountsCustomer_accounts

AccountNumber {PK}AccountNumber {PK}FirstNameFirstNameMiddleNameMiddleNameLastNameLastNameAddressAddressZipCodeZipCodeMembershipDateMembershipDate

Customer_PurchasesCustomer_Purchases

AccountNumber {PK}AccountNumber {PK}StoreNumber {PK}StoreNumber {PK}TransactionDate {PK}TransactionDate {PK}TransactionNumber {PK}TransactionNumber {PK}PaymentTypePaymentType

PurchasePurchase

1..11..1 0..*0..*

Which is the strong and weak entity type?Which is the strong and weak entity type?How can you tell?How can you tell?

Existent-dependenceExistent-dependence Also a FKAlso a FK

Page 19: Week 9 October 24

19

R. Ching, Ph.D. • MIS • California State University, Sacramento

Attributes of Relationship TypesAttributes of Relationship Types

• Attributes produced through relationship types (i.e., not Attributes produced through relationship types (i.e., not retained in the entity types)retained in the entity types)

CustomerAccountsCustomerAccounts

AccountNumberAccountNumber……

CustomerFlightsCustomerFlights

AccountNumber {PK}AccountNumber {PK}TransactionDate {PK}TransactionDate {PK}IntineraryNumber {PK}IntineraryNumber {PK}……

ReserveReserve1..11..1 0..*0..*

NumberOfItinerariesNumberOfItineraries Derived attributeDerived attribute

Page 20: Week 9 October 24

20

R. Ching, Ph.D. • MIS • California State University, Sacramento

Structural ConstraintsStructural Constraints

• Multiplicity – Number of possible occurences of an entity Multiplicity – Number of possible occurences of an entity type that may relate to a single occurrence of an associated type that may relate to a single occurrence of an associated entity type through a particular relationship typeentity type through a particular relationship type

– One to one (1:1)One to one (1:1)

– One to many (1:*)One to many (1:*)

– Many to many (*:*)Many to many (*:*)

• Cardinality and participation constraintsCardinality and participation constraints

– Cardinality – Describes the maximum number of Cardinality – Describes the maximum number of possible relationship occurrences for an entity possible relationship occurrences for an entity participating in a given relationship typeparticipating in a given relationship type

Defined by business rulesDefined by business rules

Page 21: Week 9 October 24

21

R. Ching, Ph.D. • MIS • California State University, Sacramento

Cardinality and Participation ConstraintsCardinality and Participation Constraints

• Cardinality – Describes the maximum number of Cardinality – Describes the maximum number of possiblepossible relationship occurrences for relationship occurrences for anan entity participating in a entity participating in a given relationship typegiven relationship type

• Participation – Determines whether all or only some entity Participation – Determines whether all or only some entity occurrences participate in a relationshipoccurrences participate in a relationship

– 1:1 (1..1) minimum is one – mandatory participation1:1 (1..1) minimum is one – mandatory participation

– 0:1 (0..1) minimum is zero – optional participation0:1 (0..1) minimum is zero – optional participation

Page 22: Week 9 October 24

22

R. Ching, Ph.D. • MIS • California State University, Sacramento

CardinalityCardinality

• 1:1 (1:1 (one to oneone to one))– Each entity in Each entity in XX is associated with at most one entity in is associated with at most one entity in YY

and conversely each entity in and conversely each entity in YY is associated with at most is associated with at most one entity in one entity in XX

• 1:* (1:* (one to manyone to many))– Each entity in Each entity in XX can be associated with many entities in Y can be associated with many entities in Y

but each entity in but each entity in YY is associated with is associated with at mostat most one entity one entity in in XX..

• *:* (many to many)*:* (many to many)– Each entity in Each entity in XX can be associated with many entities in can be associated with many entities in YY

and each entity in and each entity in YY can be associated with many entities can be associated with many entities in in XX..

Page 23: Week 9 October 24

23

R. Ching, Ph.D. • MIS • California State University, Sacramento

CardinalityCardinality

CustomersCustomers

Customer_ID {PK}Customer_ID {PK}Customer_nameCustomer_nameCustomer_addressCustomer_addressZip_codeZip_code

OwnOwn

A customer owns a A customer owns a minimum and maximum minimum and maximum of of oneone account account

AccountsAccounts

Account_number {PK}Account_number {PK}Customer_ID {FK}Customer_ID {FK}Account_typeAccount_typeCurrent_balanceCurrent_balance

An account is owned An account is owned by a minimum and by a minimum and maximum of maximum of oneone customercustomer

1:1 Relationships1:1 RelationshipsStrong entity typeStrong entity type Weak entity typeWeak entity type

Mandatory Mandatory participationparticipation

NoteNote. This would be avoided in the logical design, but could be implemented in . This would be avoided in the logical design, but could be implemented in the physical.the physical.

1..11..1 1..11..1

Page 24: Week 9 October 24

24

R. Ching, Ph.D. • MIS • California State University, Sacramento

CardinalityCardinality

CustomersCustomers

Customer_ID {PK}Customer_ID {PK}Customer_nameCustomer_nameCustomer_addressCustomer_addressZip_codeZip_code

OwnOwn

A customer owns a A customer owns a minimum one and minimum one and maximum of many maximum of many accountsaccounts

AccountsAccounts

Account_number {PK}Account_number {PK}Customer_ID {FK}Customer_ID {FK}Account_typeAccount_typeCurrent_balanceCurrent_balance

1:M Relationships1:M RelationshipsStrong entity typeStrong entity type Weak entity typeWeak entity type

Mandatory Mandatory participationparticipation

An account is own by a An account is own by a minimum and maximum minimum and maximum of one customerof one customer

1..11..1 1..*1..*

Page 25: Week 9 October 24

25

R. Ching, Ph.D. • MIS • California State University, Sacramento

CardinalityCardinality

• *:* (many-to-many) relationship if a customer can own *:* (many-to-many) relationship if a customer can own more than one account (e.g., revolving, long-term), and more than one account (e.g., revolving, long-term), and one account can have more than one owner (e.g., joint one account can have more than one owner (e.g., joint account).account).

CustomersCustomers

Customer_ID {PK}Customer_ID {PK}Customer_nameCustomer_nameCustomer_addressCustomer_addressZip_codeZip_code

OwnOwn

A customer owns a A customer owns a minimum one and minimum one and maximum of many maximum of many accountsaccounts

AccountsAccounts

Account_number {PK}Account_number {PK}Customer_ID {FK}Customer_ID {FK}Account_typeAccount_typeCurrent_balanceCurrent_balance

An account is own by a An account is own by a minimum of one minimum of one customer and maximum customer and maximum of many customersof many customers

1..*1..* 1..*1..*

Page 26: Week 9 October 24

26

R. Ching, Ph.D. • MIS • California State University, Sacramento

ERD NotationERD Notation

Video_categoriesVideo_categories

Category_code {PK}Category_code {PK}Category_titleCategory_title

VideosVideos

Stock_number {PK}Stock_number {PK}Video_titleVideo_title……Category_code {FK}Category_code {FK}Distributor_code {FK}Distributor_code {FK}

ClassifyClassify

Entity typeEntity typePrimary keyPrimary key

AttributesAttributes

Relationship typeRelationship type

Relationship nameRelationship name

ManyManyCardinalityCardinality ZeroZeroMinimumMinimum

MaximumMaximum

1..11..1 0..*0..*

For an occurrence of videos, For an occurrence of videos, there may exist one and only there may exist one and only one video category.one video category.

For an occurrence of video For an occurrence of video categories, there may exist categories, there may exist zero to many videos.zero to many videos.

Page 27: Week 9 October 24

27

R. Ching, Ph.D. • MIS • California State University, Sacramento

ERD NotationERD Notation

Video_categoriesVideo_categories

Category_code {PK}Category_code {PK}Category_titleCategory_title

VideosVideos

Stock_number {PK}Stock_number {PK}Video_titleVideo_title……Category_code {FK}Category_code {FK}Distributor_code {FK}Distributor_code {FK}

ClassifyClassify

1..11..1 0..*0..*

DistributorsDistributors

Distributor_code {PK}Distributor_code {PK}Distributor_nameDistributor_name

0..*0..*

1..11..1

ReleaseRelease

Video categories classify videosVideo categories classify videos

Distributors release videosDistributors release videos

For an occurrence of distributors, For an occurrence of distributors, there are zero to many videosthere are zero to many videosFor an occurrence of distributors, For an occurrence of distributors, there are zero to many videosthere are zero to many videos

Page 28: Week 9 October 24

28

R. Ching, Ph.D. • MIS • California State University, Sacramento

ERD NotationERD Notation

Video_categoriesVideo_categories

Category_code {PK}Category_code {PK}Category_titleCategory_title

VideosVideos

Stock_number {PK}Stock_number {PK}Video_titleVideo_title……Category_code {FK}Category_code {FK}Distributor_code {FK}Distributor_code {FK}

ClassifyClassify

1..11..1 0..*0..*

DistributorsDistributors

Distributor_code {PK}Distributor_code {PK}Distributor_nameDistributor_name

0..*0..*

1..11..1

ReleaseRelease

Video categories classify videosVideo categories classify videos

Distributors release videosDistributors release videos

For an occurrence of videos, there is For an occurrence of videos, there is one and only one video categoryone and only one video categoryFor an occurrence of videos, there is For an occurrence of videos, there is one and only one video categoryone and only one video category

Page 29: Week 9 October 24

29

R. Ching, Ph.D. • MIS • California State University, Sacramento

ERD NotationERD Notation

Video_categoriesVideo_categories

Category_code {PK}Category_code {PK}Category_titleCategory_title

VideosVideos

Stock_number {PK}Stock_number {PK}Video_titleVideo_title……Category_code {FK}Category_code {FK}Distributor_code {FK}Distributor_code {FK}

ClassifyClassify

1..11..1 0..*0..*

DistributorsDistributors

Distributor_code {PK}Distributor_code {PK}Distributor_nameDistributor_name

0..*0..*

1..11..1

ReleaseReleaseAttribute of the Attribute of the relationship typerelationship type

Number_of_videos_Number_of_videos_releasedreleased

Page 30: Week 9 October 24

30

R. Ching, Ph.D. • MIS • California State University, Sacramento

ERD NotationERD NotationAlternate NotationAlternate Notation

Music_categoriesMusic_categories

Music_category_codeMusic_category_codeMusic_category_titleMusic_category_title

CDsCDs

Stock_numberStock_numberCD_titleCD_titleArtistArtistMusic_category_code Music_category_code Record_label_codeRecord_label_code

ClassifyClassify

Entity typeEntity typePrimary key (underscored)Primary key (underscored)

AttributesAttributes

Relationship typeRelationship type

Relationship nameRelationship name

ManyMany(crows feet)(crows feet)

CardinalityCardinality

ZeroZero(circle)(circle)

MinimumMinimum(inside)(inside)MaximumMaximum

(outside)(outside)

Page 31: Week 9 October 24

31

R. Ching, Ph.D. • MIS • California State University, Sacramento

ERD NotationERD NotationAlternate NotationAlternate Notation

Music_categoriesMusic_categories

Music_category_codeMusic_category_codeMusic_category_titleMusic_category_title

CDsCDs

Stock_numberStock_numberCD_titleCD_titleArtistArtistMusic_category_code Music_category_code Record_label_codeRecord_label_code

ClassifyClassify

Entity typeEntity type

Weak entity typeWeak entity type(all four corners)(all four corners)

Minimum cardinality of oneMinimum cardinality of one((a music category has to have at least one CDa music category has to have at least one CD))

Page 32: Week 9 October 24

32

R. Ching, Ph.D. • MIS • California State University, Sacramento

ERD NotationERD Notation Alternative NotationAlternative Notation

Music_categoriesMusic_categories

Music_category_codeMusic_category_codeMusic_category_titleMusic_category_title

CDsCDs

Stock_numberStock_numberCD_titleCD_titleArtistArtistMusic_category_code Music_category_code Record_label_codeRecord_label_code

ClassifyClassify

Record_label_codeRecord_label_codeRecord_labelRecord_label

Record_labelsRecord_labels

ProduceProduce

A record label is related to A record label is related to a minimum of zero and a minimum of zero and maximum of many CDsmaximum of many CDs

A record label is related to A record label is related to a minimum of zero and a minimum of zero and maximum of many CDsmaximum of many CDs

Page 33: Week 9 October 24

33

R. Ching, Ph.D. • MIS • California State University, Sacramento

ERD NotationERD Notation Alternative NotationAlternative Notation

Music_categoriesMusic_categories

Music_category_codeMusic_category_codeMusic_category_titleMusic_category_title

CDsCDs

Stock_numberStock_numberCD_titleCD_titleArtistArtistMusic_category_code Music_category_code Record_label_codeRecord_label_code

ClassifyClassify

Record_label_codeRecord_label_codeRecord_labelRecord_label

Record_labelsRecord_labels

ProduceProduceA CD is related to a A CD is related to a minimum and maximum of minimum and maximum of one record labelone record label

A CD is related to a A CD is related to a minimum and maximum of minimum and maximum of one record labelone record label

Page 34: Week 9 October 24

34

R. Ching, Ph.D. • MIS • California State University, Sacramento

ERD NotationERD NotationAlternative NotationAlternative Notation

Music_categoriesMusic_categories

Music_category_codeMusic_category_codeMusic_category_titleMusic_category_title

CDsCDs

Stock_numberStock_numberCD_titleCD_titleArtistArtistMusic_category_code Music_category_code Record_label_codeRecord_label_code

ClassifyClassify

Record_label_codeRecord_label_codeRecord_labelRecord_label

Record_labelsRecord_labels

ProduceProduceQuantity_producedQuantity_produced

Attribute of a relationshipAttribute of a relationship

Page 35: Week 9 October 24

35

R. Ching, Ph.D. • MIS • California State University, Sacramento