当前位置:网站首页>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 设置保存点
边栏推荐
- Tree structure --- binary tree 1
- OSPF - virtual link details (including configuration commands)
- Promise asynchronous programming
- Pain points and solutions of equipment management in large factories
- Using closures to implement private variables
- Implementation and application of queue
- Day06 branch structure and cycle (III)
- Understanding and implementation of AVL tree
- 树结构---二叉树2非递归遍历
- Tree structure -- binary tree 2 non recursive traversal
猜你喜欢

樹結構---二叉樹2非遞歸遍曆

Simple load balancing with Nacos

【电赛训练】红外光通信装置 2013年电赛真题
![Problems caused by delete and delete[]](/img/d9/a1c3e5ce51ef1be366a973aa42d1f0.png)
Problems caused by delete and delete[]

Why is the Ltd independent station a Web3.0 website!

JS scope chain and closure

Installation and use of NoSQL database

How to manage fixed assets efficiently in one stop?

Vsync+ triple cache mechanism +choreographer

OSPF - virtual link details (including configuration commands)
随机推荐
[pytorch learning] torch device
2.2 【pytorch】torchvision.transforms
JS prototype trap
Win7 pyinstaller reports an error DLL load failed while importing after packaging exe_ Socket: parameter error
An overview of the design of royalties and service fees of mainstream NFT market platforms
记一次redis超时
dsPIC30F6014a LCD 方块显示
js原型继承仅可继承实例而非构造器
JS原型链
Microcomputer principle - bus and its formation
Tree structure -- binary tree 2 non recursive traversal
序列化、监听、自定义注解
Principles of Microcomputer - Introduction
Is it safe to dig up money and make new shares
[pytorch] softmax function
ES6 const essence and completely immutable implementation (object.free)
[ESP nanny level tutorial preview] crazy node JS server - Case: esp8266 + DS18B20 temperature sensor +nodejs local service + MySQL database
Flink interview questions
Redis -- lattice connects to redis cluster
In the middle of the year, where should fixed asset management go?