10.
在数据库test 中的一个表 student,字段是 name,class,score。分别代表姓名、所在 班级,分数。
1) 学出每个班级中的学生,按照成绩降序排序; Select namefrom student order byclass,scoredesc
2) 查出每个班的及格人数和不及格人数,格式为:class、及格人数、不及格人数;
select class count(case when score>60 then”jg”) as jgrs,cout(case when score<=60 then “big”) as bjgrwfrom strdent group byclass;
3) 用 PHP 写入连接数据库("localhost","msuser","mspass")、执行以上 SQL、显示结果、 判断错误、关闭数据库的过程;