conceptual database design - university at buffalochomicki/560/main-er.pdf · jan chomicki...

92
Conceptual Database Design Jan Chomicki University at Buffalo University at Buffalo Jan Chomicki (University at Buffalo) Conceptual database design 1 / 30

Upload: others

Post on 09-Jul-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Conceptual Database Design

Jan ChomickiUniversity at Buffalo

University at Buffalo

Jan Chomicki (University at Buffalo) Conceptual database design 1 / 30

Page 2: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Outline

1 Entity-Relationship Data Model

2 Mapping E-R schemas to relations

3 Description logics

Jan Chomicki (University at Buffalo) Conceptual database design 2 / 30

Page 3: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Entity-Relationship (E-R) Data Model

Proposed by Peter Chen in 1976.

Featuresused for the description of the conceptual schema of the database

not used for database implementation

formal notation

close to natural language

Can be mapped to various data models

relational

object-oriented, object-relational

XML

description logics

Jan Chomicki (University at Buffalo) Conceptual database design 3 / 30

Page 4: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Entity-Relationship (E-R) Data Model

Proposed by Peter Chen in 1976.

Featuresused for the description of the conceptual schema of the database

not used for database implementation

formal notation

close to natural language

Can be mapped to various data models

relational

object-oriented, object-relational

XML

description logics

Jan Chomicki (University at Buffalo) Conceptual database design 3 / 30

Page 5: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Entity-Relationship (E-R) Data Model

Proposed by Peter Chen in 1976.

Featuresused for the description of the conceptual schema of the database

not used for database implementation

formal notation

close to natural language

Can be mapped to various data models

relational

object-oriented, object-relational

XML

description logics

Jan Chomicki (University at Buffalo) Conceptual database design 3 / 30

Page 6: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Basic ER model concepts

Schema level Instance level

Domain Domain element (value)

Entity type Entity

Relationship type Relationship (instance)

Cardinality constraints Valid relationships

Attribute Attribute value

Key Unique key value

Jan Chomicki (University at Buffalo) Conceptual database design 4 / 30

Page 7: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Entities

Entity

Something that exists and can bedistinguished from other entities.

Examples

A person, an account, a course.

Entity type

A set of entities with similarproperties. Entity types canoverlap.

Examples

Persons, employees, Citibankaccounts, UB courses.

Entity type extension

The set of entities of a given typein a given database instance.

Notationentities: e1, e2, . . .

“entity e is of type T”:T (e).

Jan Chomicki (University at Buffalo) Conceptual database design 5 / 30

Page 8: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Entities

Entity

Something that exists and can bedistinguished from other entities.

Examples

A person, an account, a course.

Entity type

A set of entities with similarproperties. Entity types canoverlap.

Examples

Persons, employees, Citibankaccounts, UB courses.

Entity type extension

The set of entities of a given typein a given database instance.

Notationentities: e1, e2, . . .

“entity e is of type T”:T (e).

Jan Chomicki (University at Buffalo) Conceptual database design 5 / 30

Page 9: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Entities

Entity

Something that exists and can bedistinguished from other entities.

Examples

A person, an account, a course.

Entity type

A set of entities with similarproperties. Entity types canoverlap.

Examples

Persons, employees, Citibankaccounts, UB courses.

Entity type extension

The set of entities of a given typein a given database instance.

Notationentities: e1, e2, . . .

“entity e is of type T”:T (e).

Jan Chomicki (University at Buffalo) Conceptual database design 5 / 30

Page 10: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Entities

Entity

Something that exists and can bedistinguished from other entities.

Examples

A person, an account, a course.

Entity type

A set of entities with similarproperties. Entity types canoverlap.

Examples

Persons, employees, Citibankaccounts, UB courses.

Entity type extension

The set of entities of a given typein a given database instance.

Notationentities: e1, e2, . . .

“entity e is of type T”:T (e).

Jan Chomicki (University at Buffalo) Conceptual database design 5 / 30

Page 11: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Entities

Entity

Something that exists and can bedistinguished from other entities.

Examples

A person, an account, a course.

Entity type

A set of entities with similarproperties. Entity types canoverlap.

Examples

Persons, employees, Citibankaccounts, UB courses.

Entity type extension

The set of entities of a given typein a given database instance.

Notationentities: e1, e2, . . .

“entity e is of type T”:T (e).

Jan Chomicki (University at Buffalo) Conceptual database design 5 / 30

Page 12: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Attributes

DomainA predefined set of primitive,atomic values (entity types arenot domains!).

Examples

Integers, character strings,decimals.

Attribute

A (partial) function from anentity type to a domain,representing a property of theentities of that type.

Examples

Name : Person → StringBalance : Account → Decimal

Notation

A(e): “the value of theattribute A for the entity e”.

Example

Name(e1)=’Brown’

Jan Chomicki (University at Buffalo) Conceptual database design 6 / 30

Page 13: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Attributes

DomainA predefined set of primitive,atomic values (entity types arenot domains!).

