Cyan's Blog

Search

Search IconIcon to open search

CMU15-445_1_Lecture_Note

Last updated Sep 8, 2021 Edit Source

# Course Intro & Relational Algebra

2021-09-08

Tags: #Database

# Overview

# Database

a collection of data that’s related together in some way that’s try’s to model some aspects of real world. a useful database is the one which you can ask question about it.

Flat Files:

1
2
3
4
for line in file:
	record = parse(line)
	if record[0]=="Ice Cube": 
		print int(record[1])

DBMS:

# History of DBMSs

Data Model: a collection of concepts for describing the data in a database. -> The Higher Concept Schema: a description of a particular collection of data, Using a given data model. -> The Actual Plan

Relational Model: Three Parts

Relation: Definition Unordered set that contain the relation of attributes that represent entities.

Primary Key Uniquely identify a single tuple.

# DML: Data Manipulation Languages

有两种:

# Relational Algebra

Describe the fundamental operations to retrieve and manipulate tuples in a relation(Based on Set Algebra)

1
2
3
4
5
6
graph LR
A([realtion1])-->B[<Some Operations>]
C([realtion2])-->B
D([...])-->B
E([realtionN])-->B
B-->F([New Relation])

关系代数是Procedural的, 描述的是筛选数据所要进行的操作. 在课件里面介绍了以上操作: