translation

This is an AI translated post.

제이의 블로그

Logical Data Modeling

Select Language

  • English
  • 汉语
  • Español
  • Bahasa Indonesia
  • Português
  • Русский
  • 日本語
  • 한국어
  • Deutsch
  • Français
  • Italiano
  • Türkçe
  • Tiếng Việt
  • ไทย
  • Polski
  • Nederlands
  • हिन्दी
  • Magyar

Summarized by durumis AI

  • Logical data modeling is the process of transforming a conceptual data model into the relational database paradigm based on mapping rules.
  • It explains how to handle 1:1, 1:N, and N:M relationships in relational databases, the method of creating intermediate tables, and the importance of normalization, providing a detailed explanation of the three stages (1NF, 2NF, 3NF).
  • It clearly presents the objectives and principles of each normalization stage, particularly detailing the process of eliminating transitive dependencies in the third normalization.

Unlike requirements analysis and conceptual data modeling, logical data modeling is a more mechanical process.

The process mainly involves converting the ERD, a conceptual data modeling output, to conform to the relational database paradigm based on mapping rules.

Mapping Rules

  • Rectangular entities are converted to tables.
  • Circular attributes are converted to columns.
  • Relationships are converted to PK or FK.

First of all, it is easier to express tables without FKs.

Relationships

  • Express the relationships between tables considering cardinality and optionality.
  • Express the relationships in order from the simplest relationship, the 1:1 relationship, to the 1:N relationship and then the N:M relationship.

1:1 Relationship Handling

In a 1:1 relationship, the dependency relationship between the two tables is examined and FK is set.

They can be seen as parent and child tables.

1:N Relationship Handling

In a 1:N relationship, N refers to 1, so FK is set to N.

N:M Relationship Handling

In order to handle N:M relationships in relational databases, a middle table (also called a mapping table or a join table) is created and expressed.

The important point here is that the cardinality and optionality of both tables referenced by the mapping table must be expressed.

Normalization

Wikipedia - Database Normalization

It is the process of transforming unrefined tables into tables suitable for relational databases.

The normalization process used industrially is up to the third normalization process, and normalization processes beyond that are mainly used academically.

Normalization should be done sequentially, one step at a time.

First Normal Form (1NF)

  • Columns belonging to the table should have only atomic values.

Looking at the main principle of the first normalization, it is hard to understand what it means, but it simply means that each column should have only one value.

If there are multiple values in one column, that is, if it is not atomic, it can be difficult to join with SQL statements and can cause various problems.

Second Normal Form (2NF)

  • It must satisfy the first normalization.
  • Partial dependency must be eliminated.

If there are duplicate values in the table rows, find the column that the row depends on and separate it.

Third Normal Form (3NF)

  • It must satisfy the first normalization.
  • It must satisfy the second normalization.
  • Transitive dependency must be eliminated.

The term transitive dependency is very difficult to understand. From what I understand, if there are one or more values in a particular table that implicitly imply the identifier of another table (excluding FK, of course), it seems to be called a transitive dependency.

Jay
제이의 블로그
1인분이 목표인 초보 개발자
Jay
Kanban Board Project 2 Logical Data Modeling This document explains how to perform logical data modeling based on the conceptual data modeling ERD, step by step, and proposes solutions to difficulties that arise during the normalization process. In particular, it discusses in detail the consideratio

April 9, 2024

Conceptual Data Modeling Conceptual data modeling is the process of separating entities, defining attributes, and expressing relationships between entities as ERD. An entity is an independent unit of information, and an attribute is the data that an entity has. An identifier uniq

April 8, 2024

Relational Data Modeling Relational data modeling is the process of dividing real-world information into tables and data, going through the stages of requirement analysis, conceptual data modeling, logical data modeling, and physical data modeling. Conceptual modeling is visualiz

April 8, 2024

[Effective Java] Item 5. Use Dependency Injection instead of Hard-Coding Resources If a class relies on external resources, it is not recommended to use singletons or static utility classes. Dependency injection can be used to improve the class's flexibility, reusability, and testability, and using the factory method pattern can lead to
제이온
제이온
제이온
제이온

April 28, 2024

[Effective Java] Item 2. Consider a Builder if Your Constructor Has Many Parameters When creating objects with many parameters, using the builder pattern can make your code cleaner and easier to read. You create a builder object with required parameters, set optional parameters using setter methods, and then call the build() method to co
제이온
제이온
제이온
제이온

April 27, 2024

[Objects] Chapter 1. Objects, Design In software development, practice is more important than theory, and good design makes code easier to understand and more adaptable to changes. Object oriented design provides a way to properly manage dependencies between collaborating objects, which can
제이온
제이온
제이온
제이온

April 28, 2024

[Effective Java] Item 1: Consider Static Factory Methods Instead of Constructors Static factory methods provide a flexible and efficient way to create instances instead of constructors. They can have names, return instances that meet specific conditions, and improve performance through caching. Unlike the singleton pattern, they can c
제이온
제이온
제이온
제이온

April 27, 2024

[Objects] Chapter 2. Object-Oriented Programming This document explains the object-oriented programming methodology for implementing a movie reservation system, covering concepts such as collaboration, objects, classes, inheritance, polymorphism, abstraction, and composition. It presents methods for sec
제이온
제이온
제이온
제이온

April 28, 2024

Is 'Sherlock's' Appearance Possible? Sherlock Holmes's deductive reasoning is dramatic, but in reality it can be dangerous because it requires consideration of complex factors. In business consulting, problems can be solved through deductive, inductive, and abductive approaches, and the suit
Byungchae Ryan Son
Byungchae Ryan Son
Byungchae Ryan Son
Byungchae Ryan Son
Byungchae Ryan Son

May 22, 2024