Supertypes and Subtypes

Slides:



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

Author: Graeme C. Simsion and Graham C. Witt Chapter 7 Extensions and Alternatives.
Chapter 3  Define terms  Understand use of supertype/subtype relationships  Understand use of specialization and generalization techniques  Specify.
Chapter 7 Posting Journal Entries to General Ledger Accounts
Advanced Data Modeling
1 Section 14 - Subtypes/Supertypes u Subtyping –allows our diagram to show several different options at the same time –is useful for concisely representing.
Copyright © 2015 Pearson Education, Inc. Database Design Chapters 17 and
Database Systems: Design, Implementation, and Management Tenth Edition
Chapter 6 Advanced Data Modelling
Chapter 5 Understanding Entity Relationship Diagrams.
Fundamentals, Design, and Implementation, 9/e COS 346 Day 8.
System Analysis - Data Modeling
Associative Entities A relationship cannot have attributes
Fundamentals, Design, and Implementation, 9/e Chapter 5 Database Design.
Information Resources Management February 6, 2001.
Copyright © 2003 Addison-Wesley Your name here. Copyright © 2003 Addison-Wesley Data Modeling with ER Diagrams What is an Entity-Relationship Model? How.
Entity Relationship Diagrams
Developing an IT Application Using Advantage:Gen  Data Modeling: I-bars and subtypes.
CS424 PK, FK, FD Normalization Primary and Foreign Keys Primary and foreign keys are the most basic components on which relational theory is based. Primary.
Data at the Core of the Enterprise. Objectives  Define of database systems  Introduce data modeling and SQL  Discuss emerging requirements of database.
CSCI 242 Relational Data Modeling Copyright 2011, David C. Roberts, all rights reserved.
CSCI 6442 Entity-Relation Data Modeling Copyright 2012, David C. Roberts, all rights reserved.
Database Design Sections 4 & 5 Subtype, Supertype, Mutually exclusive, non-transferability, transferable, 1:1, 1:M, M:M, Redundant, Intersection entity,
Chapter What kinds of transactions are recorded in a purchases journal? A) Merchandise bought on account B) All cash payments C) Sale of merchandise.
Chapter 3: The Enhanced E-R Model
Oracle Academy -Week 1-.
FINANCE Chapter 9 Checking Accounts and Other Banking Services.
Class Agenda – 04/04/2006 Discuss database modeling issues
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 5-1 David M. Kroenke’s Chapter Five: Data Modeling with the Entity-Relationship.
DATA BASE DESIGNING & PROGRAMMING WITH SQL Chandan Sinha, PGT Comp. Sc., K.V Maithon Dam.
Data at the Core of the Enterprise. Objectives  Define of database systems.  Introduce data modeling and SQL.  Discuss emerging requirements of database.
Database Design Sections 4 & 5 Subtype, Supertype, Mutually exclusive, non-transferability, transferable, 1:1, 1:M, M:M, Redundant, Intersection entity,
CSE 441: Systems Analysis & Design
Copyright © 2003 Addison-Wesley Jesper Rosholm Tørresø.
Accounting: What the Numbers Mean
Modeling Relationships Farrokh Alemi, Ph.D. Updated by Janusz Wojtusiak, Fall 2009.
Entity Relationship Diagrams Objectives s Learn the Elements of the E-R model (entities, attributes, and relationships) s Show how to apply the E-R model.
1 ER Modeling BUAD/American University Entity Relationship (ER) Modeling.
Artificial, Composite and Secondary UIDs
0 Glencoe Accounting Unit 4 Chapter 16 Copyright © by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 16 Special Journals: Sales and Cash.
IS 475/675 - Introduction to Database Design
CSEN 5314 Quiz Inheritance is which of the following? A. When a supertype entity inherits values of the subtype attribute B. When a subtype entity.
Db design / ER Modeling B Database Systems ER-Modeling Part 3 Wilhelm Steinbuss Room G2.04, ext 4052
Question 11 Attribute inheritance is the gaining of attributes by a subtype entity from a supertype entity. This inheritance of common pieces of data from.
Component 4/Unit 6b Topic II Relational Databases Keys and relationships Data modeling Database acquisition Database Management System (DBMS) Database.
In this session, you will learn to: Map an ER diagram to a table Objectives.
Generic Modeling. 2 home back first prev next last What Will I Learn? In this lesson, you will learn to: –Define generic modeling –Evaluate and describe.
Database Systems Supertypes and Subtypes Lecture # 10.
Subtype Mapping. 2 home back first prev next last What Will I Learn? In this lesson, you will learn to: –State and apply the table, column, identifiers,
Posting to General and Subsidiary Ledgers
CIS 210 Systems Analysis and Development Week 6 Part I Structuring Systems Data Requirements,
1 Class Agenda (04/06/2006 and 04/11/2006)  Discuss use of Visio for ERDs  Learn concepts and ERD notation for data generalization  Introduce concepts.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-1 David M. Kroenke’s, 10 th ed. Chapter.
subtype 1.inherits all attributes of the supertype 2.inherits all relationships of the supertype 3. usually has its own attributes or.
Ch 05. Basic Symbols ( manino ). Cardinalities Cardinality Notation.
Chapter 5 Understanding Entity Relationship Diagrams.
Data Modeling Advanced Concepts Updated 20/4/2015 TMC2034 Database Concept and Design1.
BTM 382 Database Management Chapter 5: Advanced Data Modeling
IT 5433 LM2 ER & EER Model. Learning Objectives: Explain importance of data modeling Define and use the entity-relationship model Define E/R terms Describe.
Lecture # 14 Chapter # 5 The Relational Data Model and Relational Database Constraints Database Systems.
Semantic Object Modeling (SOM)
Entity Relationship Diagrams
Super Entity & Sub Entity
Entity Relationship Diagrams
Database Management System 1 (ITED123A)
Overview of Entity‐Relationship Model
Chapter 5 Advanced Data Modeling
Database Management system
Vertebrate Invertebrate
Presentation transcript:

