-
[StanfordOnline: Databases: Modeling and Theory] 01-2. Introduction to the Relational Model컴퓨터/DB, SQL 2025. 4. 27. 22:36728x90반응형
https://www.edx.org/course/modeling-and-theory
StanfordOnline: Databases: Modeling and Theory | edX
This course is one of five self-paced courses on the topic of Databases, originating as one of Stanford's three inaugural massive open online courses released in the fall of 2011. The original "Databases" courses are now all available on edx.org. This cour
www.edx.org
The relational model underlies all commercial database systems at this point in time.
=> 주요 데이터베이스 시스템들은 관계형 모델을 기반으로 설계되어 있다.
테이블명이 단수여야 하는지, 복수여야 하는지에 대해서는 이견이 있다.
Schema includes the name of the relation, the attributes of the relation, and the types of those attributes.
* NULL이 있으면 주의해야 한다.
GPA가 3.5 초과인 사람을 구하는 쿼리와 3.5 이하를 구하는 쿼리를 합쳤을 때 모든 사람을 쿼리할 수 없다는 점을 주의해야 한다.
Craig는 GPA가 NULL이라 값을 알 수 없고, 따라서 쿼리에 포함 안 된다.
* 다른 테이블의 튜플을 가리키고 싶을 때
관계형 데이터베이스에는 포인터 개념이 없다.
unique key로 가리킨다.
데이터베이스 하는 사람들은 데이터베이스를 거대한 디스크로 그리는 습관이 있다.
Relational databases support ad hoc queries and high-level languages. By ad hoc, I mean that you can pose queries that you didn't think of in advance. So it's not necessary to write long programs for specific queries.
- ad hoc queries: 즉석 쿼리, 미리 정해지지 않은 필요에 따라 즉시 작성하는 쿼리
- high-level languages: 사람이 이해하기 쉬운 고수준 언어 (SQL처럼 선언적인 언어)
- pose queries: 쿼리를 작성하고 실행하다
* high level language
you can write in a fairly compact fashion rather complicated queries
and you don't have to write the algorithms that get the data out of the databases.
* closure of the language
closure: 어떤 연산을 수행해도 결과가 여전히 같은 집합 안에 속한다는 성질
데이터베이스에서는 쿼리 언어로 질의했을 때 결과도 다시 그 언어로 표현할 수 있는 것을 의미
3개 테이블에 대해서 쿼리를 하고, 같은 타입의 object를 반환받았을 때
관계대수가 대표적인 closure language
테이블에 대해 select, project, join 같은 연산을 해도 결과가 여전히 테이블 형태
따라서 또 다른 연산에 바로 사용할 수 있다
SELECT * FROM (SELECT * FROM Students WHERE age > 20) WHERE grade = 'A';
* Compositionality
이전 쿼리 결과를 기반으로 새 쿼리를 실행할 수 있음
Query could be posed over the answer of the first query
and could even combine that answer with some of the existing relations in the database.
pose over: 기반으로 설정하다, 위에 쌓다, 위에 세우다
첫 번째 결과를 대상으로 새로운 질의를 한다.
* 관계 대수
theoretically well-grounded (이론적으로 매우 탄탄하게 뒷받침되어 있다)
반응형'컴퓨터 > DB, SQL' 카테고리의 다른 글
(edX stanfordOnline Databases: Modeling and Theory) Relational Algebra 2 (Set operators, renaming, notation) (1) 2025.05.06 (edX stanfordOnline Databases: Modeling and Theory) Relational Algebra (0) 2025.05.06 StanfordOnline: Databases: Modeling and Theory 01. introduction (0) 2025.04.27 [ DB ] DB 공부하는 법 (0) 2020.12.23 순번, 순위 매기기 (0) 2020.01.19