问题 问答题

(1)编写程序“汇率情况.prg”,完成下列操作:根据“外汇汇率”表中的数据产生rate表中的数据。要求将所有“外汇汇率”表中的数据插入rate表中并且顺序不变,由于“外汇汇率”中的“币种1”和“币种2”存放的是“外币名称”,而rate表中的“币种1代码”和“币种2代码”应该存放“外币代码”,所以插入时要做相应的改动,“外币名称”与“外币代码”的对应关系存储在“外汇代码”表中。 注意:程序必须执行一次,保证rate表中有正确的结果。 (2)使用查询设计器建立一个查询文件qx. qpr。查询要求:外汇帐户中有多少“日元”和“欧元”。查询结果包括了“外币名称”、“钞汇标志”、“金额”,结果按“外币名称”升序排序,在“外币名称”相同的情况下按“金额”降序排序,并将查询结果存储于表wb. dbf中。

答案

参考答案:

解析:在命令窗口中输入命令:MODIFY COMMAND 汇率情况,在程序文件编辑器窗口输入如下程序段: ****文件“汇率情况”中的程序段**** SELECT 外汇代码.外币代码,外汇代码_a.外币代码,外汇汇率.买入价,外汇汇率.卖出价; FROM 外汇!外汇代码 INNER JOIN 外汇!外汇汇率; INNER JOIN 外汇外汇代码 外汇代码_a; ON 外汇汇率.币种2=外汇代码_a.外币名称; ON 外汇代码.外币名称=外汇汇率.币种1; INTO CURSOR atemp && 写入数据表 rate 中 GO TOP DO WHILE NOT EOF () SCATTER TO arr INSERT INTO rate FROM ARRAY arr SKIP ENDDO ***************************************** 在命令窗口输入命令:DO汇率情况,运行程序,通过BROWSE命令可查看结果。 (2)在命令窗口输入命令:CREATE QUERY qx,打开查询设计器,新建一个查询。在查询设计器中,分别将“外汇帐户”和“外汇代码”两个数据表文件添加到查询设计器中,系统自动查找两个数据表中匹配的字段进行内部联接,单击“确定”按钮。 在查询设计器中的“字段”选项卡中,将“可用字段”列表框中的“外汇代码.外币名称”、“外汇帐户.钞汇标志”和“外汇帐户.金额”三个字段添加到右边的“选定字段”列表框中,在“筛选”选项卡的“字段名”下拉框中选择“外汇代码.外币名称”,在“条件”下拉框中选择“=”,在实例文本框中输入“日元”,在“逻辑”下拉框中选择“OR”,在下一条件中,“字段名”下拉框中选择“外汇代码.外币名称”,在“条件”下拉框中选择“=”,在实例文本框中输入“欧元”。在“排序依据”选项卡的“选定字段”选择“外汇代码.外币名称”为“排序条件”并选择“升序”排序,选择“外汇帐户.金额”并选择为“降序”排序。执行菜单命令“查询”—“查询去向”,系统弹出“查询去向”对话框,单击“表”按钮,在“表名”文件框中输入表名wb,单击“确定”退出。 执行菜单“查询”—“运行查询”,查询结果将自动保存到wb数据表中。 本大题1小题考查了SQL联接查询,设计过程中主要注意两个表之间进行关联的字段,将一个表的记录向数据库表插入时,可通过数组进行插入;2小题考查的是多表查询文件的建立以及查询去向。在设置查询去向的时候,应该注意表的选择。

解答题
阅读理解

There is a brown female(母的) Canadian duck that weighs only four hundred fifty grams. The duck had flown to the southern state of Florida for the winter.A hunter shot it on January fifteenth and  took it to his home in the city of Tallahassee.He put it in the refrigerator(冰箱).Two days later the man’s wife opened the refrigerator door.The duck lifted its head and looked at her.It was alive!

The family took the duck to a doctor who treats animals.The doctor gave the duck to the Goose Creek Animal Sanctuary(动物保护区).Animal sanctuaries provide homes for animals and teach people about their care.

The doctor said it was easy to understand why people thought the duck was dead. He said ducks generally do not move a 1ot,especially after being shot.And he said its low body temperature helped it survive in the refrigerator.

That was enough to make the duck famous around the world.The Tallahassee newspaper published the story that was re-printed in many different countries.But that was not the end of the story.

Workers at the wildlife sanctuary named the duck Perky.And they got the doctor to give an operation to repair the duck’s damaged wing.During the operation,Perky stopped breathing--not just once but two times.The doctor tried to save Perky by giving her oxygen.But he finally said the duck had died.A few seconds later, however, Perky began to move.Reports say the people in the operating room were so happy that they cried.

Workers at the wildlife sanctuary say Perky will not have any more operations. It seems the drugs that were used had side-effects on her.Perky is expected to live at the sanctuary.And a local company has begun to sell T-shirts showing a picture of the lucky duck. Money from the sale of the shirts will help pay for Perky’s care.

小题1:Which of the following statements is TRUE?

A.Animal sanctuaries are homes specially for wounded animals.

B.The hunter shot the duck in the wing.

C.Ducks do not move at all for the whole winter.

D.The hunter’s wife intended to free the duck in the refrigerator.小题2:The underlined Word “That” in the fourth paragraph refers to the fact that______.

A.the duck survived the shot and the cold in the refrigerator

B.the hunter had saved the duck by freezing it

C.the hunter shot the duck from Canada

D.the Tallahassee newspaper published the story小题3:The duck in the story______.

A.was big and strong

B.flew to Florida for food

C.stayed in the refrigerator to keep its body temperature low

D.was considered dead before being put in the refrigerator小题4:What is the best title for the passage?

A.Save the Duck

B.The Lucky Duck

C.Stop Killing Ducks

D.The Poor Duck小题5:It can be inferred from the passage that_______.

A.the local company will get large profits by selling the T-shirts

B.it was illegal for me hunter to shoot the duck

C.the duck is likely to be well cared for in the sanctuary

D.Perky likes Florida better than Canada