Data Models Flashcards
File System, Hierarchical & Network, Relational, Similarities & Diff between data models
Data model
Different levels of complexity/detail will be specified in the
conceptual & logical models, for schemas, and the
physical models
Entities
anything about which data are to
be collected and stored - each instance is unique and distanct
nouns (ex: teacher, student)
Attribute
characteristic of an entity
organized as columns in a table that is
about the entity and describes the entity
Relationship
association among entities
Between any two entities there is some type of
relationship (it could be “none”).
Types of relationships
one-to-one, one-to-many, many-to-many
One-to-one relationship
each record in Table1 is related to one record in Table2; each record in Table2
is related to one record in Table1
One-to-many relationship
each record in Table1 may be related to several records in Table2. Each
record in Table2 is related to one record in Table1
Many-to-many relationship
each record in Table1 may be
related to several records in Table2, and each record in Table2 may be
related to several records in Table1
How are relationships formed?
through common attributes
key attributes
primary key & forgein key
primary key
attribute (or combination of attributes) that
uniquely identifies any given row
each table must have this type of attribute
forgein key
attribute whose
values match the primary key values in a
related table
True or False: It is harder to achieve logical data independence than physical data independence
True
Constraint
restriction placed on the data
this helps ensure data integrity
Data Model Types
hierarchical (parent-child), network, entity-relational
hierarchical (parent-child)
This model organizes data in a tree-like structure, where each record has a single parent, and each parent can have multiple child records. This creates a strict hierarchy
Pros: Simple, fast, and efficient for hierarchical data.
Cons: Lack of flexibility, as each child can have only one parent, making it difficult to model more complex relationships.
network
The network model is more flexible than the hierarchical model. It uses a graph-like structure where entities are represented as nodes, and the relationships between them are shown as arcs or links. Unlike the hierarchical model, an entity can have multiple parents and multiple children.
pros: Flexible and supports complex relationships like many-to-many.
cons: More complicated to implement and manage than hierarchical models.
entity-relational
The ER model is a conceptual and high-level model for representing data. It uses entities (objects or things) and relationships between them. Entities are connected by relationships, and each relationship can have attributes.
Pros: Conceptual and flexible, useful for designing databases, and easy to visualize with ER diagrams.
Cons: It’s abstract and doesn’t describe how data is physically stored.
data modeling steps
- Business rules, use cases (human-readable description of data)
- Conceptual model (global view of entire DB w/entities, relationships, and constraints)
- Logical Model (ER diagram)
Differences between all data models?
- hierarchy = rigid
- network = flexible & allows M-M relationships
- er = abstract & conceptual