Supertypes and Subtypes

What Will I Learn? In this lesson, you will learn to: Define and give an example of a subtype Define and give an example of a supertype State the rules relating to entities and subtypes; give examples of each Apply the rules of supertype and subtype by evaluating the accuracy of ER diagrams that represent them Apply the rules of supertype and subtype and include them in a diagram when appropriate

Why Learn It? Supertypes and subtypes occur frequently in the real world -- food orders (eat in, to go), grocery bags (paper, plastic), payment type (check, cash, credit). Understanding real world examples helps us understand how and when to model them.

Special group of instances Often some instances of an entity have attributes and/or relationships which other instances do not have. Imagine a business which needs to track payments from customers. Customers can pay by cash, by check or by credit card. All payments have some common attributes: payment date, payment amount and so on. But only credit cards would have a “card number” attribute. And for credit card and check payments we may need to know which CUSTOMER made the payment, while this is not needed for cash payments. Should we create a single PAYMENT entity or three separate entities CASH, CHECK and CREDIT CARD ? And what happens if in future we introduce a fourth method of payment ?

Supertype & Subtype Sometimes it makes sense to subdivide an entity into subtypes. This may be the case when a group of instances has special properties, such as attributes or relationships that exist only for that group. In this case, the entity is called a "supertype" and each group is called a subtype. A subtype: -inherits all attributes of the supertype -inherits all relationships of the supertype -usually has its own attributes or relationships -is drawn within the supertype -never exists alone -may have subtypes of its own -is also known as a "subentity“ Invertebrates are animals with no backbone (such as earth worms). Vertebrates have backbone and can be subdivided into birds, mammals,and reptiles etc.

Common attributes EXAM is a supertype of QUIZ, MIDTERM, and FINAL. The subtypes have several attributes in common. These common attributes are listed at the supertype level. The same applies to relationships. Subtypes inherit all attributes and relationships of the supertype entity.

Always More Than One Subtype When an ER model is complete, subtypes never stand alone. In other words, if an entity has a subtype, there should always be at least a second subtype. This makes sense. What use would there be for distinguishing between an entity and the single subtype? This idea leads to the two subtype rules: Exhaustive: Every instance of the supertype is also an instance of one of the subtypes. Mutually Exclusive: Every instance of the supertype is of one and only one subtype.

Subtypes Always Exist Every entity can always be subtyped. You can always make up a rule to subdivide the instances in groups, But that is not the issue. The reason for subtyping should always be that there is a business need to show similarities and differences at the same time.

Correctly Identifying Subtypes When considering supertypes and subtypes, you can use three questions to see if the subtype is correctly identified: (1) Is this subtype a kind of supertype? (2) Have I covered all possible cases? (exhaustive) (3) Does the example fit into one and only one subtype? (mutually exclusive)

Nested Subtypes You can nest subtypes. For ease of reading -- “readability” – you would usually show subtypes with only two levels, but there is no rule that would stop you from going beyond two levels.

Terminology Key terms used in this lesson include: Supertype Subtype/ Subentity Exhaustive Mutually exclusive

Summary In this lesson, you have learned how to: Define and give an example of a subtype Define and give an example of a supertype State the rules relating to entities and subtypes, and give examples of each Apply the rules of supertype and subtype by evaluating the accuracy of ER diagrams that represent them Apply the rules of supertype and subtype and include them in a diagram when appropriate