Skip to Content
SQL 시작하기
book

SQL 시작하기

by Thomas Nield
May 2025
Beginner to intermediate
134 pages
1h 46m
Korean
O'Reilly Media, Inc.
Content preview from SQL 시작하기

2장. 데이터베이스

이 작품은 AI를 사용하여 번역되었습니다. 여러분의 피드백과 의견을 환영합니다: translation-feedback@oreilly.com

데이터베이스란 무엇인가요?

가장 넓은 의미에서 데이터베이스는 데이터를 수집하고 정리하는 모든 것을 말합니다. 고객 예약이 담긴 스프레드시트도 데이터베이스이며, 항공편 스케줄 데이터가 포함된 일반 텍스트 파일도 데이터베이스입니다. 일반 텍스트 데이터 자체는 XML, CSV 등 다양한 형식으로 저장할 수 있습니다.

하지만 전문적으로 '데이터베이스'라고 하면 관계형 데이터베이스 관리 시스템 (RDBMS)을 지칭하는 경우가 많습니다. 이 용어는 기술적이고 어렵게 들릴 수 있지만, RDBMS는 단순히 서로 관계가 있을 수 있는 하나 이상의 테이블을 보관하는 데이터베이스의 한 유형입니다.

관계형 데이터베이스 살펴보기

표는 익숙한 개념이어야 합니다. 스프레드시트처럼 데이터를 저장하는 열과 행이 있습니다. 이러한 테이블은 고객 정보에 대한 CUSTOMER 테이블을 참조하는 ORDER 테이블과 같이 서로 관계를 가질 수 있습니다.

예를 들어 CUSTOMER_ID 필드가 있는 ORDER 테이블이 있다고 가정해 보겠습니다(그림 2-1).

An ORDER table with a CUSTOMER_ID
그림 2-1. CUSTOMER_ID가 있는 ORDER 테이블

CUSTOMER_ID 에 대한 고객 정보를 보유하는 CUSTOMER 라는 또 다른 테이블이 있을 것으로 합리적으로 예상할 수 있습니다(그림 2-2).

A CUSTOMER table
그림 2-2. 고객 테이블

ORDER 테이블로 이동하면 CUSTOMER_ID 을 사용하여 CUSTOMER 테이블의 고객 정보를 조회할 수 있습니다. 이것이 바로 테이블에 다른 테이블의 정보를 가리키는 필드가 있을 수 있는 '관계형 데이터베이스'의 기본 개념입니다. 이 개념은 통합 문서의 다른 시트에서 한 시트의 정보를 검색하기 위해 Excel에서 VLOOKUP을 사용해 본 적이 있다면 익숙하게 들릴 수 있습니다.

테이블을 분리하는 이유는 무엇인가요?

그런데 왜 이 테이블을 분리하고 이런 식으로 설계했을까요? 그 동기는 다양한 유형의 데이터를 하나의 테이블에 넣지 않고 각각의 테이블로 분리하는 정규화입니다. 모든 정보가 하나의 테이블에 있으면 중복되고 부피가 커지며 유지 관리가 매우 어려울 것입니다. ORDER 테이블에 고객 정보를 저장한다고 상상해 보십시오. 그림 2-3은 그 모습을 보여줍니다.

A table that is not normalized
그림 2-3. 정규화되지 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Oracle Database 11g Release 2 Performance Tuning Tips & Techniques

Oracle Database 11g Release 2 Performance Tuning Tips & Techniques

Richard Niemiec

Publisher Resources

ISBN: 9798341656307