问题 单项选择题

设有职工表(部门号,职工号,姓名,性别,出生日期),查询所有目前年龄在40岁以下(包含40岁)的职工信息(姓名、性别和年龄),正确的命令是______。

A.SELECT 姓名,性别,YEAR(DATE())-YEAR(出生日期)年龄 FROM 职工 WHERE年龄<=40

B.SELECT 姓名,性别, YEAR(DATE())-YEAR (出生日期) 年龄 FROM 职工 WHERE
YEAR(出生日期)<=40

C.SELECT 姓名,性别, YEAR(DATE())-YEAR (出生日期) 年龄 FROM 职工 WHERE
YEAR (DATE())-YEAR (出生日期)<=40

D.SELECT 姓名,性别,年龄=YEAR(DATE())-YEAR (出生日期) FROM 职工 WHERE
YEAR(DATE())-YEAR(出生日期)<=40

答案

参考答案:C

解析:[知识点] SQL的数据查询功能
[评析] 通过YEAR函数计算年龄。
SQL语言的数据查询功能的语法一般格式如下:
SELECT<目标列表达式>
FROM[[<表名1>|<视图名1>][[INNE]
JOIN<表名2>|<视图名1>]…[ON<连接条件>]…]
FROM[[<数据库名>]<owner>{<表名>|<视图名>}
[,[[<数据库名>,]<owner>,{<表名>|<视图名>}……
[WHERE<条件表达式>]
[GROUP BY<列名1>
[HAVING<内部函数表达式>]]
[ORDER BY<列名2>{ASC/DESC}]
语句的功能是从FROM子句列出的表中,按照WHERE子句中给出的条件,找出满足条件的元组,再按SELECT子句中给出的目标列表达式,选出元组中的列值形成结果表。

单项选择题

(三)

Believe it or not, optical illusion can cut highway crashes.

Japan is a case in point. It has reduced automobile crashes on some roads by nearly 75 percent using a simple optical illusion. But stripes, called chevrons, painted on the roads make drivers think that they are driving faster than: they really are, and thus drivers slow down.

Now the American Automobile Association Foundation for Traffic Safety in Washington D. C. is planning to repeat Japan’s success. Starting next year, the foundation will paint chevrons and other patterns of stripes on selected roads around the country to test how well the patterns reduce highway crashes.

Excessive(too great) speed plays a major role in as much as one fifth of all fatal traffic accidents, according to the foundation. To help reduce those accidents, the foundation will conduct its tests in areas where speed-related hazards(danger) are the greatest curves, exit slopes, traffic circles, and bridges.

Some studies suggest that straight, horizontal bars painted across roads can initially cut the average speed of drivers in half. However, traffic often returns to full speed within months as drivers become used to seeing the painted bars.

Chevrons, scientists say, not only give drivers the impression that they are driving faster than they really are but also make a lane appear to be narrower. The result is a longer lasting reduction in highway speed and the number of traffic accidents.

On roads painted with chevrons, drivers tend to feel that().

A.they should avoid speed-related hazards

B.they are driving in the wrong lane

C.they should slow down their speed

D.they are coming near to the speed limit

单项选择题 A1型题