问题 问答题

下面是用E-SQL实现的销售业务程序的一部分,请补全空缺处的代码。
SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
INSERT INTO 订单表 VALUES (:OID,:CID,:MID,:qty);
if error then ROLLBACK;

  • (a) ;
    UPDATE 库存表
    SET 库存量=库存量-:qty
    WHERE
  • (b) ;
    if error then ROLLBACK; return;
  • (c) ;

答案

参考答案:COMMTT

解析:本问题考查对2PL协议理论与SQL中的隔离级别,以及嵌入式SQL的编程实践。
本题给出的空缺(a)是在事务回滚之后,需要补充的是控制程序逻辑的return语句;空缺(b)要补充的是WHERE条件,即指定的商品ID;空缺(c)要补充的是事务提交语句COMMIT。

阅读理解
A famous foreign company in China wanted a Clerk for its public relation department (公关部).
A beautiful girl with a master’s degree(硕士学位) went through a lot of challenges and her name was on the list. In the final stage she faced an interview together -with another girl. Both of them were outstanding,
not only in looks but also in education.
The girl was successful in the interview. It seemed that she would get the chance. At last the examiner asked her, "Can you come to the office next Monday?" Shocked by the unexpected question, the beautiful girl couldn’t make a decision at the moment, so she said, "I have to talk with my parents before I give an answer. " The examiner felt surprised but said calmly, "If so, let’ s wait till you are ready.
The next day, the girl came to tell the examiner that her parents had agreed to let her begin work next Monday. But the examiner said regretfully (遗憾地), "Sorry, another suitable candidate (选手)has got the job. You had better try another place. "The beautiful girl was surprised. She asked for an explanation(解释) and was told, "What is needed here is a person who knows her own mind. "
That was how a good opportunity right under the nose of a beautiful girl ran away.
小题1: The beautiful girl wanted to ask her parents for advice because_________
A.she didn’t like the jobB.she didn’t expect the examiner would ask such a question
C.she didn’t want to answer the questionD.her parents would be angry if she didn’t ask them
小题2: We can learn from the passage that__________
A.the company lost its best clerk
B.no girl got the job
C.the other girl who failed at the last interview might get the job
D.the examiner was very pleased with the girl
小题3:The examiner regarded_________as the most important.
A.a person’s confidence
B.a person’s knowledge
C.aperson’sageD.a person’ s beautiful looks
小题4: The underlined phrase "right under the nose of" probably means________
A.就在鼻子下B.想要得到的C.没有把握的D.就在眼前的
小题5: The best title for the passage above might be___________
A.Make Decisions With Your Parents
B.A Successful Interview
C.Use Your Own Mind
D.Answer the Examiner’s Question Quickly
单项选择题