{
    "componentChunkName": "component---src-templates-blog-template-js",
    "path": "/db-er-model/",
    "result": {"data":{"cur":{"id":"860f1c6d-6c1d-59f6-b6bf-22f80807a471","html":"<h2 id=\"-database-design-process\" style=\"position:relative;\"><a href=\"#-database-design-process\" aria-label=\" database design process permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>🎞 Database Design Process</h2>\n<h4 id=\"1-요구사항-수집-및-분석\" style=\"position:relative;\"><a href=\"#1-%EC%9A%94%EA%B5%AC%EC%82%AC%ED%95%AD-%EC%88%98%EC%A7%91-%EB%B0%8F-%EB%B6%84%EC%84%9D\" aria-label=\"1 요구사항 수집 및 분석 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>1. 요구사항 수집 및 분석</h4>\n<h4 id=\"2-conceptual-design\" style=\"position:relative;\"><a href=\"#2-conceptual-design\" aria-label=\"2 conceptual design permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>2. Conceptual Design</h4>\n<h4 id=\"3-logical-designor-data-model-mapping\" style=\"position:relative;\"><a href=\"#3-logical-designor-data-model-mapping\" aria-label=\"3 logical designor data model mapping permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>3. Logical Design(or Data model mapping</h4>\n<h4 id=\"4-physical-design\" style=\"position:relative;\"><a href=\"#4-physical-design\" aria-label=\"4 physical design permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>4. Physical Design</h4>\n<hr>\n<h2 id=\"️-entity-relationshiper-model\" style=\"position:relative;\"><a href=\"#%EF%B8%8F-entity-relationshiper-model\" aria-label=\"️ entity relationshiper model permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>💁‍♀️ Entity-Relationship(ER) model</h2>\n<p>데이터를 <strong>Entity, Relationship, Attribute</strong> 로 표현</p>\n<ul>\n<li>\n<h3 id=\"entity\" style=\"position:relative;\"><a href=\"#entity\" aria-label=\"entity permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Entity</h3>\n<p>ER model의 기본 컨셉으로, 구체적인 객체를 의미한다.</p>\n<ul>\n<li>\n<p><strong>Entity Type</strong> : 비슷한 속성을 가진 entity의 타입 (schema 같은 느낌)<br>\nex) EMPLOYEE, COMPANY</p>\n<blockquote>\n<h4 id=\"weak-entity-type\" style=\"position:relative;\"><a href=\"#weak-entity-type\" aria-label=\"weak entity type permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Weak Entity Type</h4>\n<p>자기 자신을 위한 key attribute를 갖지 않는 entity type으로 항상 total participation을 맺음<br>\n( ER diagram에서 네모 두 개로 표현 )</p>\n<ul>\n<li><strong>partial key</strong> : weak entity를 식별할 수 있는 attribute로, owner entity type의 key와 합쳐서 표현되어야 함. (점선 밑줄로 표현)</li>\n</ul>\n</blockquote>\n</li>\n<li>\n<p><strong>Entity Set</strong> : 특정한 순간에 데이터베이스에 있는 특정 entity type의 entity 집합 (state 같은 느낌)<br>\nex) EMPLOYEE: e1, e2, …</p>\n</li>\n</ul>\n</li>\n<li>\n<h3 id=\"attribute\" style=\"position:relative;\"><a href=\"#attribute\" aria-label=\"attribute permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Attribute</h3>\n<p>entity를 설명하는 특성으로, entity는 각각 attribute마다 특정한 값을 가진다.<br>\n각각의 attribute는 value set(or data type)을 가진다.</p>\n<blockquote>\n<ul>\n<li>\n<h4 id=\"attribute-type\" style=\"position:relative;\"><a href=\"#attribute-type\" aria-label=\"attribute type permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Attribute Type</h4>\n<ul>\n<li><strong>Simple (atomic)</strong>\nex) SSN</li>\n<li><strong>Composite</strong> : attribute가 여러 개의 요소들로 이루어진 경우<br>\nex) Name(FirstName, LastName)</li>\n<li><strong>Multi-valued</strong> : attribute가 여러 개의 value를 가지는 경우<br>\nex) {Color}</li>\n</ul>\n</li>\n</ul>\n</blockquote>\n<ul>\n<li><strong>Stored attribute</strong><br>\n: 값이 직접 저장된 attribute</li>\n<li><strong>Derived attribute</strong><br>\n: 저장된 값으로부터 파생되는 attribute</li>\n<li><strong>Complex attribute</strong><br>\n: composite attribute와 multi-valued attribute의 중첩</li>\n<li><strong>Key attribute</strong><br>\n: 각 entity가 고유한 값을 가지고, 고유하게 식별될 수 있는 특성 (하나 이상 가질 수 있음)</li>\n<li><strong>Value Sets (Domains) of Attribute</strong><br>\n: attribute마다 값들이 가져야 되는 domain<br>\nex) 날짜의 경우에는 <em><strong>MM-DD-YYYY</strong></em> 같은 경우가 domain</li>\n</ul>\n</li>\n</ul>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 720px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 55.55555555555556%; position: relative; bottom: 0; left: 0; background-image: url('data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAALABQDASIAAhEBAxEB/8QAFwAAAwEAAAAAAAAAAAAAAAAAAAECBf/EABQBAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhADEAAAAd1UihB//8QAFxABAQEBAAAAAAAAAAAAAAAAAAEQQf/aAAgBAQABBQJcrkf/xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAEDAQE/AT//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAECAQE/AT//xAAUEAEAAAAAAAAAAAAAAAAAAAAg/9oACAEBAAY/Al//xAAYEAADAQEAAAAAAAAAAAAAAAAAASExEf/aAAgBAQABPyF6yucFhgTopH//2gAMAwEAAgADAAAAEGDP/8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAwEBPxA//8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAgEBPxA//8QAGxABAQEAAgMAAAAAAAAAAAAAAREAITFBYYH/2gAIAQEAAT8QAQOZilBvrxri37hEncyLLyZor3v/2Q=='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"entity-notation.jpg\"\n        title=\"entity-notation.jpg\"\n        src=\"/static/abc477686b55f0ad59fe571c961aba13/80e3c/entity-notation.jpg\"\n        srcset=\"/static/abc477686b55f0ad59fe571c961aba13/4ec73/entity-notation.jpg 180w,\n/static/abc477686b55f0ad59fe571c961aba13/158ba/entity-notation.jpg 360w,\n/static/abc477686b55f0ad59fe571c961aba13/80e3c/entity-notation.jpg 720w,\n/static/abc477686b55f0ad59fe571c961aba13/31be4/entity-notation.jpg 806w\"\n        sizes=\"(max-width: 720px) 100vw, 720px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n        decoding=\"async\"\n      />\n    </span></p>\n<ul>\n<li>\n<h3 id=\"relationship\" style=\"position:relative;\"><a href=\"#relationship\" aria-label=\"relationship permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Relationship</h3>\n둘 이상의 구별되는 entity들을 특정한 의미로 연관시키는 것\n<ul>\n<li>\n<p><strong>Relationship type R (관계 유형)</strong> : entity들이 어떻게 연관되어 있는지에 대한 유형<br>\nex) WORKS_ON, WORKS_FOR</p>\n<blockquote>\n<p><strong>Degree of relationship type</strong><br>\n: relationship에 참여하고 있는 entity type의 수<br>\nex) Unary (1) (for self), Binary (2) (involving two), Tertiary (about three), …</p>\n</blockquote>\n</li>\n<li>\n<p><strong>Relationship set R (관계 집합)</strong> : relationship instance들의 집합</p>\n</li>\n</ul>\n</li>\n</ul>\n<hr>\n<h2 id=\"-structural-constraints-on-binary-relationship-types\" style=\"position:relative;\"><a href=\"#-structural-constraints-on-binary-relationship-types\" aria-label=\" structural constraints on binary relationship types permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>🚧 Structural Constraints on Binary Relationship Types</h2>\n<ul>\n<li>\n<h3 id=\"cardinality-ratio\" style=\"position:relative;\"><a href=\"#cardinality-ratio\" aria-label=\"cardinality ratio permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Cardinality ratio</h3>\n<p>entity가 참여하는 relationship instance들의 최대 수 지정<br>\nex) 1:1, 1:N, N:1, M:N</p>\n</li>\n<li>\n<h3 id=\"participation-constraint\" style=\"position:relative;\"><a href=\"#participation-constraint\" aria-label=\"participation constraint permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Participation constraint</h3>\n<p>관계를 맺는 두 entity type에 대해 한 entity가 존재하려면 다른 entity에 의존해야 하는지 여부를 나타냄 (최소 수)</p>\n<ul>\n<li><strong>Total Participation</strong> : 모두 참여 (double line으로 표현)</li>\n<li><strong>Partial Participation</strong> : 일부 참여 (double line으로 표현)</li>\n</ul>\n</li>\n</ul>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 720px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 54.44444444444444%; position: relative; bottom: 0; left: 0; background-image: url('data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAALABQDASIAAhEBAxEB/8QAFwABAQEBAAAAAAAAAAAAAAAAAAECBf/EABQBAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhADEAAAAe9NQoP/xAAUEAEAAAAAAAAAAAAAAAAAAAAg/9oACAEBAAEFAl//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAEDAQE/AT//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAECAQE/AT//xAAUEAEAAAAAAAAAAAAAAAAAAAAg/9oACAEBAAY/Al//xAAYEAEAAwEAAAAAAAAAAAAAAAABABARMf/aAAgBAQABPyFojyAZX//aAAwDAQACAAMAAAAQQ8//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAEDAQE/ED//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAECAQE/ED//xAAdEAABBAIDAAAAAAAAAAAAAAABABEhMRBBUXGR/9oACAEBAAE/EImO9pnG74KopEmS/Tj/2Q=='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"relationship-notation.jpg\"\n        title=\"relationship-notation.jpg\"\n        src=\"/static/0d331686259ecbf81075d722d4c455e0/80e3c/relationship-notation.jpg\"\n        srcset=\"/static/0d331686259ecbf81075d722d4c455e0/4ec73/relationship-notation.jpg 180w,\n/static/0d331686259ecbf81075d722d4c455e0/158ba/relationship-notation.jpg 360w,\n/static/0d331686259ecbf81075d722d4c455e0/80e3c/relationship-notation.jpg 720w,\n/static/0d331686259ecbf81075d722d4c455e0/f2bdc/relationship-notation.jpg 834w\"\n        sizes=\"(max-width: 720px) 100vw, 720px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n        decoding=\"async\"\n      />\n    </span></p>\n<div class=\"table-of-contents\">\n<ul>\n<li>\n<p><a href=\"#-database-design-process\">🎞 Database Design Process</a></p>\n<ul>\n<li>\n<ul>\n<li><a href=\"#1-%EC%9A%94%EA%B5%AC%EC%82%AC%ED%95%AD-%EC%88%98%EC%A7%91-%EB%B0%8F-%EB%B6%84%EC%84%9D\">1. 요구사항 수집 및 분석</a></li>\n<li><a href=\"#2-conceptual-design\">2. Conceptual Design</a></li>\n<li><a href=\"#3-logical-designor-data-model-mapping\">3. Logical Design(or Data model mapping</a></li>\n<li><a href=\"#4-physical-design\">4. Physical Design</a></li>\n</ul>\n</li>\n</ul>\n</li>\n<li>\n<p><a href=\"#%EF%B8%8F-entity-relationshiper-model\">💁‍♀️ Entity-Relationship(ER) model</a></p>\n</li>\n<li>\n<p><a href=\"#-structural-constraints-on-binary-relationship-types\">🚧 Structural Constraints on Binary Relationship Types</a></p>\n</li>\n</ul>\n</div>","excerpt":"🎞 Database Design Process 1. 요구사항 수집 및 분석 2. Conceptual Design 3. Logical Design(or Data model mapping 4. Physical Design 💁‍♀️ Entity-Relationship(ER) model 데이터를 Entity, Relationship, Attribute 로 표현 Entity ER model의 기본 컨셉으로, 구체적인 객체를 의미한다. Entity Type : 비슷한 속성을 가진 entity의 타입 (schema 같은 느낌) ex) EMPLOYEE, COMPANY Weak Entity Type 자기 자신을 위한 key attribute를 갖지 않는 entity type으로 항상 total participation을 맺음 ( ER diagram에서 네모 두 개로 표현 ) partial key : weak entity를 식별할 수 있는 attribute로, owner entity type의 key와 …","frontmatter":{"date":"December 07, 2021","title":"[Database] Entity-Relationship(ER) Model","categories":"Database","author":"JFe","emoji":"💁‍♀️"},"fields":{"slug":"/db-er-model/"}},"next":{"id":"8cee292d-045e-5407-a06a-9a810f44bcf2","html":"<h3 id=\"data-model\" style=\"position:relative;\"><a href=\"#data-model\" aria-label=\"data model permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Data Model</h3>\n<p><strong>데이터 추상화</strong>를 달성하기 위해 필요한 수단 제공<br>\n데이터베이스의 <strong>구조(data types, relationships)</strong>, 이런 구조를 조작하기 위한 <strong>연산</strong>, 데이터베이스가 가져야 할 <strong>제약조건</strong>의 집합으로 구성</p>\n<h2 id=\"-data-model-종류\" style=\"position:relative;\"><a href=\"#-data-model-%EC%A2%85%EB%A5%98\" aria-label=\" data model 종류 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>📚 Data Model 종류</h2>\n<ul>\n<li>\n<h3 id=\"conceptual-data-models\" style=\"position:relative;\"><a href=\"#conceptual-data-models\" aria-label=\"conceptual data models permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Conceptual data models</h3>\n<p>다수의 사용자가 데이터를 인식하는 방법과 비슷하게 개념(entity, attribute, relationship 등)을 제공<br>\nentity-based or object-based data model이라고도 불림 (<em><strong>ER model</strong></em>)<br>\n<strong>high-level, semantic</strong></p>\n</li>\n<li>\n<h3 id=\"physical-data-models\" style=\"position:relative;\"><a href=\"#physical-data-models\" aria-label=\"physical data models permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Physical data models</h3>\n<p>데이터가 컴퓨터 저장매체에 어떻게 저장되는지에 관한 자세한 정보들을 제공<br>\n<strong>low-level, internal</strong></p>\n</li>\n<li>\n<h3 id=\"implementation-data-models\" style=\"position:relative;\"><a href=\"#implementation-data-models\" aria-label=\"implementation data models permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Implementation data models</h3>\n<p>개념적 모델을 컴퓨터가 처리할 수 있도록 변환<br>\n관계형데이터모델, 네트워크/계층 모델 등이 있음<br>\n<strong>representational, logical</strong></p>\n</li>\n<li>\n<h3 id=\"self-describing-data-models\" style=\"position:relative;\"><a href=\"#self-describing-data-models\" aria-label=\"self describing data models permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Self-Describing data models</h3>\n<p>데이터 description과 데이터 값들을 연결<br>\nNoSQL 시스템에서 주로 사용</p>\n</li>\n</ul>\n<hr>\n<h2 id=\"-schema--instance\" style=\"position:relative;\"><a href=\"#-schema--instance\" aria-label=\" schema  instance permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>📜 Schema &#x26; Instance</h2>\n<h3 id=\"database-schema\" style=\"position:relative;\"><a href=\"#database-schema\" aria-label=\"database schema permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Database Schema</h3>\n<p>데이터베이스 구조, 데이터 타입, 제약조건에 대한 설명을 기술한 <strong>메타데이터</strong>의 집합으로<br>\n데이터베이스 설계 중 지정되면 거의 변경되지 않음</p>\n<h3 id=\"database-instance\" style=\"position:relative;\"><a href=\"#database-instance\" aria-label=\"database instance permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Database Instance</h3>\n<p><strong>특정한 순간</strong>에 데이터베이스에 저장되어 있는 실제 데이터로<br>\n<em><strong>Database State</strong></em>라고도 불림</p>\n<blockquote>\n<p><strong>Initial Database State</strong> : DBMS에 처음 불려왔을 때의 state<br>\n<strong>Valid State</strong> : 데이터베이스의 구조와 제약조건을 만족하는 state</p>\n</blockquote>\n<hr>\n<h2 id=\"-three-schema-architecture\" style=\"position:relative;\"><a href=\"#-three-schema-architecture\" aria-label=\" three schema architecture permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>🚦 Three-Schema Architecture</h2>\n<p><a href=\"https://jfelog.netlify.app/db-introduction/#-db-%EC%8B%9C%EC%8A%A4%ED%85%9C%EC%9D%98-%EC%A3%BC%EC%9A%94-%ED%8A%B9%EC%A7%95\">DB 시스템의 주요 특징</a> 중 1 ~ 3번을 만족하기 위한 구조로<br>\n사용자 어플리케이션과 물리적 데이터베이스를 분리시키기 위한 목적을 가지고 있다.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 709px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 53.888888888888886%; position: relative; bottom: 0; left: 0; background-image: url('data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAALABQDASIAAhEBAxEB/8QAGAAAAgMAAAAAAAAAAAAAAAAAAAMBAgX/xAAUAQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIQAxAAAAHdi6xoB//EABcQAAMBAAAAAAAAAAAAAAAAAAACMRD/2gAIAQEAAQUCLq0//8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAwEBPwE//8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAgEBPwE//8QAFBABAAAAAAAAAAAAAAAAAAAAIP/aAAgBAQAGPwJf/8QAGhABAAIDAQAAAAAAAAAAAAAAARARACExUf/aAAgBAQABPyFtUvPBqesf/9oADAMBAAIAAwAAABBgD//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQMBAT8QP//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQIBAT8QP//EABoQAQEAAgMAAAAAAAAAAAAAAAERECEAMWH/2gAIAQEAAT8QQVGu5Zwaooaum538cf/Z'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"three-schema.jpg\"\n        title=\"three-schema.jpg\"\n        src=\"/static/78bef189f7701a81b15f8557b62b0f05/bd958/three-schema.jpg\"\n        srcset=\"/static/78bef189f7701a81b15f8557b62b0f05/4ec73/three-schema.jpg 180w,\n/static/78bef189f7701a81b15f8557b62b0f05/158ba/three-schema.jpg 360w,\n/static/78bef189f7701a81b15f8557b62b0f05/bd958/three-schema.jpg 709w\"\n        sizes=\"(max-width: 709px) 100vw, 709px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n        decoding=\"async\"\n      />\n    </span></p>\n<ul>\n<li>\n<h3 id=\"internalphysical-schema\" style=\"position:relative;\"><a href=\"#internalphysical-schema\" aria-label=\"internalphysical schema permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Internal(physical) Schema</h3>\n<p>물리적인 storage 구조와 접근 경로에 대해 설명한다.<br>\n일반적으로 <strong>physical</strong> data model을 사용</p>\n</li>\n<li>\n<h3 id=\"conceptuallogical-schema\" style=\"position:relative;\"><a href=\"#conceptuallogical-schema\" aria-label=\"conceptuallogical schema permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Conceptual(logical) Schema</h3>\n<p>전체 데이터베이스의 구조와 제약조건들에 대해 설명한다.<br>\n일반적으로 <strong>conceptual(ex. ER)</strong> 이나 <strong>implementation(ex. relational)</strong> data model을 사용</p>\n</li>\n<li>\n<h3 id=\"externalview-level-schema\" style=\"position:relative;\"><a href=\"#externalview-level-schema\" aria-label=\"externalview level schema permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>External(view level) Schema</h3>\n<p>다양한 사용자 뷰에 대해 설명한다.<br>\n보통 conceptual schema와 같은 데이터 모델을 사용하고, 사용자가 관심있어 하는 부분에 대해서만 보여주고 나머지는 숨긴다.</p>\n</li>\n</ul>\n<p>실제로 요청이 들어오면 그 <strong>요청</strong>을 <strong>데이터</strong>로 변환하기 위해 <strong>Mapping</strong>이 필요하다.<br>\n실제 데이터는 physical level에만 존재하기 때문에 <strong>external schema</strong>로부터 요청이 들어오면 <strong>conceptual schema</strong>를 거쳐 <strong>internal schema</strong>에서 실제 데이터에 접근해 요청을 수행한다.</p>\n<hr>\n<h2 id=\"-data-independence\" style=\"position:relative;\"><a href=\"#-data-independence\" aria-label=\" data independence permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>🏳 Data Independence</h2>\n<p>데이터베이스 시스템에서 한 level의 schema가 변경되었을 때, 다른 상위 level의 schema 변경이 필요하지 않도록 독립되어 있는 것<br>\n상위 스키마의 변경 없이 해당 스키마와 상위 레벨 스키마 사이의 mapping만 변경하면 된다.</p>\n<ul>\n<li>\n<h3 id=\"logical-data-independence\" style=\"position:relative;\"><a href=\"#logical-data-independence\" aria-label=\"logical data independence permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Logical data independence</h3>\n<p>external schema 변경 없이 <em><strong>conceptual(logical) schema</strong></em>를 변경할 수 있는 능력</p>\n</li>\n<li>\n<h3 id=\"physical-data-independence\" style=\"position:relative;\"><a href=\"#physical-data-independence\" aria-label=\"physical data independence permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Physical data independence</h3>\n<p>conceptual(logical) schema 변경 없이 <em><strong>internal(physical) schema</strong></em>를 변경할 수 있는 능력</p>\n</li>\n</ul>\n<div class=\"table-of-contents\">\n<ul>\n<li>\n<ul>\n<li><a href=\"#data-model\">Data Model</a></li>\n</ul>\n</li>\n<li>\n<p><a href=\"#-data-model-%EC%A2%85%EB%A5%98\">📚 Data Model 종류</a></p>\n</li>\n<li>\n<p><a href=\"#-schema--instance\">📜 Schema &#x26; Instance</a></p>\n<ul>\n<li><a href=\"#database-schema\">Database Schema</a></li>\n<li><a href=\"#database-instance\">Database Instance</a></li>\n</ul>\n</li>\n<li>\n<p><a href=\"#-three-schema-architecture\">🚦 Three-Schema Architecture</a></p>\n</li>\n<li>\n<p><a href=\"#-data-independence\">🏳 Data Independence</a></p>\n</li>\n</ul>\n</div>","frontmatter":{"date":"December 06, 2021","title":"[Database] Data Model & Schema","categories":"Database","author":"JFe","emoji":"🤸‍♂️"},"fields":{"slug":"/db-model-schema/"}},"prev":{"id":"7e4b2db0-6a3b-5119-8e81-3eb6c3a5ce57","html":"<h2 id=\"-relational-model-concepts\" style=\"position:relative;\"><a href=\"#-relational-model-concepts\" aria-label=\" relational model concepts permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>🔗 Relational Model Concepts</h2>\n<ul>\n<li>\n<h3 id=\"relation\" style=\"position:relative;\"><a href=\"#relation\" aria-label=\"relation permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Relation</h3>\n<p>집합을 베이스로 한 수학적인 개념으로, <strong>table</strong>과 같은 역할을 한다.<br>\ntable처럼 여러 row와 column을 가지고 있는데 이때, row를 <em><strong>tuple</strong></em>, column을 <em><strong>attribute</strong></em>라고 부른다.<br>\nrelation은 튜플을 유일하게 식별할 수 있는 <em><strong>key</strong></em>를 가지고, 적합한 key가 없는 경우에는 임의의 key를 추가할 수 있는데 이것을 <strong>surrogate key(or artificial key)</strong> 라고 부른다.</p>\n</li>\n<li>\n<h3 id=\"schema\" style=\"position:relative;\"><a href=\"#schema\" aria-label=\"schema permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Schema</h3>\n<p><code class=\"language-text\">R(A_1, A_2, … , A_n)</code><br>\nR : relation 이름<br>\nA_1, A_2, … , A_n : attribute 리스트<br>\ndegree of relation R : R의 attribute 수</p>\n</li>\n<li>\n<h3 id=\"tuple\" style=\"position:relative;\"><a href=\"#tuple\" aria-label=\"tuple permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Tuple</h3>\n<p>값들이 정렬된 집합으로 &#x3C;…> 내부에 표현된다.<br>\n튜플의 값들은 알맞은 <strong>domain</strong>으로부터 나와야 한다.<br>\nattribute의 순서는 무조건 지켜져야 하지만, tuple의 순서는 중요하지 않다.<br>\ntuple의 모든 값들은 atomic 해야 한다. (Composite or multi-valued attribute는 안됨)</p>\n<blockquote>\n<h4 id=\"null-values-in-certain-tuples\" style=\"position:relative;\"><a href=\"#null-values-in-certain-tuples\" aria-label=\"null values in certain tuples permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>NULL values in certain tuples</h4>\n<ul>\n<li><strong>Unknown</strong> : 아직 모르는 경우</li>\n<li><strong>Not available</strong> : 아직 해당하는 값이 없는 경우 (ex. 휴대폰이 없어서 아직 번호가 없는 경우)</li>\n<li><strong>Inapplicable</strong> : 적용되지 않는 경우 (ex. 성별에 따라 적용이 되지 않는 항목이 있을 수 있음)</li>\n</ul>\n</blockquote>\n</li>\n<li>\n<h3 id=\"domain\" style=\"position:relative;\"><a href=\"#domain\" aria-label=\"domain permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Domain</h3>\n<p>atomic한 값의 집합으로, 해당 attribute가 가져야 되는 값들의 타입을 나타낸다.<br>\nex) 한국 폰 번호의 경우에는, <strong>01X-XXXX-XXXX</strong> 과 같은 형식</p>\n</li>\n<li>\n<h3 id=\"state\" style=\"position:relative;\"><a href=\"#state\" aria-label=\"state permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>State</h3>\n<p>attribute들마다 domain의 데카르트 곱(Cartesian product) 중 부분집합으로,<br>\nattribute들이 가질 수 있는 값들 중 <strong>실제로 가지고 있는 값들의 집합</strong>을 의미한다.</p>\n</li>\n</ul>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 602px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 56.666666666666664%; position: relative; bottom: 0; left: 0; background-image: url('data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAALABQDASIAAhEBAxEB/8QAFwABAQEBAAAAAAAAAAAAAAAAAAMBBf/EABUBAQEAAAAAAAAAAAAAAAAAAAEA/9oADAMBAAIQAxAAAAHsKySjRf/EABkQAAIDAQAAAAAAAAAAAAAAAAABAhExMv/aAAgBAQABBQJIfRRLT//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQMBAT8BP//EABURAQEAAAAAAAAAAAAAAAAAAAEQ/9oACAECAQE/ASf/xAAWEAADAAAAAAAAAAAAAAAAAAAAICH/2gAIAQEABj8CKv8A/8QAGxAAAQQDAAAAAAAAAAAAAAAAAAERITFBgaH/2gAIAQEAAT8hmrohG02RgYIiUf/aAAwDAQACAAMAAAAQlB//xAAVEQEBAAAAAAAAAAAAAAAAAAAQEf/aAAgBAwEBPxCH/8QAFREBAQAAAAAAAAAAAAAAAAAAEDH/2gAIAQIBAT8Qo//EABoQAQADAQEBAAAAAAAAAAAAAAEAESExQZH/2gAIAQEAAT8Q8IW11XOACtHqFz0TDj9YHvlHYhg5P//Z'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"relation-term.jpg\"\n        title=\"relation-term.jpg\"\n        src=\"/static/9297cf86e664322dadec84c7839af681/e49d1/relation-term.jpg\"\n        srcset=\"/static/9297cf86e664322dadec84c7839af681/4ec73/relation-term.jpg 180w,\n/static/9297cf86e664322dadec84c7839af681/158ba/relation-term.jpg 360w,\n/static/9297cf86e664322dadec84c7839af681/e49d1/relation-term.jpg 602w\"\n        sizes=\"(max-width: 602px) 100vw, 602px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n        decoding=\"async\"\n      />\n    </span></p>\n<hr>\n<h2 id=\"-constraints\" style=\"position:relative;\"><a href=\"#-constraints\" aria-label=\" constraints permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>🚨 Constraints</h2>\n<p>DB 무결성을 지키기 위해 사용되는 조건으로 크게 다음과 같이 3가지의 제약조건들이 있다.</p>\n<h4 id=\"1-inherent-or-implicit-constraints\" style=\"position:relative;\"><a href=\"#1-inherent-or-implicit-constraints\" aria-label=\"1 inherent or implicit constraints permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>1. Inherent or Implicit constraints</h4>\n<p>: data model 스스로 가지는 제약조건</p>\n<h4 id=\"2-schema-based-or-explicit-constraints\" style=\"position:relative;\"><a href=\"#2-schema-based-or-explicit-constraints\" aria-label=\"2 schema based or explicit constraints permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>2. Schema-based or Explicit constraints</h4>\n<p>: data model schema 자체에 직접적으로 명시되어 있는 제약조건</p>\n<h4 id=\"3-application-based-or-semantic-constraints\" style=\"position:relative;\"><a href=\"#3-application-based-or-semantic-constraints\" aria-label=\"3 application based or semantic constraints permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>3. Application-based or Semantic constraints</h4>\n<p>: data model과 상관없이 application 프로그램에서 강제되어야 하는 제약조건<br>\n=> application program에 명세하며, <em><strong>TRIGGER</strong></em>나 <em><strong>ASSERTION</strong></em>을 사용해서 해결</p>\n<p>이 중 <strong>Relational model</strong>에서의 제약조건들은 <strong>두 번째 제약조건</strong>에 해당한다.</p>\n<hr>\n<h2 id=\"-relational-integrity-constraints\" style=\"position:relative;\"><a href=\"#-relational-integrity-constraints\" aria-label=\" relational integrity constraints permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>🚨 Relational Integrity Constraints</h2>\n<h3 id=\"1-key-constraints-unique-constraints\" style=\"position:relative;\"><a href=\"#1-key-constraints-unique-constraints\" aria-label=\"1 key constraints unique constraints permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>1. Key constraints (Unique constraints)</h3>\n<p>: relation에서 모든 tuple들은 서로 유일하게 구별되어야 한다.</p>\n<blockquote>\n<ul>\n<li>\n<h4 id=\"super-key\" style=\"position:relative;\"><a href=\"#super-key\" aria-label=\"super key permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Super Key</h4>\n속성들의 집합으로 구성된 키로, 유일성을 만족<br>\n이 중, 최소성을 만족하는 것이 Key</li>\n<li>\n<h4 id=\"candidate-key\" style=\"position:relative;\"><a href=\"#candidate-key\" aria-label=\"candidate key permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Candidate Key</h4>\n튜플을 유일하게 식별할 수 있는 속성들의 부분집합<br>\n모든 relation은 반드시 하나 이상의 후보키를 가져야 함</li>\n<li>\n<h4 id=\"primary-key\" style=\"position:relative;\"><a href=\"#primary-key\" aria-label=\"primary key permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Primary Key</h4>\n후보키 중에서 선택한 주 키 (나머지는 unique key)<br>\nNull 값을 가질 수 없고, 동일한 값이 중복 저장될 수 없음</li>\n</ul>\n</blockquote>\n<h3 id=\"2-entity-integrity-constraints-엔터티-무결성-제약조건\" style=\"position:relative;\"><a href=\"#2-entity-integrity-constraints-%EC%97%94%ED%84%B0%ED%8B%B0-%EB%AC%B4%EA%B2%B0%EC%84%B1-%EC%A0%9C%EC%95%BD%EC%A1%B0%EA%B1%B4\" aria-label=\"2 entity integrity constraints 엔터티 무결성 제약조건 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>2. Entity integrity constraints (엔터티 무결성 제약조건)</h3>\n<p>: primary key는 NULL 값을 가질 수 없다.</p>\n<h3 id=\"3-refrential-integrity-constraints-참조-무결성-제약조건\" style=\"position:relative;\"><a href=\"#3-refrential-integrity-constraints-%EC%B0%B8%EC%A1%B0-%EB%AC%B4%EA%B2%B0%EC%84%B1-%EC%A0%9C%EC%95%BD%EC%A1%B0%EA%B1%B4\" aria-label=\"3 refrential integrity constraints 참조 무결성 제약조건 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>3. Refrential integrity constraints (참조 무결성 제약조건)</h3>\n<p>: foreign key의 값은 참조하고 있는 relation의 primary key에 존재하는 값만 가능</p>\n<hr>\n<h2 id=\"-integrity-violation-해결-방법\" style=\"position:relative;\"><a href=\"#-integrity-violation-%ED%95%B4%EA%B2%B0-%EB%B0%A9%EB%B2%95\" aria-label=\" integrity violation 해결 방법 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>🧵 Integrity violation 해결 방법</h2>\n<h4 id=\"1-cancel-the-operation\" style=\"position:relative;\"><a href=\"#1-cancel-the-operation\" aria-label=\"1 cancel the operation permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>1. Cancel the operation</h4>\n<p>: RESTRICT or REJECT 옵션을 사용해서 violation을 일으키는 operation을 바로 취소시키는 방법</p>\n<h4 id=\"2-operation-수행하고-나서-사용자에게-violation-알려주는-방법\" style=\"position:relative;\"><a href=\"#2-operation-%EC%88%98%ED%96%89%ED%95%98%EA%B3%A0-%EB%82%98%EC%84%9C-%EC%82%AC%EC%9A%A9%EC%9E%90%EC%97%90%EA%B2%8C-violation-%EC%95%8C%EB%A0%A4%EC%A3%BC%EB%8A%94-%EB%B0%A9%EB%B2%95\" aria-label=\"2 operation 수행하고 나서 사용자에게 violation 알려주는 방법 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>2. Operation 수행하고 나서, 사용자에게 violation 알려주는 방법</h4>\n<p>: 권장하지 않음.</p>\n<h4 id=\"3-violation을-해결하도록-추가적인-update-trigger\" style=\"position:relative;\"><a href=\"#3-violation%EC%9D%84-%ED%95%B4%EA%B2%B0%ED%95%98%EB%8F%84%EB%A1%9D-%EC%B6%94%EA%B0%80%EC%A0%81%EC%9D%B8-update-trigger\" aria-label=\"3 violation을 해결하도록 추가적인 update trigger permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>3. violation을 해결하도록 추가적인 update trigger</h4>\n<p>: CASCADE, SET NULL or SET DEFAULT 옵션 사용</p>\n<h4 id=\"4-사용자-지정-error-correction-실행\" style=\"position:relative;\"><a href=\"#4-%EC%82%AC%EC%9A%A9%EC%9E%90-%EC%A7%80%EC%A0%95-error-correction-%EC%8B%A4%ED%96%89\" aria-label=\"4 사용자 지정 error correction 실행 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>4. 사용자 지정 error-correction 실행</h4>\n<p>: 프로그램이 미리 지정되어 있어야 함</p>\n<div class=\"table-of-contents\">\n<ul>\n<li>\n<p><a href=\"#-relational-model-concepts\">🔗 Relational Model Concepts</a></p>\n</li>\n<li>\n<p><a href=\"#-constraints\">🚨 Constraints</a></p>\n<ul>\n<li>\n<ul>\n<li><a href=\"#1-inherent-or-implicit-constraints\">1. Inherent or Implicit constraints</a></li>\n<li><a href=\"#2-schema-based-or-explicit-constraints\">2. Schema-based or Explicit constraints</a></li>\n<li><a href=\"#3-application-based-or-semantic-constraints\">3. Application-based or Semantic constraints</a></li>\n</ul>\n</li>\n</ul>\n</li>\n<li>\n<p><a href=\"#-relational-integrity-constraints\">🚨 Relational Integrity Constraints</a></p>\n<ul>\n<li><a href=\"#1-key-constraints-unique-constraints\">1. Key constraints (Unique constraints)</a></li>\n<li><a href=\"#2-entity-integrity-constraints-%EC%97%94%ED%84%B0%ED%8B%B0-%EB%AC%B4%EA%B2%B0%EC%84%B1-%EC%A0%9C%EC%95%BD%EC%A1%B0%EA%B1%B4\">2. Entity integrity constraints (엔터티 무결성 제약조건)</a></li>\n<li><a href=\"#3-refrential-integrity-constraints-%EC%B0%B8%EC%A1%B0-%EB%AC%B4%EA%B2%B0%EC%84%B1-%EC%A0%9C%EC%95%BD%EC%A1%B0%EA%B1%B4\">3. Refrential integrity constraints (참조 무결성 제약조건)</a></li>\n</ul>\n</li>\n<li>\n<p><a href=\"#-integrity-violation-%ED%95%B4%EA%B2%B0-%EB%B0%A9%EB%B2%95\">🧵 Integrity violation 해결 방법</a></p>\n<ul>\n<li>\n<ul>\n<li><a href=\"#1-cancel-the-operation\">1. Cancel the operation</a></li>\n<li><a href=\"#2-operation-%EC%88%98%ED%96%89%ED%95%98%EA%B3%A0-%EB%82%98%EC%84%9C-%EC%82%AC%EC%9A%A9%EC%9E%90%EC%97%90%EA%B2%8C-violation-%EC%95%8C%EB%A0%A4%EC%A3%BC%EB%8A%94-%EB%B0%A9%EB%B2%95\">2. Operation 수행하고 나서, 사용자에게 violation 알려주는 방법</a></li>\n<li><a href=\"#3-violation%EC%9D%84-%ED%95%B4%EA%B2%B0%ED%95%98%EB%8F%84%EB%A1%9D-%EC%B6%94%EA%B0%80%EC%A0%81%EC%9D%B8-update-trigger\">3. violation을 해결하도록 추가적인 update trigger</a></li>\n<li><a href=\"#4-%EC%82%AC%EC%9A%A9%EC%9E%90-%EC%A7%80%EC%A0%95-error-correction-%EC%8B%A4%ED%96%89\">4. 사용자 지정 error-correction 실행</a></li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</div>","frontmatter":{"date":"December 07, 2021","title":"[Database] Relational Model","categories":"Database","author":"JFe","emoji":"🔗"},"fields":{"slug":"/db-relational-model/"}},"site":{"siteMetadata":{"siteUrl":"https://jfelog.netlify.app","comments":{"utterances":{"repo":"Go-Jaecheol/Jfe_Blog"}}}}},"pageContext":{"slug":"/db-er-model/","nextSlug":"/db-model-schema/","prevSlug":"/db-relational-model/"}},
    "staticQueryHashes": ["1073350324","1956554647","2938748437"]}