Database-Chap 6 Flashcards
Advanced data modelling
Extended relational data model
Semantic data model developed in response to increasing complexity of applications
DBMS based on the ERDM often described as an object/relational DBMS
Primarily geared to business applications
Entity super type
Generic entity type that is related to one or more entity subtypes
Contains common characteristics
Entity sub type
Contains unique characteristics of each entity subtype
Specialization hierarchy rules
-Depicts arrangement of higher-level entity super types(parent entities) and lower-level entity subtypes(child entities)
-Subtype can exist only within context of subtype
-Every subtype can have only one super type to which it is directly related
Specialization hierarchy provides the means to
1)Support attribute inheritance
-Enables an entity subtype to inherit the attributes and relationships of the super type
2)Define a special super type attribute known as the subtype discriminator
3)Define disjoint? overlapping constraints and complete/partial constraints
Property of inheritance
Support attribute inheritance
-Enables an entity subtype to inherit attributes and relationships of the super type
-Subtypes can have specialized attributes in addition to inherited attributes
Sub type discriminator
-A special attribute used to determine the subtype of an entity
-Helps distinguish between different subtypes of a super type
Disjoint constraint
An entity can belong to only one subtype
Overlapping constraint
An entity can belong to multiple sub types
Partial constraint
Some instances of the super type might not belong belong to any subtype
Complete constraint
Every instance of the super type must belong to at least one subtype
Inheritance
-Enables entity sub type to inherit attributes and relationships of a super type
-All entity subtypes inherit their primary key attribute from their super type
-All implementation level, super type and its sub types depicted in the specialization hierarchy maintain a 1:1 relationship
Specialization
Top-down process of identifying lower-level ,more specific entity sub types from higher -level entity super types
Based on grouping unique characteristics and relationships of the sub types
Generalization
Bottom-up process of identifying higher-level ,more generic entity super types from lower-level entity sub types
Based on grouping common characteristics and relationships of the subtypes
Composition
-Special case of aggregation-mandatory association
-When the parent entity instance is deleted ,all child entity instances are automatically deleted
Aggregation
-A larger entity can be composed of smaller entities
-Optional association
-When you delete the parent entity the child entity is not deleted
Aggregation construct
Is used when an entity is composed of(or is formed by) a collection of other entities are independent of each other ,the relationship can be classified as a ‘has-a’ relationship type
A composition construct
Is used when two entities are associated in an aggregation association with a strong identifying relationship
Entity clustering “place holder”
-A “virtual” entity type used to represent multiple entities and relationships in an ERD
-Considered “virtual” or “abstract” because it is not actually an entity in final ERD
-Temporary entity used to represent multiple entities and relationships
-Eliminate undesirable consequences caused by missing information
-Avoid display of attributes when entity clusters are used
Natural keys
Or natural identifier is a real-world ,generally accepted identifier used to uniquely identify real-world objects
-Data modeler uses natural identifier as primary key of entity being modeled
Primary key
Is an attribute or combination of attributes that
-Uniquely identifies entity instances in an entity set-main function
-Guarantee entity integrity
-Non-intelligent :The PK should not have embedded semantic meaning
-No change over time
-Preferably single-attribute
-Preferably numeric
-Security complaint etc. using a social security number
When to use composite keys(case 1)
Useful as identifiers of composite entities, where each PK combination is allowed only once in a many to many relationship
-Automatically provides benefit of ensuring that there cannot be duplicate values
When to use composite keys(case 2)
Useful as identifiers of weak entities ,where weak entity has strong identifying relationship with parent entity
-Normally used to represent:
-A real-world object that is existent-dependent on another real-world object
-A real-world object that is represented in the data model as two separate entities in a strong identifying relationship
When to use surrogate PKs
-A surrogate PK is a replacement for unsuitable attributes
Especially helpful when there is:
-No natural key
-Selected candidate key has embedded semantic contents
-Selected candidate key is too long/cumbersome
Primary key guidelines
You should understand the function of a PK
-PKs and FKs are used to implement relationships among entities