当前位置:网站首页>第7天总结&作业
第7天总结&作业
2022-07-27 14:55:00 【xbxbgk】
内连接:inner join :只显示表中公共的数据
外连接:left join /right join
内连接:显示表公共的数据,没有的数据不显示;外连接中左连接,以左边的表为主,如果右表没有的数据显示为null,右连接,以右边的表为主,如果左表没有的数据显示为null
多表联查
两表操作
select 表1.字段,表2.字段 from 表1 inner join 表2 on 表1.字段=表2.字段 where 条件
三表操作
select 表1.字段,表2.字段,表3.字段 from 表1 inner join 表2 on 表1.字段=表2.字段 inner join 表3 on 表1.字段=表3.字段 where 条件
数据库优化:
合理使用char和varchar
合理的建表 一般情况把使用频繁的数据放在一张表中,不经常使用放在子表中 如果查询使用多表联查
合理的使用sql语句,减少子查询 多使用多表联查
表中表中建立索引
查询减少使用*
作业1

作业2

作业3

作业4

边栏推荐
- Bean: the difference between model and entity
- The bill module of freeswitch
- 2021-05-30
- UML diagram introduction
- 【论文阅读】A CNN-Transformer Hybrid Approach for CropClassification Using MultitemporalMultisensor Images
- ES6数组新增属性
- C语言之程序环境和预处理
- Casadi -- detailed explanation of data types and introduction to basic operations
- [paper reading] a CNN transformer hybrid approach for coding visual neuralactivity into text
- 【pytorch】|transforms.FiveCrop
猜你喜欢
随机推荐
JSON data parsing
C语言之文件操作
牛客题目——判断是不是完全二叉树、平衡二叉树
Matplotlib drawing error: "! Latex error: file `type1cm.sty 'not found." solution
C语言之程序环境和预处理
LNMP环境--部署wordpress
JDBC程序实现完整步骤
2021-05-30
File类字节输入、输出流
kubesphere多节点安装出错
C语言之结构体及位段
CODIS cluster deployment
Enumeration and union of C language
Database foundation
C语言之数据的储存
C语言之字符函数和字符串函数及内存函数
Flex弹性盒布局2
Circular statements and arrays
The difference between MVC and MVP and MVVM
ES6数组的方法及伪数组转数组方法









