问题 单项选择题

(31)~(35)题使用下列数据表。
仓库(仓库号C(3)、所在地C(8)、人数N(2))
职工(仓库号C(3)、职工号C(2)、姓名C(8)、工资I)

检索最少有4名职工仓库的职工平均工资( )。

A.SELECT 仓库号,COUNT(*) AS人数,AVG(工资) AS 平均工资 FROM 职工; GROUPBY 仓库号 WHERE COUNT(*)>=4

B.SELECT 仓库号,COUNT(*) AS人数,AVG(工资) AS 平均工资 FROM 职工; GROUPBY 仓库号 HAVING COUNT(*)>=4

C.SELECT 仓库号,COUNT(*) AS人数,AVG(工资) AS 平均工资 FROM 职工; GROUPBY 职工号 WHERE COUNT(*)>=4

D.SELECT 仓库号,COUNT(*) AS人数,AVG(工资) AS 平均工资 FROM 职工; GROUPBY 职工号 HAVING COUNT(*)>=4

答案

参考答案:B

解析: 在分组与计算查询语句中,使用HAVING子句可以对分组进一步加以控制。用这个子句定义这些组所必须满足的条件,以便将其包含在结果中,HAVING子句必须与GROUP BY短语同时使用。 本题中先由GROUP BY子句按“仓库号”对记录行进行分组;再执行COUNT()函数统计每组中有多少个记录,执行AVG()函数计算每个组的平均工资;最后执行 HAVING子句,只有记录总数大于等于4的组才输出结果,即仓库职工在4名(含)以上的。注意:此时输出的组记录是计算后的记录,即每组只包含一条记录,输出信息包括该仓库的仓库号、人数和平均工资。

单项选择题
阅读理解
Future and Today
It is well known that everyone has his own dream as well as his own future. But do you know what future really is? I have to say that future is now. That is to say we must treasure every minute now. If we want to have a bright future, we should know how important time is and use it well.
There is an old English saying:“Gain time, gain life”Then what’s time? Time is something that we can’t see or touch, but we can feel it passing by. Time is always with us. When we are at table, time passes; when we play, time goes by unnoticeably. We always say “Time is money”, but time is even more precious(珍贵的) than money, because when money is spent, we can earn it back. But if time is gone away, it will never return. So, some of us even say time is priceless.
We should always remember: future is now. For us students, we should try our best to work hard in order to create a great future of our own. We should make the best use of every hour and be the master of today. We should do everything before us as well as possible. And never put off what can be done today till tomorrow.
As we all know,“Time and tide wait for no man.”If you waste today, you will regret tomorrow. So from now on, work hard. Tomorrow will be better, and your future will be brighter. Remember:“No pains, no gains.”Today’s hard work is the cause of tomorrow’s harvest.
Title: Future and Today
Opinions
 Supporting details
Future is now
Everyone has his own dream as well as his own future. If we want to have a bright future, we should know the 61________ of time and make every minute 62 ________.
63_______is priceless.
Time is money, but time is even more 64_________ than money, because when money is spent, we can earn it back. But time will return no more.
Be masters of today
Today’s hard work is the cause of tomorrow’s harvest. As students, we should never put off what we can be done today till tomorrow and we should try our 65 ______ to do everything well.