Mysql
文章平均质量分 79
ai你曾来过
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
【无标题】
测试原创 2022-11-11 18:31:47 · 293 阅读 · 0 评论 -
mysql(01)原理
mysql原理:1 mysql分层逻辑:链接层 服务层 引擎层 存储层2 引擎层:查询数据库引擎:InnoDB:事务优先; ( 适合高并发操作 ;行锁;一次锁一行。每条数据都要加锁。性能降低。但适合高并发,安全)MyISAM: 性能优先 (1万个数据,表锁)a. 支持哪些引擎?show engines;default 默认;b. 查看当前使用的引擎?show variables like ‘%storage_engine%’;c . 指定数据库的引擎方式 和自增字段。...原创 2020-05-18 23:57:27 · 161 阅读 · 0 评论 -
mysql(7)分组查询和分页查询
同时查询多条数据:select * from students where id =1 or id=2 or id=3;select * from students where id in (1,2,3);select * from students where id not in(2,3);同时查询数据+ 排序:select * from students where id in (...原创 2020-05-05 23:57:17 · 228 阅读 · 0 评论 -
mysql(8)多表查询
聚合函数:max ,min,avg,sum,count最高分:同时查询多表:1.mysql> select * from user;+----+----------+------+---------+--------------+| id | username | sex | id_card | python_grade |+----+----------+------+---------+--------------+| 1 | caomei | girl | 1001原创 2020-05-17 18:43:18 · 353 阅读 · 0 评论 -
mysql (6)内置函数和常见函数
聚合函数:就是内置函数 ;有很多自定的方法;mysql里面使用select 关键字调用 :select 函数名(字段)【from 表名】最大值:`select max(python_grade) as 最高分 from user;`最小值:`select min(python_grade) as 最低分 from user;`平均值: select avg(python_grad...原创 2020-05-05 20:57:39 · 230 阅读 · 0 评论 -
mysql(5)排序(升序降序)
升序降序:select * from 表名 order by + (字段)+(升序/降序)字段: 一般是: float int ;varchar一般不进行排序!ASC;升序DESC;降序select * from user order by python_grade ASC ;select * from user order by python_grade DESC;...原创 2020-05-05 16:40:25 · 1208 阅读 · 1 评论 -
mysql(4)数据类型之属性
mysql数据类型的属性:varchar(n), int .bigint.float , data.datatime , text.自增:auto_increment;尽量作用在int上面;主键: primary key;一张表只能有一个主键;不能重复;唯一键:unique: 被unique修饰的数据不能重复;默认值 :default ‘默认值’非空 :not null 必须填写...原创 2020-05-05 16:07:31 · 137 阅读 · 0 评论 -
mysql(2) DDL 的操作
sql语言的分类:1数据库查询的语言(DQL query):对表的查询select:2数据库定义的语言(DDL defined):create database,drop database(库); create table,drop table(表);3数据库操作语言(DML ma na ge):update,insert ,deleteDDL对库的:1查看某一数据库的详情信息:s...原创 2020-05-04 19:50:04 · 148 阅读 · 0 评论 -
mysql(1)基本操作
mysql1 连接mysqlmysql mysql -u root -p 2 建立库 ,删除库 ,查看表:建立库:> create database dt53;> -> ; Query OK, 1 row affected (0.03 sec)create database dt53 character set utf8; #不能写成utf-8查询库...原创 2020-05-04 17:35:24 · 160 阅读 · 0 评论
分享