Lesson 3 | Data Modeling Concept Flashcards
Types of Data Models
Entity-Relationship (ER) Model
UML (Unified Modeling Language
- Only addresses data and relationships
- Classic, simplest
- Best for deriving a sound table design
- Many extensions/variation exist
- Basis for most other modeling approaches
Entity-Relationship (ER) Model
- Class Models
- Goes beyong data, also models behaviors
UML (Unified Modeling Language)
- Technology Independent
- Contains more detail than the Conceptual Data Model
- Considered by many to be just an expanded conceptual data model
- Defines Entities and their attributes
- Defines Relationsips and Cardinality
- Defines Contraints
- Generally completed as a document Entity Relationship Model or Diagram
Logical Data Model
- Documentation of the structure of the data
- Used to communicate the design
- Serve as the basis for data model implementation
Entity Relationship Model
- Entities effectively become tables
- Attributes describe entities and become fields (columns) in table
- Relationhips link tables on a common attribute or “key” and become formal constraints (part of the business rules)
Entity Relationship Diagram (Relation Database Context)
What is the Data type for:
Site Name: Little Bear River near Wellsville
Char()
What is the Data type for:
Site Code: USU-LBR-Wellsville
varchar()
What is the Data type for:
Lattitude: 41.643457
Decimal() | Float
What is the Data type for:
Longitude: -111.917649
Float() | Decimal()
What is the Data type for:
Elevation: 1365 m
int(), since if we use “varchar” it becomes complex, as the user needs to know what unit they should use.
What is the Data type for:
State: UTAH
char()
What is the Data type for:
County: Cache
char()
What is the Data type for:
Description:: Attached to SR101 bridge
varchar()
What is the Data type for:
Site type: Stream
char()
What is the symbol for Zero to Many Crows foot
—–o-<– |
What is the symbol for the One to Many Crows Foot
——|–<–
What is the symbol for one to one crows foot
——|-|–
What is the symbol for Zero to One Crows Foot
—–o–|–
- Multiple notation systems are used
- Each software program is a little different
- Most common is “Crows Foot”
ER Diagram Relationship Notation
Maximum number of times an instance in one entity can be associated with instance in the related entitiy
Cardinality
Minimum number of times an instance in one entity can be associated with instance in the related entity
Participation
- Can ONLY have values of 1 or many
- Located closest to the entity in Crows Foot notation
Cardinality
- Indicates whether an instance of an entity MUST participate in the relationship
- Can ONLY have the values of 0 or 1
Participation
- Each row in a table should have an attribute that is a persistent, unique identifier - the ____
Primary Key
Primary Key is in the ____ Table
Parent
Foreign key is in the _____ Table
Child
Primary key usually consist of what data type
Int() | Integer Values
What are the categories of data model
- Relational Model
- ER Model
- Object Based Model
- Semi Structured Model
- Collection of Tables
- Tables represent both data and relationships
- Multiple columns with unique names
- Tables = Relations
- Record-Based model - fixed format records of several types
- Each record type defines a fixed number of fields, or attributes
- Most widely used
Relational MOdel
- Collection of basic objects called entities and its relationships
- An entity is a real world thing or object
- Distinguishable from the other objects
- Widely used in database design
Entity-Relationship Model
- OOP Languages - C++, Java, C#, etc
- Need for Object Oriented Data model
- Object Based model = ER model and Object Oriented Features
- Object Relational Data Model = Object Based Model + Relational MOdel
Object-Based Model
- Specification of data
- Individual data items of the same type may have different sets of attributes
- Usign of 2 different languages
- Contrast to ER Model, Relational MOdel and Object Orirented Model
- XML
Semistructure Data Model
Steps in Data Model Design
- Identify entities
- Identify relationships among entities
- Determine the cardinality and participation of relationships
- Designate keys / identifiers for entities
- List attributes of entities
- Identify constraints and business rules