2021年4月8日(regex 正则表达式) - 图1两个例子:
    1.查找 手机号和座机号
    “13788332312 15788332313 029-88665433 012768 0296676 0377-87832341 155555655765336”
    “[01][0-9]{2,3}-?[0-9]{8}”
    2.查找邮箱
    “7987778@qq.com yuy79879887@sina.com”
    [0-9a-zA-Z]{2,25}@[0-9]{2,6}.com| [0-9a-zA-Z]{2,25}@[a-z|A-Z]{2,6}.com
    作业:

    1. 1、查询名字中含有"风"字的学生信息
    2. select * from student where s_name like '%风%';
    3. 2、查询男生、女生人数
    4. select s_sex,count(*) from student GROUP BY s_sex;
    5. 3、查询每门课程被选修的学生数
    6. select c_id,count(*) from score GROUP BY c_id;
    7. 4、查询1990年出生的学生名单
    8. select * from student where s_brith=1990;
    9. 5、查询所有同学的学生编号、学生姓名、选课总数、所有课程的总成绩
    10. select student.s_id,s_name,count(*) as "选课总数",
    11. sum(s_score) from student
    12. INNER JOIN score on student.s_id=score.s_id GROUP BY score.s_id;
    13. 6查询平均成绩大于等于60分的同学的学生编号和学生姓名和平均成绩
    14. select student.s_id,s_name,avg(s_score) from student
    15. INNER JOIN score on student.s_id=score.s_id
    16. GROUP BY score.s_id having avg(s_score)>60;
    17. 7查询不及格的课程,并显示课程名,课程id和学生id
    18. select course.c_name,score.c_id,s_id from score
    19. INNER JOIN course on course.c_id=score.c_id
    20. where s_score<60;
    21. 8/检索"01"课程分数小于60,按分数降序排列的学生信息
    22. select c_id,s_score from score
    23. where
    24. c_id=01 and s_score<60
    25. ORDER BY s_score DESC;
    26. 9/ 查询选修了全部课程的学生信息
    27. select student.s_id,s_name,s_brith,s_sex from student
    28. INNER JOIN score on student.s_id=score.s_id
    29. GROUP BY score.s_id having count(*)=3;
    30. 10/查询每门课程的平均成绩,结果按平均成绩降序排列,平均成绩相同时,按课程编号升序排列
    31. select c_id,avg(s_score) from score
    32. GROUP BY c_id
    33. ORDER BY avg(s_score) DESC ,c_id;
    34. 11/查询学过"张三"老师授课的同学的信息
    35. select student.s_id,s_name,s_brith,s_sex
    36. FROM student
    37. INNER JOIN score
    38. INNER JOIN course
    39. INNER JOIN teacher
    40. where t_name='张三'
    41. GROUP BY s_id;
    42. 12/查询不及格的课程
    43. select course.c_name,score.c_id,s_id from score
    44. INNER JOIN course on course.c_id=score.c_id
    45. where s_score<60;
    46. 14/查询选修了全部课程的学生信息
    47. select student.s_id,s_name,s_brith,s_sex from student
    48. INNER JOIN score on student.s_id=score.s_id
    49. GROUP BY score.s_id having count(*)=3;