问题 单项选择题

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

检索至少有一名职工信息的“仓库号”及仓库的“所在地”和“人数”,正确的SQL命令是( )。

A.SELECT 仓库号,所在地,人数 FROM 仓库 WHERE IN; (SELECT 仓库号 FROM 职工 WHERE 仓库号=职工.仓库号)

B.SELECT 仓库号,所在地,人数 FROM 仓库 WHERE 仓库号 IN; SELECT 仓库号 FROM 职工 WHERE 仓库号=仓库.仓库号

C.SELECT 仓库号,所在地,人数 FROM 仓库 WHERE NOT EXISTS; (SELECT 仓库号 FROM 职工 WHERE 仓库号=仓库.仓库号)

D.SELECT 仓库号,所在地,人数 FROM 仓库 WHERE EXISTS; (SELECT 仓库号 FROM 职工 WHERE 仓库号=仓库.仓库号)

答案

参考答案:D

解析: 本题中EXISTS属于SQL查询谓词,EXISTS或NOT EXISTS是用来检查在子查询中是否有结果返回,即存在元组或不存在元组,子查询要用圆括号括起来。本题SQL查询中的子查询查询的是“职工”表中“仓库号”等于“仓库”表中“仓库号”的数据,然后在外层查询中检索“仓库”表中的“仓库号”是否存在与于查询的查询结果中,将存在的“仓库号”显示其“仓库号”、“所在地”和“人数”的信息。

阅读理解

One day, Jack’s parents told him that his grandpa would retire(退休) after working for forty years. Jack said in surprise, “I’m only seven, so it means Grandpa has been… er … A really long time!”

His parents said, “Yes. That’s why we are going to have a surprising party for him. ”

Jack loved his grandpa and wanted to do something special for him. He remembered the business card his grandpa had given him two years before. He knew that his grandpa would no longer have theposition(职位) on that card, so he decided to build a new one for his grandpa.

When the big day came, Jack was ready. But he didn’t want to put his gift together with others’. He carried it around with him the whole evening.

When all the other people left, he took his grandpa’s hand and brought him over to a chair and gave him the gift.

His grandpa smiled, “Well, it must be a beautiful gift. May I open it now?” “Sure!” Jack said excitedly.

As Grandpa opened the gift, tears came into his eyes. Jack gave him the greatest gift he had ever got! They were business cards with new position: FULL-TIME GRANDPA! Jack said, “Now your full-time job is my grandpa!”

Well, how much do I get paid?” his grandpa asked, smiling. “As many hugs as you want!” With these words, Jack gave Grandpa a hug. “Well, I guess that means I’m the richest man in the world!” said Grandpa.

小题1:Who was going to retire?

A.Jack’s grandma.

B.Jack’s grandpa.

C.Jack’s mother.

D.Jack’s father.小题2:Jack remembered __________ his grandpa had given him two years before.

A.the birthday card

B.the boy

C.the book

D.the business card小题3:What did Jack decide to do for his grandpa?

A.To build a new position for him.

B.To draw a picture for him.

C.To sing a song for him.

D.To buy a gift for him.小题4:Which of the following is TRUE?

A.Jack was the first one to give his gift to his grandpa.

B.Jack was the last one to give his gift to his grandpa.

C.Jack gave his gift to his grandpa together with other people.

D.Jack gave his gift to his grandpa together with his parents.小题5:Why were there tears in Grandpa’s eyes?

A.Because he would lose his position.

B.Because he was not cared for.

C.Because he was moved by Jack’s gift

D.Because he was unhappy.

单项选择题