1、(B) 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.)Relational TheoryGiven a relation R(A,B,C,D,E) and FDs ABtCE, BtD,and
2、 DtE, which of the following FDs can not be inferred?(A) ADtCE (B) BCtD (C) ABtA (D) BtEGiven a relation R(A,B,C,D) with FD: AtBC, which of the following MVD(A) AttEC(B) AttB(C) AttBD(D) None of the above.Suppose we have a relation R(A,B,C,D,E) and the FDs AtDE, DtB,and EC. If we project R (and ther
3、efore 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 keysSuppose we are given a relation schema R(A,B,C,D,E) with functional dependencies AtB, BCtD and EtC. If we project R onto S(B,C,D,E),which
4、of the following functional dependencies holds in S and is not a BCNF violation for S?(A) BCtD (B) BEtD (C) BtE (D) EtCSuppose that R(A,B,C,D) satisfies MVD:AttB 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)
5、6Relational algebra and DatalogIn 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 an
6、swer 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 xy(A) 兀P.A,Q.D(6.AP.B(P P.C=Q.C Q)(B) 兀P.A,Q.D(6.AQ.C and P.C=Q.C(? X Q)(C) 兀p.a,q.d(6.a
7、p.c(P) 00 Q)(D) 兀p.a,q.d(6.a 10; SELECT a FROM R WHERE b 10 GROUP BY a;Consider the following two SQL queries on relations R(a,b) and S(c): SELECT a FROM RWHERE b ALL (SELECT c FROM S); ANY (SELECT c FROM S);(A) Q1 and Q2 always produce the same answer.(B) The answer to QI is always contained in the
8、 answer to Q2Given R(A,B)=(a;10),(b;20),(c,30), and execute the following three statements. What is the result of the last statement?create view V as select A from R where B10;insert into V values(cT);select count(*) from V;Given a relation R(x) and two queries as follows: SELECT x FROM R; (SELECT x
9、 FROM R) UNION (SELECT x FROM R);In the 3-valued logic used by SQL, suppose x has the value NULL and y is TRUE, the result for (x 1) OR y is:(A) FALSE (B) UNKNOWN (C) TRUE (D) NULLConsider the following two SQL queries on relations R(a?b) and S(b9c): (RNATURAL FULL OUTER JOIN S)UNION(R NATURAL JOIN
10、S); (R NATURAL LEFT OUTER JOIN S)(R NATURAL RIGHT OUTER JOIN S);Suppose that relation R(A,B) has 100 tuples and S(B,C) has 50 tuples. The number of tuples in R NATURAL LEFT OUTER JOIN S is at most:(A) 50 (B) 100 (C) 150 (D) 5000Assume that a relation R(a,b) has no NULLs but may have duplicates Compare the following two queries: SELECT count(*) FROM R GROUP BY a; SELECT count(b) FROM R GROUP BY a;In the following, the results of QI and Q2 should be taken to be the result of the final SELECT * FROM R. Assume that the schema
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1