첫 데이터베이스

SQL로 배우는 관계형 데이터베이스 입문

Timo Grossenbacher

Data Journalist

스위스 대학 조사하기

교수 인터랙티브 시각화

데이터베이스 스키마

SQL로 배우는 관계형 데이터베이스 입문

관계형 데이터베이스:

  • 현실의 개체테이블이 됨
  • 중복 최소화
  • 관계로 데이터 무결성 확보
  • 예: professors, universities, companies
  • 예: 은행 "Credit Suisse"는 companies에 한 번만 기록
  • 예: 한 professor는 여러 universitiescompanies에서 일할 수 있고, 한 company는 여러 professors를 고용할 수 있음
SQL로 배우는 관계형 데이터베이스 입문

이 과정에서 학습할 내용:

  • 제가 조사에 사용한 데이터로 작업합니다
  • 관계형 데이터베이스를 처음부터 만듭니다
  • 세 가지 개념을 학습합니다:
    • 제약 조건
    • _키_
    • 참조 무결성

필요 사항: Introduction to SQL에서 다룬 SQL 기초 지식.

SQL로 배우는 관계형 데이터베이스 입문

첫 과제: PostgreSQL 데이터베이스 살펴보기

SELECT table_schema, table_name 
FROM information_schema.tables;
    table_schema    |              table_name
 -------------------+------------------------------
 pg_catalog         | pg_statistic
 pg_catalog         | pg_type
 pg_catalog         | pg_policy
 pg_catalog         | pg_authid
 pg_catalog         | pg_shadow
 public             | university_professors
 pg_catalog         | pg_settings
...
SQL로 배우는 관계형 데이터베이스 입문

특정 테이블의 열 살펴보기

SELECT table_name, column_name, data_type
FROM information_schema.columns 
WHERE table_name = 'pg_config';
 table_name | column_name | data_type
 -----------+-------------+-----------
 pg_config  | name        | text
 pg_config  | setting     | text
SQL로 배우는 관계형 데이터베이스 입문

시작해 봅시다.

SQL로 배우는 관계형 데이터베이스 입문

Preparing Video For Download...