Examples

Integers, character strings,decimals.

Attribute

A (partial) function from anentity type to a domain,representing a property of theentities of that type.

Examples

Name : Person → StringBalance : Account → Decimal

Notation

A(e): “the value of theattribute A for the entity e”.

Example

Name(e1)=’Brown’

Jan Chomicki (University at Buffalo) Conceptual database design 6 / 30

Page 14: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Attributes

DomainA predefined set of primitive,atomic values (entity types arenot domains!).

Examples

Integers, character strings,decimals.

Attribute

A (partial) function from anentity type to a domain,representing a property of theentities of that type.

Examples

Name : Person → StringBalance : Account → Decimal

Notation

A(e): “the value of theattribute A for the entity e”.

Example

Name(e1)=’Brown’

Jan Chomicki (University at Buffalo) Conceptual database design 6 / 30

Page 15: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Attributes

DomainA predefined set of primitive,atomic values (entity types arenot domains!).

Examples

Integers, character strings,decimals.

Attribute

A (partial) function from anentity type to a domain,representing a property of theentities of that type.

Examples

Name : Person → StringBalance : Account → Decimal

Notation

A(e): “the value of theattribute A for the entity e”.

Example

Name(e1)=’Brown’

Jan Chomicki (University at Buffalo) Conceptual database design 6 / 30

Page 16: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Keys

Key

A (minimal) set of attributes that uniquely identifies every entity in an entity type.

Examples

Entity type Key

Americans SSN

ATT accounts Phone number

NY vehicles License plate number

US vehicles (License plate number,State)

an entity type can have multiple keys

one key is selected as the primary key.

Jan Chomicki (University at Buffalo) Conceptual database design 7 / 30

Page 17: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Keys

Key

A (minimal) set of attributes that uniquely identifies every entity in an entity type.

Examples

Entity type Key

Americans SSN

ATT accounts Phone number

NY vehicles License plate number

US vehicles (License plate number,State)

an entity type can have multiple keys

one key is selected as the primary key.

Jan Chomicki (University at Buffalo) Conceptual database design 7 / 30

Page 18: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Keys

Key

A (minimal) set of attributes that uniquely identifies every entity in an entity type.

Examples

Entity type Key

Americans SSN

ATT accounts Phone number

NY vehicles License plate number

US vehicles (License plate number,State)

an entity type can have multiple keys

one key is selected as the primary key.

Jan Chomicki (University at Buffalo) Conceptual database design 7 / 30

Page 19: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Keys

Key

A (minimal) set of attributes that uniquely identifies every entity in an entity type.

Examples

Entity type Key

Americans SSN

ATT accounts Phone number

NY vehicles License plate number

US vehicles (License plate number,State)

an entity type can have multiple keys

one key is selected as the primary key.

Jan Chomicki (University at Buffalo) Conceptual database design 7 / 30

Page 20: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Relationships

Relationship type ofarity k

A subset of the Cartesianproduct of some entitytypes E1, . . . ,Ek ,representing an associationbetween the entity types.Relationship types canhave attributes.

Examples

Teaches(Employee,Class)Sells(Vendor,Customer,Product)Parent(Person,Person)

Relationship instance of aritykA k-tuple of entities of theappropriate types.

Example

Teaches(e1,c1) whereEmployee(e1) and Class(c1)and Name(e1)=’Brown’.

Jan Chomicki (University at Buffalo) Conceptual database design 8 / 30

Page 21: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Relationships

Relationship type ofarity k

A subset of the Cartesianproduct of some entitytypes E1, . . . ,Ek ,representing an associationbetween the entity types.Relationship types canhave attributes.

Examples

Teaches(Employee,Class)Sells(Vendor,Customer,Product)Parent(Person,Person)

Relationship instance of aritykA k-tuple of entities of theappropriate types.

Example

Teaches(e1,c1) whereEmployee(e1) and Class(c1)and Name(e1)=’Brown’.

Jan Chomicki (University at Buffalo) Conceptual database design 8 / 30

Page 22: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Relationships

Relationship type ofarity k

A subset of the Cartesianproduct of some entitytypes E1, . . . ,Ek ,representing an associationbetween the entity types.Relationship types canhave attributes.

Examples

Teaches(Employee,Class)Sells(Vendor,Customer,Product)Parent(Person,Person)

Relationship instance of aritykA k-tuple of entities of theappropriate types.

Example

Teaches(e1,c1) whereEmployee(e1) and Class(c1)and Name(e1)=’Brown’.

Jan Chomicki (University at Buffalo) Conceptual database design 8 / 30

Page 23: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Cardinality constraints

Binary relationship type R(A, B) is:

1 : 1 if for every entity e1 in A there is at most one entity e2 in B such thatR(e1, e2) and vice versa.

N : 1 if for every entity e1 in A there is at most one entity e2 in B such thatR(e1, e2).

N : M otherwise.

Jan Chomicki (University at Buffalo) Conceptual database design 9 / 30

Page 24: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Advanced schema-level concepts

isa relationships

weak entity types

complex attributes

roles.

Jan Chomicki (University at Buffalo) Conceptual database design 10 / 30

Page 25: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

isa relationships

DefinitionA isa B if every entity in theentity type A is also in the entitytype B.

Example

Faculty isa Employee.

If A isa B, then:

Attrs(B) ⊆ Attrs(A) (inheritance of attributes),

Key(A) = Key(B) (inheritance of key).

Example

Rank : Faculty → {’Assistant’,’Associate’,. . .}

Rank is not defined for non-faculty employees (or defined differently).

Jan Chomicki (University at Buffalo) Conceptual database design 11 / 30

Page 26: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

isa relationships

DefinitionA isa B if every entity in theentity type A is also in the entitytype B.

Example

Faculty isa Employee.

If A isa B, then:

Attrs(B) ⊆ Attrs(A) (inheritance of attributes),

Key(A) = Key(B) (inheritance of key).

Example

Rank : Faculty → {’Assistant’,’Associate’,. . .}

Rank is not defined for non-faculty employees (or defined differently).

Jan Chomicki (University at Buffalo) Conceptual database design 11 / 30

Page 27: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

isa relationships

DefinitionA isa B if every entity in theentity type A is also in the entitytype B.

Example

Faculty isa Employee.

If A isa B, then:

Attrs(B) ⊆ Attrs(A) (inheritance of attributes),

Key(A) = Key(B) (inheritance of key).

Example

Rank : Faculty → {’Assistant’,’Associate’,. . .}

Rank is not defined for non-faculty employees (or defined differently).

Jan Chomicki (University at Buffalo) Conceptual database design 11 / 30

Page 28: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

isa relationships

DefinitionA isa B if every entity in theentity type A is also in the entitytype B.

Example

Faculty isa Employee.

If A isa B, then:

Attrs(B) ⊆ Attrs(A) (inheritance of attributes),

Key(A) = Key(B) (inheritance of key).

Example

Rank : Faculty → {’Assistant’,’Associate’,. . .}

Rank is not defined for non-faculty employees (or defined differently).

Jan Chomicki (University at Buffalo) Conceptual database design 11 / 30

Page 29: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Weak entity types

DefinitionA is a weak entity type if:

A does not have a key.

the entities in A can be identified through an identifying relationship typeR(A, B) with another entity type B.

The entities in A can be identified by the combination of:

the borrowed key of B.

some partial key of A.

Example

Entity types: Account, Check.Identifying relationship type: Issued.Borrowed key (of Account): AccNo.Partial key (of Check): CheckNo.

Jan Chomicki (University at Buffalo) Conceptual database design 12 / 30

Page 30: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Weak entity types

DefinitionA is a weak entity type if:

A does not have a key.

the entities in A can be identified through an identifying relationship typeR(A, B) with another entity type B.

The entities in A can be identified by the combination of:

the borrowed key of B.

some partial key of A.

Example

Entity types: Account, Check.Identifying relationship type: Issued.Borrowed key (of Account): AccNo.Partial key (of Check): CheckNo.

Jan Chomicki (University at Buffalo) Conceptual database design 12 / 30

Page 31: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Weak entity types

DefinitionA is a weak entity type if:

A does not have a key.

the entities in A can be identified through an identifying relationship typeR(A, B) with another entity type B.

The entities in A can be identified by the combination of:

the borrowed key of B.

some partial key of A.

Example

Entity types: Account, Check.Identifying relationship type: Issued.Borrowed key (of Account): AccNo.Partial key (of Check): CheckNo.

Jan Chomicki (University at Buffalo) Conceptual database design 12 / 30

Page 32: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Weak entity types

DefinitionA is a weak entity type if:

A does not have a key.

the entities in A can be identified through an identifying relationship typeR(A, B) with another entity type B.

The entities in A can be identified by the combination of:

the borrowed key of B.

some partial key of A.

Example

Entity types: Account, Check.Identifying relationship type: Issued.Borrowed key (of Account): AccNo.Partial key (of Check): CheckNo.

Jan Chomicki (University at Buffalo) Conceptual database design 12 / 30

Page 33: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Complex attributes

Attribute values

sets (multivalued attributes).

tuples (composite attributes).

Multivalued attribute

Degrees : Faculty → 2{′B.A.′,′B.S.′,...,′Ph.D.′,...}

Composite attributeAddress : Employee → Street× City× Zipcode

Multivalued and composite attributes can be expressed using other constructs ofthe E-R model.

Jan Chomicki (University at Buffalo) Conceptual database design 13 / 30

Page 34: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Complex attributes

Attribute values

sets (multivalued attributes).

tuples (composite attributes).

Multivalued attribute

Degrees : Faculty → 2{′B.A.′,′B.S.′,...,′Ph.D.′,...}

Composite attributeAddress : Employee → Street× City× Zipcode

