摘要: 1 use learn_db; 2 3 # 排序查询 4 /* 5 select + 字段名/*(多个字段名用逗号隔开) from + 表名 order by + 要排序的字段名 6 order by + 字段名 [asc | desc] 7 order by 默认为升序 8 order by + 阅读全文
posted @ 2021-07-27 21:52 Alice只敲代码不秃头 阅读(44) 评论(0) 推荐(0) 编辑
摘要: 1 use learn_db ; 2 3 # 创建主表 4 create table class_teachers( 5 id int primary key auto_increment not null comment '班主任ID', 6 name varchar(20) not null c 阅读全文
posted @ 2021-07-27 21:52 Alice只敲代码不秃头 阅读(44) 评论(0) 推荐(0) 编辑
摘要: 1 use learn_db ; 2 3 # 查询所有字段已经信息 select * from + 表名 4 select * from people ; 5 6 # 增 7 # 添加数据 8 /* 9 insert into + 表名(要增加的字段名) values(对应字段的数据) 10 ins 阅读全文
posted @ 2021-07-27 21:51 Alice只敲代码不秃头 阅读(59) 评论(0) 推荐(0) 编辑
摘要: 1 create table dis_exam( 2 id int primary key auto_increment not null , 3 student_name varchar(20) not null , 4 exam_python double default 0 , 5 exam_ 阅读全文
posted @ 2021-07-27 21:51 Alice只敲代码不秃头 阅读(51) 评论(0) 推荐(0) 编辑
摘要: 1 # 查看数据时间 2 select now() ; 3 4 # 查询mysql版本 5 select version() ; 6 7 # 查看所有库 show + 库名 8 show databases ; 9 10 # 查看库的创建信息 show create + 库名 11 show cre 阅读全文
posted @ 2021-07-27 21:50 Alice只敲代码不秃头 阅读(59) 评论(0) 推荐(0) 编辑