alter table curriculum
-> modify 课程名称 varchar(50) null;
![](https://img2023.cnblogs.com/blog/3276454/202309/3276454-20230926132143367-2103668007.png)
alter table grade
-> modify 分数 decimal(5,2);
![](https://img2023.cnblogs.com/blog/3276454/202309/3276454-20230926132209516-674244730.png)
alter table student_info
-> add 备注 varchar(50);
![](https://img2023.cnblogs.com/blog/3276454/202309/3276454-20230926132228803-1072367585.png)
create database studb;
create table stu
-> (
-> 学号 char(4) not null primary key,
-> 姓名 char(8) not null,
-> 性别 char(2) null,
-> 出生日期 date null,
-> 家族住址 varchar(50));
![](https://img2023.cnblogs.com/blog/3276454/202309/3276454-20230926132251657-892596148.png)
delete from stu
-> where 学号='0004';
![](https://img2023.cnblogs.com/blog/3276454/202309/3276454-20230926132358671-1727598396.png)
update stu set 家庭住址='滨江市新建路96号' where 学号='0002';
![](https://img2023.cnblogs.com/blog/3276454/202309/3276454-20230926132941279-1531593995.png)
alter table stu
-> drop 备注;
![](https://img2023.cnblogs.com/blog/3276454/202309/3276454-20230926133011450-822064528.png)
select 学号,姓名,出生日期 from student_info;
![](https://img2023.cnblogs.com/blog/3276454/202309/3276454-20230926133036083-411066758.png)
SELECT 姓名,家庭住址 FROM student_info WHERE 学号 = '0002';
![](https://img2023.cnblogs.com/blog/3276454/202309/3276454-20230926133111565-1966424478.png)
select 姓名,出生日期 from student_info
where 出生日期 >= '1996-01-01' and 性别 = '女';
![](https://img2023.cnblogs.com/blog/3276454/202309/3276454-20230926133141326-972554770.png)
select 学号,课程编号,分数 from grade where 分数 between 70 and 80;
![](https://img2023.cnblogs.com/blog/3276454/202309/3276454-20230926133219517-2061476367.png)
select avg(分数) 平均分数 from grade where 课程编号='0002';
![](https://img2023.cnblogs.com/blog/3276454/202309/3276454-20230926133251521-1257617924.png)
select count(课程编号) 人数 from grade where 课程编号='0003' and 分数 is not null;
![](https://img2023.cnblogs.com/blog/3276454/202309/3276454-20230926133334591-1909560755.png)
select 姓名,出生日期 from student_info order by 出生日期;
![](https://img2023.cnblogs.com/blog/3276454/202309/3276454-20230926133356099-1302567936.png)
select 学号,姓名 from student_info where 姓名 like '张%';
![](https://img2023.cnblogs.com/blog/3276454/202309/3276454-20230926133412915-2010874825.png)