Skip to content

Commit

Permalink
complete current notes
Browse files Browse the repository at this point in the history
  • Loading branch information
zzicarus committed May 9, 2024
1 parent 79c2b27 commit 32045d0
Show file tree
Hide file tree
Showing 10 changed files with 1,085 additions and 2 deletions.
File renamed without changes.
79 changes: 79 additions & 0 deletions docs/CS/DB/Chapter_1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@


```mermaid
flowchart LR
0{概述}
0-->1
1[View Of Data]-->2[Data Abstraction]
1-->b[Data Models]
0-->0.1[Schema and instances 模式与实例]
0.1-->区分
0.1-->0.1.1[Physical Data Independence]
0-->1.2[Language]
1.2-->1.2.1[DDL:Data Difinition Language]
1.2-->1.2.2[DML:Data Manipulation Language]
1.2.2-->声明式:SQL
1.2.2-->过程式
0-->4[Database Design]
4-->4.1[E-R模型 实体-联系模型]
4-->4.2[规范化]
0-->3[Database Engine]
3-->1.8
3-->3.2[Storage Manager]
3-->3.3[The Query Processor]
3.3-->3.3.1[DDL interpreter]
3.3-->3.3.2[DML compiler]
3.3-->3.3.3[Query evaluation engine]
1.8[事务管理器]-->1.8.1[并发控制管理器]
1.8-->1.8.2[恢复管理器]
```

- **Database Management System (DBMS)**

> A **database** system is a collection of interrelated **data** and a set of **programs** that allow users to access and modify these data.
**Characteristics of Databases**

​ data persistence (数据持久性)

​ convenience in accessing data (数据访问便利性)

​ data integrity (数据完整性)

​ concurrency control for multiple user (多用户并发控制)

​ failure recovery (故障恢复)

​ security control (安全控制)

## View Of data

![image-20240305151254876](https://zzh-pic-for-self.oss-cn-hangzhou.aliyuncs.com/img/202403051513004.png)

![image-20240305151433756](https://zzh-pic-for-self.oss-cn-hangzhou.aliyuncs.com/img/202403051514827.png)

## Language

### DDL

**Data dictionary** contains metadata

- 数据模式
- 完整性约束
- 授权

### DML

**SQL**

- A query takes as **input several** **tables** (possibly only one) and always returns **a single table**.

- **SQL does not support** actions such as input from users, output to

displays, or communication over the network.

43 changes: 43 additions & 0 deletions docs/CS/DB/Chapter_12.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Physical Storage

## Overview

![](https://zzh-pic-for-self.oss-cn-hangzhou.aliyuncs.com/img/202405062252951.png)

![](https://zzh-pic-for-self.oss-cn-hangzhou.aliyuncs.com/img/202405062248692.png)

![s](https://zzh-pic-for-self.oss-cn-hangzhou.aliyuncs.com/img/202405062250332.png)

## Flash Memory | 闪存



## Magnetic Disk

<img src="https://zzh-pic-for-self.oss-cn-hangzhou.aliyuncs.com/img/202405062255334.png" alt="image-20240506225525215" style="zoom:50%;" />

- 通过机械运动,比较慢

![image-20240506225916221](https://zzh-pic-for-self.oss-cn-hangzhou.aliyuncs.com/img/202405062259320.png)

![image-20240506230134356](https://zzh-pic-for-self.oss-cn-hangzhou.aliyuncs.com/img/202405062301480.png)

### Performance

![image-20240506230243627](https://zzh-pic-for-self.oss-cn-hangzhou.aliyuncs.com/img/202405062302736.png)

![image-20240506230303285](https://zzh-pic-for-self.oss-cn-hangzhou.aliyuncs.com/img/202405062303370.png)

![image-20240506230647171](https://zzh-pic-for-self.oss-cn-hangzhou.aliyuncs.com/img/202405062306267.png)

- 上面的IOPS支持的操作是Random的R/W



### Optimization

![image-20240506231917955](https://zzh-pic-for-self.oss-cn-hangzhou.aliyuncs.com/img/202405062319028.png)

![image-20240506231927819](https://zzh-pic-for-self.oss-cn-hangzhou.aliyuncs.com/img/202405062319883.png)

![image-20240506231845491](https://zzh-pic-for-self.oss-cn-hangzhou.aliyuncs.com/img/202405062318583.png)
3 changes: 3 additions & 0 deletions docs/CS/DB/Chapter_13.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Data Storage Structures

##
70 changes: 70 additions & 0 deletions docs/CS/DB/Chapter_2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Relation

> § Structure of Relational Databases
>
> § Database Schema 数据库模式
>
> - A relation instance *r* defined over schema *R* is denoted by *r* (*R*)
>
> § Keys
>
> § Schema Diagrams
>
> § Relational Query Languages
>
> § The Relational Algebra
## Structure of Relational Databases



### Attributes

- 原子性 --> 不可拆分(数组、结构体之类不可)

- The set of allowed values for each **attribute** is called the **domain** **(域)** of the attribute

- The special value **null** **(空值)** is a member of every domain. Indicated that the value is “unknown”

- 无序性,顺序没有影响

## Database Schema 数据库模式

![image-20240307180351107](https://zzh-pic-for-self.oss-cn-hangzhou.aliyuncs.com/img/202403071803221.png)

## Keys

![image-20240307101955968](https://zzh-pic-for-self.oss-cn-hangzhou.aliyuncs.com/img/202403071019133.png)

- primary key 的约束条件

- Foreign

- $R_1$中的一个属性,是另外一个参照$R_2$的 primary key
- 约束条件比较强,必须是 A的属性 B的`primary key`

- referential integrity constraint 参照完整性约束

- 约束条件较弱,



![image-20240307102805922](https://zzh-pic-for-self.oss-cn-hangzhou.aliyuncs.com/img/202403071028221.png)

![image-20240307102148622](https://zzh-pic-for-self.oss-cn-hangzhou.aliyuncs.com/img/202403071021764.png)

## Database

![image-20240307103017347](https://zzh-pic-for-self.oss-cn-hangzhou.aliyuncs.com/img/202403071030505.png)

## Relation Algebra

![image-20240307104513774](https://zzh-pic-for-self.oss-cn-hangzhou.aliyuncs.com/img/202403071045958.png)

![image-20240307181950631](https://zzh-pic-for-self.oss-cn-hangzhou.aliyuncs.com/img/202403071819720.png)

![image-20240307182236752](https://zzh-pic-for-self.oss-cn-hangzhou.aliyuncs.com/img/202403071822871.png)

![image-20240307182324973](https://zzh-pic-for-self.oss-cn-hangzhou.aliyuncs.com/img/202403071823048.png)

- project 竖向选择
Loading

0 comments on commit 32045d0

Please sign in to comment.