Multivalued and composite attributes can be expressed using other constructs ofthe E-R model.

Jan Chomicki (University at Buffalo) Conceptual database design 13 / 30

Page 35: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Complex attributes

Attribute values

sets (multivalued attributes).

tuples (composite attributes).

Multivalued attribute

Degrees : Faculty → 2{′B.A.′,′B.S.′,...,′Ph.D.′,...}

Composite attributeAddress : Employee → Street× City× Zipcode

Multivalued and composite attributes can be expressed using other constructs ofthe E-R model.

Jan Chomicki (University at Buffalo) Conceptual database design 13 / 30

Page 36: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Complex attributes

Attribute values

sets (multivalued attributes).

tuples (composite attributes).

Multivalued attribute

Degrees : Faculty → 2{′B.A.′,′B.S.′,...,′Ph.D.′,...}

Composite attributeAddress : Employee → Street× City× Zipcode

Multivalued and composite attributes can be expressed using other constructs ofthe E-R model.

Jan Chomicki (University at Buffalo) Conceptual database design 13 / 30

Page 37: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Complex attributes

Attribute values

sets (multivalued attributes).

tuples (composite attributes).

Multivalued attribute

Degrees : Faculty → 2{′B.A.′,′B.S.′,...,′Ph.D.′,...}

Composite attributeAddress : Employee → Street× City× Zipcode

Multivalued and composite attributes can be expressed using other constructs ofthe E-R model.

Jan Chomicki (University at Buffalo) Conceptual database design 13 / 30

Page 38: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Roles

Roles are necessary in a relationship type that relates an entity type to itself.Different occurrences of the same entity type are distinguished by different rolenames.

Example

In the relationship type ParentOf(Person, Person) the introduction of rolenames gives ParentOf(Parent:Person,Child:Person)

Jan Chomicki (University at Buffalo) Conceptual database design 14 / 30

Page 39: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Roles

Roles are necessary in a relationship type that relates an entity type to itself.Different occurrences of the same entity type are distinguished by different rolenames.

Example

In the relationship type ParentOf(Person, Person) the introduction of rolenames gives ParentOf(Parent:Person,Child:Person)

Jan Chomicki (University at Buffalo) Conceptual database design 14 / 30

Page 40: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Roles

Roles are necessary in a relationship type that relates an entity type to itself.Different occurrences of the same entity type are distinguished by different rolenames.

Example

In the relationship type ParentOf(Person, Person) the introduction of rolenames gives ParentOf(Parent:Person,Child:Person)

Jan Chomicki (University at Buffalo) Conceptual database design 14 / 30

Page 41: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

ER design

General guidelines

schema: stable information, instance: changing information.

avoid redundancy (each fact should be represented once).

no need to store information that can be computed.

keys should be as small as possible.

introduce artificial keys only if no simple, natural keys available.

How to choose entity types

things that have properties of their own, or

things that are used in navigating through the database.

avoid null attribute values if possible by introducing extra entity types.

Jan Chomicki (University at Buffalo) Conceptual database design 15 / 30

Page 42: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

ER design

General guidelines

schema: stable information, instance: changing information.

avoid redundancy (each fact should be represented once).

no need to store information that can be computed.

keys should be as small as possible.

introduce artificial keys only if no simple, natural keys available.

How to choose entity types

things that have properties of their own, or

things that are used in navigating through the database.

avoid null attribute values if possible by introducing extra entity types.

Jan Chomicki (University at Buffalo) Conceptual database design 15 / 30

Page 43: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

ER design

General guidelines

schema: stable information, instance: changing information.

avoid redundancy (each fact should be represented once).

no need to store information that can be computed.

keys should be as small as possible.

introduce artificial keys only if no simple, natural keys available.

How to choose entity types

things that have properties of their own, or

things that are used in navigating through the database.

avoid null attribute values if possible by introducing extra entity types.

Jan Chomicki (University at Buffalo) Conceptual database design 15 / 30

Page 44: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

isa relationship design

Generalization (bottom-up)

generalize a number ofdifferent entity types (withthe same key) to a singletype.

factor out commonattributes.

Example

Student isa PersonTeacher isa PersonName : Person → String

Specialization (top-down)

specialize an entity type toone or more specific types.

add attributes in morespecific entity types.

Example

Salary : Teacher → Decimal

Jan Chomicki (University at Buffalo) Conceptual database design 16 / 30

Page 45: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

isa relationship design

Generalization (bottom-up)

generalize a number ofdifferent entity types (withthe same key) to a singletype.

factor out commonattributes.

Example

Student isa PersonTeacher isa PersonName : Person → String

Specialization (top-down)

specialize an entity type toone or more specific types.

add attributes in morespecific entity types.

Example

Salary : Teacher → Decimal

Jan Chomicki (University at Buffalo) Conceptual database design 16 / 30

Page 46: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

isa relationship design

Generalization (bottom-up)

