问题 单项选择题

第(31)~(35) 题使用如下3个数据库表:
职员.dbf:职员号C(3),姓名C(6),性别C(2),组号N(1),职务C(10)
客户.dbf:客户号C(4),客户名C(36),地址C(36),所在城市C(36)
订单.dbf:订单号C(4),客户名C(4),职员号C(3),签订日期D,金额N(6.2)

查询订单数在3个以上、订单的平均金额在200元以上的职员号,正确的SQL语句是( )。

A.SELECT职员号FROM订单GROUP BY职员号HAVING COUNT(*)>3 AND AVG金额>200

B.SELECT职员号FROM订单GROUP BY职员号HAVING COUNT(*)>3 AND AVG(金额)>200

C.SELECT职员号FROM订单GROUP BY职员号HAVING COUNT(*)>3 WHERE AVG(金额)>200

D.SELECT职员号FROM订单GROUP BY职员号WHERE COUNT(*)>3 AND AVG金额>200

答案

参考答案:B

解析: 查询订单的平均金额在200元以上,可用平均函数为AVG(金额)>200表示,故可排除选项A)和选项D);订单数在3个以上和订单的平均金额200元以上两个条件都是分组限定条件,须放在HAVING子句中。

判断题
单项选择题

American Museum of Natural History is one of the largest natural and historic museums in the world and one of the main natural history research and education centres in the United States, set up in 1869 and located in the west of the Central Park, Manhattan District, New York. It (1) 7 hectares in its total area, (2) classical types of buildings. The (3) of ancient creatures and humanity is (4) the first place of all the museums in the world, (5) the representative samples from South America, Africa, Europe, Asia and Australia were collected, besides those from the (6) country, the United States.

In the museum, there are five kinds of exhibits, including astronomy, mineralogy, human history, and animals in the (7) times and those in modern times. There are thirty-eight exhibition halls with different (8) from 500 to 1,500 square metres. Besides these, there is a Roosevelt Memorial Hall in (9) of President Roosevelt who supported the (10) of the museum, which is also used to have a special exhibition, showing the new important (11) on natural sciences and (12) affairs and social problems, and special topics connected closely with the life of the citizens. Besides this, it is also used for avocation (13) to have all kinds of scientific activities in the laboratories, centres of natural science and centres for citizens. There are more than 10 (14) research departments mainly (15) for collection of samples, research and work of publication.

In the museum, there are (16) and sub-libraries of Aulspond ancient amniote, with about 300 thousand books and magazines (17) natural history, many of (18) are very valuable monographs for the first edition. It has published many expert books and magazines, and a large number of propaganda materials, (19) which are the two magazines, Natural History and Members of Museum that have the biggest (20) of their magazines.

8()

A.regions

B.areas

C.sites

D.venues