当前位置:网站首页>SQL学习笔记(01)——数据库基本知识
SQL学习笔记(01)——数据库基本知识
2022-07-01 09:21:00 【雨轩GodLike】
一、什么是数据库技术
- 科学的组织和存储数据,高效的获取和处理数据
- SQL语言结构化查询语言(增删改查)
二、数据库的基本架构
数据(data)
定义:对客观事物的符号表示,如图形符号,数字,字母等等。数据是数据库存储的基本对象。数据库 database (DB)
定义:长期存储在计算机内,有组织,可共享的数据集合。数据库管理系统(DBMS)
数据库的定义功能:DDL语言(数据库定义语言),提供了三个语句:create(创建),alter(修改),drop (删除),操作的对象是数据库中的基本架构----表。
数据库的操作功能:DML语言(数据库操作语言),实现对数据库中存储的数据进行增删改查的操作( insert , delete , update , select )
数据库的保护功能:保护数据的完整性和安全性
数据库的维护功能:数据库中表结构和数据的维护功能
- 数据库系统(DBS)
数据库系统(DBS)= 数据库(DB)+ 数据库管理系统(DBMS)+ 应用系统 + 数据库管理员(DBA)+ 用户
数据库系统经历的三个阶段:
| 网状数据库 | 层次数据库 | 关系数据库 | |
|---|---|---|---|
| 数据组织方式 | 网状模型 | 树状模型 | 关系模型 |
| 架构 | 图形结构 | 树形结构 | 表 |
三、数据库三大范式
1.第一范式
如果关系R的所有属性是简单属性:每个属性都不可再分,则称R满足第一范式,其实就是没有重复的列。表1不满足第一范式。
表2为满足第一范式要求,但数据冗余过大,需要借助第二范式。

2.第二范式
如果关系R先满足第一范式,非主键字段完全依赖于主键,则称R满足第二范式。
例:
有一个快递单号表,若同一个人同时发送了多个快递,这样的话发送人姓名都是重复的,就会造成数据冗余,这时我们应该把拆分开来。如表3
订单表:
姓名编号表:
表4和表5为拆分后的两个表,满足第二范式要求。
3.第三范式
如果关系R满足第二范式,非键字段之间不存在任何的依赖关系,即任何字段不能由其他字段派生出来,它要求字段没有冗余,则称R满足第三范式。
一个基本的关系型数据中要满足第一范式,一个完整的关系型数据库要满足第三范式。
四、SQL语句的分类
1.DQL数据查询语言: select 语句
2.DML数据操作语言: insert update delete 语句
3.DDL数据定义语言: create alter drop 语句
4.DCL数据控制语言: 授权grant 收权revoke
5.TCL事务控制语言: commit 提交 rollback 回滚或者撤销 savepoint 设置保存点
边栏推荐
- Preparing for the Blue Bridge Cup -- bit operation
- Reproduced Xray - cve-2017-7921 (unauthorized access by Hikvision)
- Key points of NFT supervision and overseas policies
- Summary of reptile knowledge points
- 序列化、监听、自定义注解
- 计网01-物理层
- 手指点击屏幕就模拟进入F11进入全屏
- Solution of EPS image blur by latex insertion
- Log4j 日志框架
- [ESP nanny level tutorial] crazy completion chapter - Case: gy906 infrared temperature measurement access card swiping system based on the Internet of things
猜你喜欢
![[video game training] real topic of 2013 video game of infrared optical communication device](/img/ef/c2c45c1c6c24aed0a4e93101047372.png)
[video game training] real topic of 2013 video game of infrared optical communication device

Error org apache. catalina. core. StandardContext. FilterStart start filter exception

Imitation of Baidu search results top navigation bar effect
![[pytorch] softmax function](/img/97/b8ae22e8496a77e665d716cb0e9ee3.png)
[pytorch] softmax function

MySQL optimization

3D printing Arduino four axis aircraft

How to manage fixed assets efficiently in one stop?

2.3 【pytorch】数据预处理 torchvision.datasets.ImageFolder

Pain points and solutions of fixed assets management of group companies

2022.02.15_ Daily question leetcode six hundred and ninety
随机推荐
Understand shallow replication and deep replication through code examples
Promise asynchronous programming
How to effectively align team cognition
nacos简易实现负载均衡
Class loading
PR training notes
【电赛训练】红外光通信装置 2013年电赛真题
Nacos service configuration and persistence configuration
Phishing identification app
短路运算符惰性求值
js this丢失问题分析 及 解决方案
Day06 branch structure and cycle (III)
序列化、监听、自定义注解
【ESP 保姆级教程】疯狂毕设篇 —— 案例:基于阿里云和Arduino的化学环境系统检测,支持钉钉机器人告警
JS原型链
2.3 【pytorch】数据预处理 torchvision.datasets.ImageFolder
Short circuit operator lazy evaluation
Daily office consumables management solution
dsPIC30F6014a LCD 方块显示
Redis -- lattice connects to redis cluster