generalize a number ofdifferent entity types (withthe same key) to a singletype.

factor out commonattributes.

Example

Student isa PersonTeacher isa PersonName : Person → String

Specialization (top-down)

specialize an entity type toone or more specific types.

add attributes in morespecific entity types.

Example

Salary : Teacher → Decimal

Jan Chomicki (University at Buffalo) Conceptual database design 16 / 30

Page 47: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Mapping E-R schemas to relations

Assumption

No complex attributes.

Multiple stages1 creating relation schemas from entity types.

2 creating relation schemas from relationship types.

3 identifying keys.

4 identifying foreign keys.

5 schema optimization.

Jan Chomicki (University at Buffalo) Conceptual database design 17 / 30

Page 48: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Mapping E-R schemas to relations

Assumption

No complex attributes.

Multiple stages1 creating relation schemas from entity types.

2 creating relation schemas from relationship types.

3 identifying keys.

4 identifying foreign keys.

5 schema optimization.

Jan Chomicki (University at Buffalo) Conceptual database design 17 / 30

Page 49: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Mapping E-R schemas to relations

Assumption

No complex attributes.

Multiple stages1 creating relation schemas from entity types.

2 creating relation schemas from relationship types.

3 identifying keys.

4 identifying foreign keys.

5 schema optimization.

Jan Chomicki (University at Buffalo) Conceptual database design 17 / 30

Page 50: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Mapping entity types to relations

Entity type Relation schema

E1 such that E1 isa E2 Key(E2)

∪(Attrs(E1)− Attrs(E2))

E1 is a weak entity type Key(E2)

identified by R(E1, E2) ∪(Attrs(E1)− Attrs(E2))

E1 is none of the above Attrs(E1)

Jan Chomicki (University at Buffalo) Conceptual database design 18 / 30

Page 51: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Mapping relationship types to relations

Relationship type Relation schema

R(E1, . . . ,En) Key(E1) ∪ · · ·Key(En)

∪Attrs(R)

No relations are created from isa or identifying relationships.

Different occurrences of the same attribute name should be named differently.

Jan Chomicki (University at Buffalo) Conceptual database design 19 / 30

Page 52: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Mapping relationship types to relations

Relationship type Relation schema

R(E1, . . . ,En) Key(E1) ∪ · · ·Key(En)

∪Attrs(R)

No relations are created from isa or identifying relationships.

Different occurrences of the same attribute name should be named differently.

Jan Chomicki (University at Buffalo) Conceptual database design 19 / 30

Page 53: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Mapping relationship types to relations

Relationship type Relation schema

R(E1, . . . ,En) Key(E1) ∪ · · ·Key(En)

∪Attrs(R)

No relations are created from isa or identifying relationships.

Different occurrences of the same attribute name should be named differently.

Jan Chomicki (University at Buffalo) Conceptual database design 19 / 30

Page 54: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Identifying keys

Relation schema W is the result of mapping an entity type E1 or a relationshiptype R(E1, E2).

Source of W Key of W

Entity type E1 Key(E1)

Weak entity type E1 Union of borrowed

and partial keys of E1

R(E1, E2) is 1 : 1 Key(E1) or Key(E2)

R(E1, E2) is N : 1 Key(E1)

R(E1, E2) is N : M Key(E1) ∪ Key(E2)

These rules can be generalized to arbitrary relationship types R(E1, . . . ,En).

Jan Chomicki (University at Buffalo) Conceptual database design 20 / 30

Page 55: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Identifying keys

Relation schema W is the result of mapping an entity type E1 or a relationshiptype R(E1, E2).

Source of W Key of W

Entity type E1 Key(E1)

Weak entity type E1 Union of borrowed

and partial keys of E1

R(E1, E2) is 1 : 1 Key(E1) or Key(E2)

R(E1, E2) is N : 1 Key(E1)

R(E1, E2) is N : M Key(E1) ∪ Key(E2)

These rules can be generalized to arbitrary relationship types R(E1, . . . ,En).

Jan Chomicki (University at Buffalo) Conceptual database design 20 / 30

Page 56: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Identifying keys

Relation schema W is the result of mapping an entity type E1 or a relationshiptype R(E1, E2).

Source of W Key of W

Entity type E1 Key(E1)

Weak entity type E1 Union of borrowed

and partial keys of E1

R(E1, E2) is 1 : 1 Key(E1) or Key(E2)

R(E1, E2) is N : 1 Key(E1)

R(E1, E2) is N : M Key(E1) ∪ Key(E2)

These rules can be generalized to arbitrary relationship types R(E1, . . . ,En).

Jan Chomicki (University at Buffalo) Conceptual database design 20 / 30

Page 57: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Identifying foreign keys

Relation schema W is the result of mapping an entity type E1 or a relationshiptype R(E1, E2).

Source of W Foreign keys of W

Entity type E1 No foreign keys

Weak entity type E1 Borrowed key of E1

Entity type E1 Key(E1)

such that E1 isa E2

