当前位置:网站首页>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 设置保存点
边栏推荐
- How to effectively align team cognition
- How to manage fixed assets efficiently in one stop?
- How to solve the problem of fixed assets management and inventory?
- Nacos service configuration and persistence configuration
- Serialization, listening, custom annotation
- The fixed assets management system enables enterprises to dynamically master assets
- Youqitong PE toolbox [vip] v3.7.2022.0106 official January 22 Edition
- nacos服务配置和持久化配置
- Key points of NFT supervision and overseas policies
- Problems caused by delete and delete[]
猜你喜欢

Jetson nano installs tensorflow GPU and problem solving

2022.02.15_ Daily question leetcode six hundred and ninety

I use flask to write the website "one"

FAQ | FAQ for building applications for large screen devices
![[pytorch] softmax function](/img/97/b8ae22e8496a77e665d716cb0e9ee3.png)
[pytorch] softmax function

How to launch circle of friends marketing and wechat group activities

Installation and use of NoSQL database

Mysql 优化

dsPIC30F6014a LCD 方块显示

Imitation of Baidu search results top navigation bar effect
随机推荐
dsPIC30F6014a LCD 方块显示
I use flask to write the website "one"
MapReduce编程基础
Jetson nano installs tensorflow GPU and problem solving
Class loading
MySQL optimization
Youqitong PE toolbox [vip] v3.7.2022.0106 official January 22 Edition
微信小程序 webview 禁止页面滚动,同时又不影响业务内overflow的滚动的实现方式
序列化、监听、自定义注解
Closure implementation iterator effect
Analysis and solution of JS this loss
JS prototype trap
Installation and use of NoSQL database
[pytorch] 2.4 convolution function nn conv2d
2.4 激活函数
js函数arguments对象
Latex插入的eps图片模糊解决方法
Databinding source code analysis
The jar package embedded with SQLite database is deployed by changing directories on the same machine, and the newly added database records are gone
集成积木报表报错 org.apache.catalina.core.StandardContext.filterStart 启动过滤器异常