Database and Data Models


Concept of Data Models (1)

  • Name
    Data Model
    Type
    Description
    • A conceptual model that simplifies and abstracts real-world information to systematically represent it, in order to express it logically in a computerized format.
    • Used as an intellectual tool in the process of database design to logically represent the structure (schema) of data.
  • Name
    Components of Data Models
    Type
    Description
    • Entities
    • Attributes
    • Relationships
  • Name
    Types of Data Models
    Type
    Description
    • Conceptual Data Model: Process of representing real-world understanding with abstract concepts (E-R model is a representative one).
    • Logical Data Model: Process of transforming conceptual structures into a computerized environment that computers can understand and process.
    • Physical Data Model
  • Name
    Elements of Data Model Representation
    Type
    Description
    • Structure: Represents the structure of data and its static characteristics as relationships between logically represented entity types.
    • Operations: Basic tools supporting database operations by specifying the work of processing actual data.
    • Constraints: Logical constraints of actual data maintained by the database.
데이터 모델의 개념

Components of Data Models (2)

  • Name
    Entity
    Type
    Description
    • Something represented in the database, a unit of concept or information
    • Identified by identifiers
    • Has one or more relationships with other entities

    Additional Explanation about Entities

    1. Entity Type: Definition of an entity described only by attributes
    2. Entity Instance: Constructs an entity, each attribute has a value, representing a single entity
    3. Entity Set: Collection of entity instances
  • Name
    Attribute
    Type
    Description
    • Smallest logical unit that makes up a database
    • Corresponds to a data item or data field
    • The number of attributes is referred to as "dimensions" or "degrees"

    For instance, if attributes make up a game, you can structure attributes like the type of game, creation date, and whether it's free.

    Entity Composition of Attributes

    1. Primary Key Attribute: Attribute that uniquely identifies an entity
    2. Foreign Key Attribute: Attribute included in relation with other entities
  • Name
    Relationship
    Type
    Description
    • Logical connection between entities
    • There are relationships between entities and relationships between attributes

    Forms of Relationships

    1. 1:1 (One-to-One): Each element in entity set A corresponds to one element in entity set B
    2. 1:N (One-to-Many): Each element in entity set A corresponds to multiple elements in entity set B, but each element in entity set B corresponds to one element in entity set A
    3. N:N (Many-to-Many): Each element in entity set A corresponds to multiple elements in entity set B, and each element in entity set B corresponds to multiple elements in entity set A

    Types of Relationships

    1. Dependency Relationship: Represents a dependency between two entities
    2. Duplicate Relationship: Two or more dependent relationships occur between two entities
    3. Recursive Relationship: Entity has a relationship with itself, also known as a circular relationship
    4. Exclusive Relationship: Can be categorized into AND and OR relationships
데이터 검증

Identifier (3)

  • Name
    Identifier
    Type
    Description
    • Identifier that uniquely identifies each instance within a single entity
    • Every entity must have at least one identifier.
  • Name
    Candidate Identifier
    Type
    Description
    • Attribute or set of attributes within an entity that can uniquely identify each instance
    • An entity may have multiple candidate identifiers, with one representing the primary key and others called secondary identifiers to indicate their representativeness.

    Characteristics of Primary Key

    1. Uniqueness: Must uniquely identify an entity.
    2. Minimality: Must be composed of the minimal number of attributes while maintaining uniqueness.
    3. Immutability: Once a primary key is specified, its identifier does not change.
    4. Existence: Once a primary key is specified, data must exist for the attributes.

E-R Model (4)

  • Name
    E-R (Entity-Relationship) Model
    Type
    Description
    • Proposed by Peter Chen and established its fundamental components.
    • It's a representative conceptual data model.
    • Describes data in the form of entities, relationships, and attributes.
    • Represented using E-R diagrams, can depict 1:1, 1:N, N:N relationship types without restrictions.
  • Name
    E-R Diagram
    Type
    Description
    • Square: Entity type
    • Diamond: Relationship type
    • Ellipse: Attribute
    • Relationship: Indicate the numbers corresponding to 1:1, 1:N, N:N relationships on the lines
ER 다이어그램

Relational Database Structure / Relational Data Model (5)

  • Name
    Relational Database
    Type
    Description
    • A database that uses two-dimensional tables to define relationships between data.
    • Both entities and relationships are represented using tables called relations, so entities have both entity relations and relationship relations.
  • Name
    Structure of Relational Database Relations
    Type
    Description
    • A relation represents data in the format of a table and consists of a relation schema and actual values called relation instances.
  • Name
    Tuple
    Type
    Description
    • Each row that makes up a relation.
    • The number of tuples is referred to as "cardinality" or "degree."
  • Name
    Attribute
    Type
    Description
    • The smallest logical unit that makes up a database.
    • Attributes describe characteristics of entities.
    • The number of attributes is referred to as "degree" or "cardinality."
  • Name
    Domain
    Type
    Description
    • A set of atomic values that an attribute can take.

    For example, if an attribute called "gender" can have values "male" and "female," the domain would include the set male, female.

  • Name
    Characteristics of Relations
    Type
    Description
    • To uniquely identify the tuples comprising a relation, a subset of attributes called a key is defined.
    • Attribute values only store indivisible atomic values logically.
  • Name
    Relational Data Model
    Type
    Description
    • The most widely used data model.
    • Represents relationships between data using primary keys and foreign keys.
    • SQL is the representative language of the relational model.
    • Allows representation of relationships as 1:1, 1:N, N:M freely.
관계형 데이터베이스의 구조 그리고 관계형 데이터 모델