Fundamentals/ICY: Databases 2013/14 WEEK 6 - Friday

Slides:



Advertisements
Similar presentations
THE EXTENDED ENTITY RELATIONSHIP MODEL (EERM)
Advertisements

Basic notation for supertype/subtype relationships
Entity Relationship (ER) Modeling
Entity Relationship (ER) Modeling
4 1 Chapter 4 Entity Relationship (ER) Modeling Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
Fundamentals/ICY: Databases 2013/14 Week 6: Monday John Barnden Professor of Artificial Intelligence School of Computer Science University of Birmingham,
Entity Relationship (ER) Modeling
Database Systems: Design, Implementation, and Management Tenth Edition
Class Agenda – 04/04/2006 Discuss database modeling issues
Fundamentals/ICY: Databases 2010/11 WEEK 5 John Barnden Professor of Artificial Intelligence School of Computer Science University of Birmingham, UK.
Chapter 5 Entity Relationship (ER) Modelling
4 1 Chapter 4 Entity Relationship (ER) Modeling Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
Fundamentals/ICY: Databases 2012/13 WEEK 7 John Barnden Professor of Artificial Intelligence School of Computer Science University of Birmingham, UK.
Fundamentals/ICY: Databases 2013/14 Week 10 –Monday –Normalization, contd John Barnden Professor of Artificial Intelligence School of Computer Science.
Fundamentals/ICY: Databases 2012/13 WEEK 11 – 4 th Normal Form (optional material) John Barnden Professor of Artificial Intelligence School of Computer.
Database Design – Lecture 5 Conceptual Data Modeling – adding attributes.
Chapter 9: Logical Database Design and the Relational Model (ERD Mapping)
Fundamentals/ICY: Databases 2013/14 WEEK 9 –Monday John Barnden Professor of Artificial Intelligence School of Computer Science University of Birmingham,
In this session, you will learn to: Map an ER diagram to a table Objectives.
Entity Relationship Modeling
Fundamentals/ICY: Databases 2013/14 WEEK 9 –Friday John Barnden Professor of Artificial Intelligence School of Computer Science University of Birmingham,
Database Systems: Design, Implementation, and Management Ninth Edition
The Entity-Relationship Model, P. I R. Nakatsu. Data Modeling A data model is the relatively simple representation, usually graphic, of the structure.
Logical Database Design and the Relational Model.
Fundamentals/ICY: Databases 2013/14 Week 11 – Monday – relations, ended. John Barnden Professor of Artificial Intelligence School of Computer Science University.
Fundamentals/ICY: Databases 2012/13 WEEK 9 John Barnden Professor of Artificial Intelligence School of Computer Science University of Birmingham, UK.
BTM 382 Database Management Chapter 5: Advanced Data Modeling
Entity Relationship Modeling
Entity Relationship (E-R) Model
Logical Database Design and the Rational Model
Relational Database Design by ER- and ERR-to-Relational Mapping
Intro to Maths for CS: 2012/13 Sets (contd, week 2)
Fundamentals/ICY: Databases 2013/14 WEEK 8 –Monday
TMC2034 Database Concept and Design
Relational Database Design by ER- and EER-to- Relational Mapping
Chen’s Type Guidance.
Entity Relationship (E-R) Modeling
Entity Relationship (E-R) Modeling
Chapter 5: Logical Database Design and the Relational Model
Tables and Their Characteristics
Database Design – Lecture 4
Fundamentals/ICY: Databases 2010/11 WEEK 6
Lecture3: Data Modeling Using the Entity-Relationship Model.
UML UML Data Modeling.
CMPE 226 Database Systems February 21 Class Meeting
Super Entity & Sub Entity
מודל הנתונים.
Entity relationship diagrams
Module 8 – Database Design Using the E-R Model
Chapter 4 Entity Relationship (ER) Modeling
Database Systems: Design, Implementation, and Management Tenth Edition
Chapter 8: Mapping a Conceptual Design into a Logical Design
Session 2 Welcome: The seventh learning sequence
CHAPTER 4: LOGICAL DATABASE DESIGN AND THE RELATIONAL MODEL
Chapter 5 Advanced Data Modeling
Review of Week 1 Database DBMS File systems vs. database systems
Relational Database Design by ER- and EER-to- Relational Mapping
Chapter 4 Entity Relationship (ER) Modeling
Relational Database Design by ER- and EERR-to-Relational Mapping
Mapping an ERD to a Relational Database
Weak Entities (cont…) Entities that do not have key attributes of their own Related to specific entities from another entity type plus their own attributes.
John Barnden Professor of Artificial Intelligence
Relational Database Design by ER- and EER-to-Relational Mapping
Database Management system
Entity Relationship (ER) Modeling
CS4222 Principles of Database System
Chapter # 4 Entity Relationship (ER) Modeling.
Chapter 6b: Database Design Using the E-R Model
Relational Database Design by ER-to-Relational Mapping
Presentation transcript:

