设计表
4.按专业统计课程数量:
sql SELECT Major, COUNT(*) AS Num FROM Course GROUP BY Major
5.按专业查询所有课程信息:
sql SELECT * FROM Course WHERE Major = '信息技术'
6.统计“信息技术”专业的课程数量:
sql SELECT COUNT(*) FROM Course WHERE Major = '信息技术'
7.按学分将“信息技术”专业的课程排序:
sql SELECT * FROM Course WHERE Major = '信息技术' ORDER BY Credit DESC
8.统计“信息技术”专业课程的平均学时:
sql SELECT AVG(Period) AS AvgPeriod FROM Course WHERE Major = '信息技术'
9.查询“信息技术”专业,学时最长的课程信息:
sql SELECT * FROM Course WHERE Major = '信息技术' AND Period = ( SELECT MAX(Period) FROM Course WHERE Major = '信息技术' )