R(E1, E2) Key(E1), Key(E2)

Jan Chomicki (University at Buffalo) Conceptual database design 21 / 30

Page 58: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Identifying foreign keys

Relation schema W is the result of mapping an entity type E1 or a relationshiptype R(E1, E2).

Source of W Foreign keys of W

Entity type E1 No foreign keys

Weak entity type E1 Borrowed key of E1

Entity type E1 Key(E1)

such that E1 isa E2

R(E1, E2) Key(E1), Key(E2)

Jan Chomicki (University at Buffalo) Conceptual database design 21 / 30

Page 59: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Schema optimization

Combine relation schemas with identical keys coming from the same entity type.

Student(SName,Address) can be combined with Advising(SName,Faculty)to yield Student(SName,Address,Faculty).

Different keys

Student(SName,Address) cannot be combined withGrades(SName,Course,Grade).

Different entity types

Student(SName,Address) cannot be combined with Graduate(SName).

Jan Chomicki (University at Buffalo) Conceptual database design 22 / 30

Page 60: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Schema optimization

Combine relation schemas with identical keys coming from the same entity type.

Student(SName,Address) can be combined with Advising(SName,Faculty)to yield Student(SName,Address,Faculty).

Different keys

Student(SName,Address) cannot be combined withGrades(SName,Course,Grade).

Different entity types

Student(SName,Address) cannot be combined with Graduate(SName).

Jan Chomicki (University at Buffalo) Conceptual database design 22 / 30

Page 61: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Schema optimization

Combine relation schemas with identical keys coming from the same entity type.

Student(SName,Address) can be combined with Advising(SName,Faculty)to yield Student(SName,Address,Faculty).

Different keys

Student(SName,Address) cannot be combined withGrades(SName,Course,Grade).

Different entity types

Student(SName,Address) cannot be combined with Graduate(SName).

Jan Chomicki (University at Buffalo) Conceptual database design 22 / 30

Page 62: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Schema optimization

Combine relation schemas with identical keys coming from the same entity type.

Student(SName,Address) can be combined with Advising(SName,Faculty)to yield Student(SName,Address,Faculty).

Different keys

Student(SName,Address) cannot be combined withGrades(SName,Course,Grade).

Different entity types

Student(SName,Address) cannot be combined with Graduate(SName).

Jan Chomicki (University at Buffalo) Conceptual database design 22 / 30

Page 63: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Description logics knowledgebases

Description logics

a family of variable-free logics developed in AI

used to define ontologies for the Semantic Web (OWL DL)

Terminological box (TBox)

corresponds to database conceptual schema

vocabulary: atomic concepts and roles

containment and transitivity assertions, definitions

Assertional box (ABox)

corresponds to database instance

named individuals

assertions stating membership of individuals in concepts and roles

Jan Chomicki (University at Buffalo) Conceptual database design 23 / 30

Page 64: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Description logics knowledgebases

Description logics

a family of variable-free logics developed in AI

used to define ontologies for the Semantic Web (OWL DL)

Terminological box (TBox)

corresponds to database conceptual schema

vocabulary: atomic concepts and roles

containment and transitivity assertions, definitions

Assertional box (ABox)

corresponds to database instance

named individuals

assertions stating membership of individuals in concepts and roles

Jan Chomicki (University at Buffalo) Conceptual database design 23 / 30

Page 65: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Description logics knowledgebases

Description logics

a family of variable-free logics developed in AI

used to define ontologies for the Semantic Web (OWL DL)

Terminological box (TBox)

corresponds to database conceptual schema

vocabulary: atomic concepts and roles

containment and transitivity assertions, definitions

Assertional box (ABox)

corresponds to database instance

named individuals

assertions stating membership of individuals in concepts and roles

Jan Chomicki (University at Buffalo) Conceptual database design 23 / 30

Page 66: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Description logics knowledgebases

Description logics

a family of variable-free logics developed in AI

used to define ontologies for the Semantic Web (OWL DL)

Terminological box (TBox)

corresponds to database conceptual schema

vocabulary: atomic concepts and roles

containment and transitivity assertions, definitions

Assertional box (ABox)

corresponds to database instance

named individuals

assertions stating membership of individuals in concepts and roles

Jan Chomicki (University at Buffalo) Conceptual database design 23 / 30

Page 67: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Concepts

Atomic concepts

correspond to entity types

Singleton concepts

the concept consists of a single individual: {a}

Boolean concepts

intersection of concepts: C u D

union of concepts: C t D

negation of a concept: ¬C

top concept: > = A t ¬A

bottom concept: ⊥ = A u ¬A

Jan Chomicki (University at Buffalo) Conceptual database design 24 / 30

Page 68: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Concepts

Atomic concepts

correspond to entity types

Singleton concepts

the concept consists of a single individual: {a}

Boolean concepts

intersection of concepts: C u D

union of concepts: C t D

negation of a concept: ¬C

top concept: > = A t ¬A