Fundamentals/ICY: Databases 2013/14 WEEK 6 - Friday John Barnden Professor of Artificial Intelligence School of Computer Science University of Birmingham, UK

Reminder of Monday

A Weak Entity in an ERD

New

The Attributes of the STUDENT Entity

Attributes

Multivalued Attributes in ERMs and ERDs

A Multivalued Attribute in an Entity: CAR_COLOR involves multiple colours

Multivalued Attributes “You should not implement them in the relational DBMS” [rather, you should re-represent them in a special way – J.A.B.] One (usually poor) possibility: Use a variable-length string for the attribute, and list all the values within the string. Disadvantage: little support supplied by the DBMS – insertions and deletion require special extra programming. Similarly if calculations are needed on the individual values.

Multivalued Attributes, contd Another possibility: Within original entity type, split the attribute into several different attributes corresponding to different natural components of the entity. (See next slide.)

Splitting the Multivalued Attribute into New Naturally Namable Attributes

Multivalued Attributes, contd Disadvantages: The attribute may in reality need to be split differently for different entities in the entity type (e.g. different cars). The attribute may not have naturally namable aspects at all. E.g., imagine blotches of colour in random places on a car.

Multivalued Attribute Problems, contd Another possibility: Within original entity type, split the attribute into several different attributes not corresponding to specific components of the entity. E.g., have attributes called Colour1, Colour2, … , Colour6. Advantage: copes with the no-identifiable-components problem and the different-split problems. NB: also allows repetition of colours. Disadvantages: Have to set aside enough columns to accommodate the conceivable max, but if this max is large and not often approached then have a lot of wasted space. Searching for a colour, or doing insertions and deletions, can be very cumbersome.

Multivalued Attributes, contd Often Better: Replace the attribute by a new 1:M relationship to a new entity type holding the original attribute’s data. If the components of the original attribute are conceptually distinguishable in a natural way, the new entity can have an attribute whose values identify those components.

There’s a slight deficiency in the Chen diagram. What?

Multivalued Attributes, contd If the original multivalued attribute does not have naturally namable components, could perhaps use values like section13 in COL_SECTION. Or could perhaps leave out COL_SECTION. But NB: the PK would then need to include the colour. So we can’t have easily repetitions of colours. What might we do about this? (Exercise.)

Generalization Hierarchies in ERMs and ERDs

Entity Supertypes and Subtypes Generalization (or: specialization) hierarchy A group of relationships each of which is between a higher-level “supertype” entity (e.g. EMPLOYEE) and a lower-level “subtype” entity (e.g., PROFESSOR) Supertype Contains attributes shared by all its subtypes Subtype Contains special attributes: ones that not all sister subtypes have. Primary key of a subtype = that of the supertype (normally)

Disjoint (or: Non-Overlapping) Subtypes Each entity in the supertype can appear in at most one of the subtypes Overlapping = a given entity can be in more than one subtype. Exhaustive Subtypes Each entity in the supertype must appear in at least one of the subtypes Other terminology: exhaustiveness = total completeness (!!) = mandatoriness [of being in some subtype] non-exhaustiveness = partial completeness (!!) = optionality [of being in som subtype]

topic continued in following week