摘要: 1. create table dept( did int primary key auto_increment, dname varchar(20) ); 2. create table emp( id int primary key auto_increment, name varchar(10 阅读全文
posted @ 2024-09-08 16:03 wangyin0425 阅读(6) 评论(0) 推荐(0) 编辑
摘要: 1. create table music( id int PRIMARY key, title varchar(32), alias varchar(32), image varchar(64), style varchar(8), type varchar(4), medium varchar( 阅读全文
posted @ 2024-09-08 10:33 wangyin0425 阅读(9) 评论(0) 推荐(0) 编辑
摘要: create table tb_order( id int PRIMARY key auto_increment, payment double(10,2), payment_type tinyint, status Tinyint ); create table tb_goods( id int 阅读全文
posted @ 2024-09-08 09:48 wangyin0425 阅读(5) 评论(0) 推荐(0) 编辑
摘要: ![](https://img2024.cnblogs.com/blog/3516303/202409/3516303-20240908084023004-1585554575.png) ![](https://img2024.cnblogs.com/blog/3516303/202409/3516303-20240908084549435-1247608085.png) 阅读全文
posted @ 2024-09-08 08:47 wangyin0425 阅读(4) 评论(0) 推荐(0) 编辑
摘要: create table dept( id int PRIMARY key auto_increment, dep_name varchar(20), addr varchar(20) ); create table emp( id int PRIMARY key auto_increment, n 阅读全文
posted @ 2024-09-07 22:27 wangyin0425 阅读(4) 评论(0) 推荐(0) 编辑
摘要: create table emp( id int PRIMARY KEY AUTO_INCREMENT, ename varchar(50) not null unique, joindate date not null, salary double(7,2) not null, bonus dou 阅读全文
posted @ 2024-09-07 22:11 wangyin0425 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 非空约束(NOT NULL):保证列中所有数据不能有null值; 唯一约束(UNIQUE):保证列中所有数据各不相同; 主键约束(PRIMARY KEY):主键是一行数据的唯一标识,要求非空且唯一; 检查约束(CHECK):保证列中的值满足某一条件; 默认约束(DEFAULT):保存数据时,未指定值 阅读全文
posted @ 2024-09-07 19:10 wangyin0425 阅读(4) 评论(0) 推荐(0) 编辑
摘要: 1. select * from stu limit 0,3; 2. select * from stu limit 0,3; 3. select * from stu limit 3,3; 4. select * from stu limit 6,3; 阅读全文
posted @ 2024-09-07 18:52 wangyin0425 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 1. select sex,avg(math) from stu group by sex; 2. select sex,avg(math),count(*) from stu group by sex; 3. select sex,avg(math),count(*) from stu where 阅读全文
posted @ 2024-09-07 14:46 wangyin0425 阅读(5) 评论(0) 推荐(0) 编辑
摘要: 1. select count(*) from stu; 2. select max(math) from stu; 3. select min(math) from stu; 4. select sum(math) from stu; 5. select avg(math) from stu; 6 阅读全文
posted @ 2024-09-07 12:26 wangyin0425 阅读(4) 评论(0) 推荐(0) 编辑