bottom concept: ⊥ = A u ¬A

Jan Chomicki (University at Buffalo) Conceptual database design 24 / 30

Page 69: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Concepts

Atomic concepts

correspond to entity types

Singleton concepts

the concept consists of a single individual: {a}

Boolean concepts

intersection of concepts: C u D

union of concepts: C t D

negation of a concept: ¬C

top concept: > = A t ¬A

bottom concept: ⊥ = A u ¬A

Jan Chomicki (University at Buffalo) Conceptual database design 24 / 30

Page 70: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Concepts

Atomic concepts

correspond to entity types

Singleton concepts

the concept consists of a single individual: {a}

Boolean concepts

intersection of concepts: C u D

union of concepts: C t D

negation of a concept: ¬C

top concept: > = A t ¬A

bottom concept: ⊥ = A u ¬A

Jan Chomicki (University at Buffalo) Conceptual database design 24 / 30

Page 71: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Further concepts

Quantification and number restrictionC is a concept, R a role

individuals associated with some individual in C through R: ∃R.C

individuals associated only with individuals in C through R: ∀R.C

individuals associated with at most k individuals through R : ≤ k R

individuals associated with at least k individuals through R : ≥ k R

Datatypes

In ∃R.C and ∀R.C , C can be a datatype (Integer, String,...).

Jan Chomicki (University at Buffalo) Conceptual database design 25 / 30

Page 72: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Further concepts

Quantification and number restrictionC is a concept, R a role

individuals associated with some individual in C through R: ∃R.C

individuals associated only with individuals in C through R: ∀R.C

individuals associated with at most k individuals through R : ≤ k R

individuals associated with at least k individuals through R : ≥ k R

Datatypes

In ∃R.C and ∀R.C , C can be a datatype (Integer, String,...).

Jan Chomicki (University at Buffalo) Conceptual database design 25 / 30

Page 73: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Further concepts

Quantification and number restrictionC is a concept, R a role

individuals associated with some individual in C through R: ∃R.C

individuals associated only with individuals in C through R: ∀R.C

individuals associated with at most k individuals through R : ≤ k R

individuals associated with at least k individuals through R : ≥ k R

Datatypes

In ∃R.C and ∀R.C , C can be a datatype (Integer, String,...).

Jan Chomicki (University at Buffalo) Conceptual database design 25 / 30

Page 74: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Roles

Atomic rolescorrespond to relationship types

Inverse roles

an individual a is associated with an individual b through R− if and only if bis associated with a through R.

Jan Chomicki (University at Buffalo) Conceptual database design 26 / 30

Page 75: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Roles

Atomic rolescorrespond to relationship types

Inverse roles

an individual a is associated with an individual b through R− if and only if bis associated with a through R.

Jan Chomicki (University at Buffalo) Conceptual database design 26 / 30

Page 76: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Roles

Atomic rolescorrespond to relationship types

Inverse roles

an individual a is associated with an individual b through R− if and only if bis associated with a through R.

Jan Chomicki (University at Buffalo) Conceptual database design 26 / 30

Page 77: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Assertions

Definitionatomic concept A is defined as concept C : A ≡ C

Containmentconcept C is contained in concept D: C v D

role R is contained in role S : R v S

Transitivity

role R is transitive: R+ v R

Membership

individual a is a member of concept C : a ∈ C

pair (a, b) belongs to role R: (a, b) ∈ R

Jan Chomicki (University at Buffalo) Conceptual database design 27 / 30

Page 78: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Assertions

Definitionatomic concept A is defined as concept C : A ≡ C

Containmentconcept C is contained in concept D: C v D

role R is contained in role S : R v S

Transitivity

role R is transitive: R+ v R

Membership

individual a is a member of concept C : a ∈ C

pair (a, b) belongs to role R: (a, b) ∈ R

Jan Chomicki (University at Buffalo) Conceptual database design 27 / 30

Page 79: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Assertions

Definitionatomic concept A is defined as concept C : A ≡ C

Containmentconcept C is contained in concept D: C v D

role R is contained in role S : R v S

Transitivity

role R is transitive: R+ v R

Membership

individual a is a member of concept C : a ∈ C

pair (a, b) belongs to role R: (a, b) ∈ R

Jan Chomicki (University at Buffalo) Conceptual database design 27 / 30

Page 80: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Assertions

Definitionatomic concept A is defined as concept C : A ≡ C

Containmentconcept C is contained in concept D: C v D

role R is contained in role S : R v S

Transitivity

role R is transitive: R+ v R

Membership

individual a is a member of concept C : a ∈ C

pair (a, b) belongs to role R: (a, b) ∈ R

Jan Chomicki (University at Buffalo) Conceptual database design 27 / 30

Page 81: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Assertions

Definitionatomic concept A is defined as concept C : A ≡ C

Containmentconcept C is contained in concept D: C v D

role R is contained in role S : R v S

Transitivity

role R is transitive: R+ v R

Membership

