最新原文:https://www.cnblogs.com/uncleyong/p/14805395.html
单表
create table stu ( sid int(4) primary key, sname varchar(20) not null, phone int(11) not null, addr varchar(20) not null, class_id int(4) not null, grade_id int(4) not null );
explain select sid from stu where grade_id in(2,3) and class_id=1 order by grade_id desc ;
根据上面explain的结果,对sql进行优化
https://www.cnblogs.com/uncleyong/p/14814185.html