第三次作业

alter table curriculum

-> modify 课程名称 varchar(50) null;

 alter table grade

-> modify 分数 decimal(5,2);

 alter table student_info

-add 备注 varchar(50);

create database studb;

create table stu
    -> (
    -> 学号 char(4) not null primary key,
    -> 姓名 char(8) not null,
    -> 性别 char(2) null,
    -> 出生日期	date null,
    -> 家族住址	varchar(50));

 

 delete from stu

-> where 学号='0004';

 update stu set 家庭住址='滨江市新建路96号' where 学号='0002';

 alter table stu

-> drop 备注;

 select 学号,姓名,出生日期 from student_info;

 SELECT 姓名,家庭住址 FROM student_info WHERE 学号 = '0002';

select 姓名,出生日期 from student_info where 出生日期

>= '1996-01-01' and 性别 = '女';

 select 学号,课程编号,分数 from grade where 分数 between 70 and 80;

 select avg(分数) 平均分数 from grade where 课程编号='0002';

 select count(课程编号) 人数 from grade where 课程编号='0003' and 分数 is not null;

 select 姓名,出生日期 from student_info order by 出生日期;

 select 学号,姓名 from student_info where 姓名 like '张%';

 

posted @ 2023-10-02 16:31  杨11  阅读(12)  评论(0编辑  收藏  举报