问题 单项选择题

建立一个“职员”表,表中有5个字段:职员号、姓名、性别、年龄、部门。要求职员号属性的值唯一,并且不能为空值。建立该表的SQL语句可以是______。

A.CREATE TABLE 职员(职员号 CHAR(6),姓名CHAR(8),;性别CHAR(2),年龄INT(4),部门CHAR(12))

B.CREATE TABLE职员(职员号CHAR(6)NULL,姓名CHAR(8),;性别CHAR(2),年龄INT(4),部门CHAR(12))

C.CREATE TABLE 职员(职员号CHAR(6)NOT NULL UNIQUE,;姓名CHAR(8),性别CHAR(2),年龄INT(4),部门CHAR(12))

D.CREATE TABLE职员(职员号CHAR(6)UNIQUE,姓名CHAR(8),:性别CHAR(2),年龄INT(4),部门CHAR(12))

答案

参考答案:C

解析: SQL支持空值,空值是不知道或不确定的值。NOT NULL表示不允许有空值,UNIQUE表示属性的值唯一。所以,选项C建立的表符合题目要求。

解答题
阅读理解

Getting rid of dirt, in the opinion of most people, is a good thing. However, the attitudes to dirt are always changing.

In the early 16th century, people thought that dirt on the skin was a means to block out disease, and washing off dirt with hot water could open up the skin and let ills in. A particular danger was thought to lie in public baths. By 1538, the French king had closed the bath houses in his kingdom. So did the king of England in 1546. Thus began a long time when the rich and the poor in Europe lived with dirt in a friendly way. Henry IV, King of France, was famously dirty. Upon learning that a nobleman had taken a bath, the king ordered that, to avoid the attack of disease, the nobleman should not go out.

Though the belief above was long­lived, dirt has no longer been regarded as a nice neighbor ever since the 18th century. Scientifically speaking, cleaning away dirt is good to health. Clean water supply and hand washing are practical means of preventing disease. Yet, it seems that standards of cleanliness have moved beyond science since World War Ⅱ.Advertisements repeatedly sell the idea; clothes need to be whiter than white, cloths ever softer, surfaces to shine. Has the hate for dirt, however, gone too far?

Attitudes to dirt still differ hugely nowadays. Many first­time parents nervously try to warn their children off touching dirt, which might be responsible for the spread of disease. On the contrary,Mary Ruebush,an American immunologist(免疫学家),encourages children to play in the dirt to build up a strong immune system. And the latter position is gaining some ground.

小题1:The kings of France and England in the 16th century closed bath houses because ________.

A.they believed disease could be spread in public baths

B.they thought bath houses were too dirty to stay in

C.they lived healthily in a dirty environment

D.they considered bathing as the cause of skin disease小题2:Which of the following best describes Henry IV's attitude to bathing?

A.Approving.

B.Afraid.

C.Curious.

D.Uninterested.小题3:How does the passage mainly develop?

A.By providing examples.

B.By making comparisons.

C.By following the order of importance.

D.By following the order of time.小题4: What is the author's purpose in writing the passage?

A.To stress the role of dirt.

B.To introduce the history of dirt.

C.To present the change of views on dirt.

D.To call attention to the danger of dirt.