individual a is a member of concept C : a ∈ C

pair (a, b) belongs to role R: (a, b) ∈ R

Jan Chomicki (University at Buffalo) Conceptual database design 27 / 30

Page 82: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

E-R constructs in description logics

Integer attribute A for entity type E

E is a concept, A is a role

assertion:

E v ∀A.Integer

single-valuedness not enforced

Relationship R is between entity types E1 and E2

E1 and E2 are concepts, R is a role

assertions:

E1 v ∀R.E2

E2 v ∀R−.E1

Jan Chomicki (University at Buffalo) Conceptual database design 28 / 30

Page 83: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

E-R constructs in description logics

Integer attribute A for entity type E

E is a concept, A is a role

assertion:

E v ∀A.Integer

single-valuedness not enforced

Relationship R is between entity types E1 and E2

E1 and E2 are concepts, R is a role

assertions:

E1 v ∀R.E2

E2 v ∀R−.E1

Jan Chomicki (University at Buffalo) Conceptual database design 28 / 30

Page 84: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

E-R constructs in description logics

Integer attribute A for entity type E

E is a concept, A is a role

assertion:

E v ∀A.Integer

single-valuedness not enforced

Relationship R is between entity types E1 and E2

E1 and E2 are concepts, R is a role

assertions:

E1 v ∀R.E2

E2 v ∀R−.E1

Jan Chomicki (University at Buffalo) Conceptual database design 28 / 30

Page 85: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Further E-R constructs

Relationship R is n : 1

assertion:

E1 v ≤ 1 R

E1 isa E2

assertion:

E1 v E2

Problematic constructssingle-valued attributes

keys

n-ary relationships for N > 2 (but can be simulated)

Jan Chomicki (University at Buffalo) Conceptual database design 29 / 30

Page 86: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Further E-R constructs

Relationship R is n : 1

assertion:

E1 v ≤ 1 R

E1 isa E2

assertion:

E1 v E2

Problematic constructssingle-valued attributes

keys

n-ary relationships for N > 2 (but can be simulated)

Jan Chomicki (University at Buffalo) Conceptual database design 29 / 30

Page 87: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Further E-R constructs

Relationship R is n : 1

assertion:

E1 v ≤ 1 R

E1 isa E2

assertion:

E1 v E2

Problematic constructssingle-valued attributes

keys

n-ary relationships for N > 2 (but can be simulated)

Jan Chomicki (University at Buffalo) Conceptual database design 29 / 30

Page 88: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Further E-R constructs

Relationship R is n : 1

assertion:

E1 v ≤ 1 R

E1 isa E2

assertion:

E1 v E2

Problematic constructssingle-valued attributes

keys

n-ary relationships for N > 2 (but can be simulated)

Jan Chomicki (University at Buffalo) Conceptual database design 29 / 30

Page 89: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Beyond E-R: ontologies

Concepts C1 and C2 are disjoint

assertion:

C1 u C2 v ⊥

Single parents

assertion:

SingleParent ≡ Person u (∀Parent. ≤ 1Parent−)

Typical ontology reasoning tasks

correctness of knowledge: does the knowledgebase imply a given containmentassertion?

querying ontologies: does the knowledgebase imply a given membershipassertion?

Jan Chomicki (University at Buffalo) Conceptual database design 30 / 30

Page 90: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Beyond E-R: ontologies

Concepts C1 and C2 are disjoint

assertion:

C1 u C2 v ⊥

Single parents

assertion:

SingleParent ≡ Person u (∀Parent. ≤ 1Parent−)

Typical ontology reasoning tasks

correctness of knowledge: does the knowledgebase imply a given containmentassertion?

querying ontologies: does the knowledgebase imply a given membershipassertion?

Jan Chomicki (University at Buffalo) Conceptual database design 30 / 30

Page 91: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Beyond E-R: ontologies

Concepts C1 and C2 are disjoint

assertion:

C1 u C2 v ⊥

Single parents

assertion:

SingleParent ≡ Person u (∀Parent. ≤ 1Parent−)

Typical ontology reasoning tasks

correctness of knowledge: does the knowledgebase imply a given containmentassertion?

querying ontologies: does the knowledgebase imply a given membershipassertion?

Jan Chomicki (University at Buffalo) Conceptual database design 30 / 30

Page 92: Conceptual Database Design - University at Buffalochomicki/560/main-er.pdf · Jan Chomicki (University at Bu alo) Conceptual database design 12 / 30. Weak entity types De nition A

Beyond E-R: ontologies

Concepts C1 and C2 are disjoint

assertion:

C1 u C2 v ⊥

Single parents

assertion:

SingleParent ≡ Person u (∀Parent. ≤ 1Parent−)

Typical ontology reasoning tasks

correctness of knowledge: does the knowledgebase imply a given containmentassertion?

querying ontologies: does the knowledgebase imply a given membershipassertion?

Jan Chomicki (University at Buffalo) Conceptual database design 30 / 30