1. count()

  查询学生总人数。

 select  count(*)  from  s

 count(*)表示对元组或记录计数。

2.sum()

 

 

 

 返回组中所有值的和。sum只能用于数字列,空值会被忽略!

3.avg()

返回组中值的平均值,空值回避忽略!

4.max()

返回组中值的最大值

5.min()

返回组中值的最小值

6.计算c1课程的学生人数、最高成绩、最低成绩及平均成绩

 select count(*),max(score),min(score),avg(score) from sc where cno='c1'


数据库表s,c,sc截图请到http://www.cnblogs.com/fuge/archive/2012/03/16/2400913.html

相关文章:

  • 2021-08-18
  • 2021-07-06
  • 2021-08-23
  • 2022-12-23
  • 2021-07-31
  • 2021-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-17
  • 2022-02-04
  • 2022-02-06
  • 2022-02-17
  • 2022-12-23
  • 2022-12-23
  • 2021-06-30
相关资源
相似解决方案