测试常用基础sql语句

insert into student values(null,'meimei','女',2)

delete from student where name='meimei'

update student set name='田梅' where stu_id='2'

SELECT * FROM `student`
select stu_id,name from `student`
select * from student t1 inner join stu_score t2 on t1.stu_id=t2.stu_id

在这里插入图片描述

select subject_name,count(*) from student t1 inner join stu_score t2 on t1.stu_id=t2.stu_id group by subject_name

在这里插入图片描述

select * from student t1
inner join stu_score t2 on t1.stu_id=t2.stu_id where subject_name='数学'

在这里插入图片描述

select * from student t1
inner join stu_score t2 on t1.stu_id=t2.stu_id where subject_name='数学' order by score asc

在这里插入图片描述

select * from student t1 inner join stu_score t2 on t1.stu_id=t2.stu_id where score=90

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_46302247/article/details/134361188
今日推荐