Database Relational Model

์•„์ฃผ๋Œ€ํ•™๊ต ๋ฐ์ดํ„ฐ ๋ฒ ์ด์Šค ์ˆ˜์—….

Posted by Bangjinhyuk on March 15, 2021 · 1 min read

Database

Relational Model

  1. ํŠน์ง•
    • major commercial database system์— ์ฃผ๋กœ ์‚ฌ์šฉ
    • ๋งค์šฐ ๋‹จ์ˆœํ•œ ๋ชจ๋ธ (table)
    • Query with high-level languages => read(retrieve)/write(modify)
    • ํšจ์œจ์ ์ด๋‹ค.
  2. Schema
    • tabel (relations)์˜ ๊ตฌ์„ฑ ์„ฑ๋ถ„ ex) ํ…Œ์ด๋ธ”๋ช… ,ํ…Œ์ด๋ธ”์—์„œ columns
    • Relational Model ์—์„œ๋Š” attribute(columns)๋ผ ๋ถˆ๋ฆผ
    • ๊ฐ๊ฐ์˜ attribute๋“ค์€ type(domain)์„ ๊ฐ€์ง
  3. Instance
    • data๋“ค
    • Relational Model ์—์„œ๋Š” tuple(row)๋ผ๊ณ  ๋ถˆ๋ฆผ
  4. NULL (๋‘๊ฐ€์ง€ ๊ฒฝ์šฐ)
    • โ€œunknownโ€ ์•„์ง ์—†๋‹ค.
    • โ€œundefinedโ€ ์ •์˜๋˜์–ด์žˆ์ง€ ์•Š๋‹ค.
  5. Key
    • ๊ฐ๊ฐ์˜ tuple์—์„œ ๊ณ ์œ ํ•œ ๊ฐ’
  6. create relations in SQL

    •   Create Table Studen(ID, name, GPA, photo);
      
    •   Create Table College(name string, state char(2), enrollment integer);
      

๋งจ์œ„๋กœ๐Ÿ‘†