上海交通大学数据库原理陆朝俊复习.docx

合集下载
相关主题
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

ER

f \ r g

/ \ If we translate this diagram to relations in the normal way for E/R diagrams described in the textbook, which relation schema would not be in the resulting database schema?

(A)E(a,c,b) (B) S(a,c£g) (C) F(c,d) (D) R(a,c)

If we instead used the “object-oriented" approach to translating this E/R diagram to relations, how many relation schema would be different (when compared to the E/R-to-relations translation), either in their schema, or their set of tuples, or both?

(A)1 (B) 2 (C) 3 (D) 4

Convert the following E/R diagram (with details omitted) to a relational database schema using the object-oriented method・How many relation schemas will be produced? (Assume that each entity set has its own special attributes.)

B C

D

(A) 1 (B) 4 (C)5 (D)6

Relational Theory

Given a relation R(A,B,C,D,E) and FDs AB T CE,B T D,and D T E, which of the following FD's can not be inferred?

(A)AD T CE (B) BC T D (C) AB T A (D) B T E

Given a relation R(A,B,C,D) with FD: A T BC, which of the following MVD's can not be inferred?

(A)A TT EC

(B)A TT B

(C)A TT BD

(D)None of the above.

Suppose we have a relation R(A,B,C,D,E) and the FD's A T DE,D T B,and E—>C. If we project R (and therefore its FD,s) onto schema S(A,B,C),what is true about the key(s) for S?

(A)Only ABC is a key

(B)Only A is a key

(C)Only DE is a key

(D)A5 B, and C are each keys

Suppose we are given a relation schema R(A,B,C,D,E) with functional dependencies A T B,BC T D and E T C. If we project R onto S(B,C,D,E),which of the following functional dependencies holds in S and is not a BCNF violation for S?

(A)BC T D (B) BE T D (C) B T E (D) E T C

Suppose that R(A,B,C,D) satisfies MVD:A TT B and it is known that R has tuples (al,bl,cl,dl), (al,b2?c25d2)? and (a2,bl,cl,d2)・How many tuples must R have at least?

(A)3 (B)4 (C)5 (D)6

Relational algebra and Datalog

In the following question, assume R and S are bags, and the operators are bag operators.

Q1:(RU S)-(RAS)

Q2: (S-R) U (R-S)

(A)QI and Q2 produce the same answer.

(B)The answer to QI is always contained in the answer to Q2.

(C)The answer to Q2 is always contained in the answer to QI.

(D)QI and Q2 produce different answers.

Given relations P(A,B,C) and Q(C,D),which of the following relational algebra expressions is equivalent to this Datalog rule: Answer(x,w) P(x,y,z) AND Q(y,w) AND x

(A)兀P.A,Q.D(6.A

(B)兀P.A,Q.D(6.A

(C)兀P.A,Q.D(6.A

(D)兀P.A,Q.D(6.A

相关文档
最新文档