drop database if exists mydb;
create database mydb;
use mydb;
create table class(
cid int primary key auto_increment,
cname varchar(20)
create table student(
sid varchar(20) primary key,
sname varchar(20),
sage int,
ssex char(2),
cid int,
foreign key(cid) references class(cid)
insert into class values(null,'j211001');
insert into class values(null,'j211002');
insert into student values
select * from class;
select * from student;
select * from student where sage>18;
select * from student where sage>=18 and sage<=20;
select * from student where sage>18 and ssex='男';
select * from student where sname like'张%%';
select count(*) from student;
select max(sage) from student;
select ROUND(sum(sage)/count(*)) from student; 
select ssex,count(*) from student GROUP BY ssex ;
select * from student limit 0,2;
select * from class c left join student s on c.cid = s.cid where cname='j211001';

update student set ssex='女' where sname='张三' ;