DB Schema / ERD

효딩딩·2022년 10월 24일
0

DB Schema 란?

  • 데이터 베이스의 구조와 제약조건에 관해 전반적인 명세를 기술한 것
  • 개체의 특성을 나타내는 속성(Attribute)과, 속성들의 집합으로 이루어진 개체(Entity), 개체 사이에 존재하는 관계(Relation)에 대한 정의와 이들이 유지해야 할 제약 조건을 기술한 것임
  • DB 내에 어떤 구조로 데이터가 저장되는가를 나타내는 데이터베이스 구조를 '스키마' 라고 함

스키마의 특징

  • 스키마는 특정 데이터 모델을 이용해서 만들어짐
  • 스키마는 시간에 따라 불변인 특성을 가짐
  • 스키마는 데이터의 구조적 특성을 의미하며, 인스턴스에 의해 규정됨

ERD 란 무엇인가?

  • 개체-관계 모델
  • 테이블간의 관계를 설명해주는 다이어그램
  • 이를 통해 프로젝트에서 사용되는 DB의 구조를 한눈에 파악할 수 있음
  • API를 효율적으로 뽑아내기 위한 모델 구조도

ERD 관계 표기 방식

ERD에는 여러 기호들로 관계를 표현할 수 있음.

One
일대일 혹은 일대다 관계입니다.

Many
다대다 관계입니다.

One(and only one)
위의 조건과 동일하게 일대일 관계이나, 하나의 row끼리만 연결된 데이터

Zero or one
일대일 혹은 일대다 관계를 가지고 있으나, 필수 조건이 아님을 의미

One or Many
일대일 혹은 다대다 관계를 가지고 있음을 의미

Zero or Many
참조하는 테이블과의 관계가 불명확한 경우. 장바구니처럼 row 생성값이 없을수도, 하나일수도, 여러개일 수도 있는 경우

출처:
https://blog.naver.com/togangee/222417875907
https://blog.naver.com/tonawood/222909585557
https://iingang.github.io/posts/DB-schema/
https://velog.io/@cneycal/DB-Schema-ERD


(영문 해석)

What is DB Scheme?

  • A database schema defines how data is organized within a relational database; this is inclusive of logical constraints such as, table names, fields, data types, and the relationships between these entities.
  • Schemas commonly use visual representations to communicate the architecture of the database, becoming the foundation for an organization’s data management discipline.
  • This process of database schema design is also known as data modeling.

What is ERD (Entity Relational Diagram)?

  • Shows links between the entities and the kind of relation between them. We are not talking about tables or keys there!
  • Usually the entity relationship diagram follows Merise model. Database manager and developer as myself usually build an entity relationship model before conceiving the relational model/diagram.
  • ERDs are meant to summarize & clarify understanding for End Users and Business SMEs (again, NOT the DBAs or Developers)

Source:
https://www.ibm.com/cloud/learn/database-schema
https://stackoverflow.com/questions/17641134/what-is-different-between-er-diagram-and-database-schema

profile
어제보다 나은 나의 코딩지식

0개의 댓글