2003 Advanced Programmer Morning Test Analysis - Database

zhaozj2021-02-16  54

Database basic knowledge includes database models

,

Basic knowledge of relational database

,

Database system structure

SQL

usage of

,

Common database management system knowledge. Candidates should be more related to the relevant part of the teaching materials, and they should refer to the "Database System Introduction" Sa Shi (Third Edition).

,

Because there is a more detailed concept description in this book, some places in the textbook have not been said.

1. In the design of the database logic structure, convert the E-R model to a relational model should follow the relevant principles. For three different entities and multiple-to-many contacts between them M: N: P, minimize convert to ____ relationship mode.

A. 2 B. 3 C. 4 D. 5

Answer: c

Analysis: The book has spent two different entities and multiple contacts between them, and two different entity sets can be converted into two relational patterns, and many more contacts can be converted into a relational mode. For three different entity sets and many more-to-many contacts between them M: N: P, but also convert three different entity sets into three relational patterns, two more more contacts can be converted into a relationship into a relationship The pattern, so a total of 4 relational patterns.

2. Given relationship mode R (U, F), u = {A, B, C, D, E}, f = {B → A, D → A, A → E, AC → B}, its properties AD closed Package is __ (1) __, its candidate keyword is __ (2) __.

(1) A. ADE B. ABD C. ABCD D. ACD

(2) A. ABD B. ADE C. ACD D. CD

Answer: (1) a (2) D

Analysis: (1) The definition of the closure is not given in the textbook, and the specific closure definition candidates can refer to the "Introduction to the Database System" Sa Shi (Third Edition), page 184. The closure of the attribute set can be launched by a fixed algorithm: set X (0) = ad; calculates X (1); scanning the various functions in the F set one by one, find the left is a, D or AD function dependent, obtained: A → E, D → a. So X (1) = x (0) ∪EA = ADE. Due to X (0) ≠ x (1), then scan each function dependent in the F set one by one, and find those functions of the subset of the ADE, get A → E, D → A. So X (2) = x (1) ∪EA = ADE. Since x (2) = x (1), the algorithm is here, the closure of its attribute AD is x (2), ie ADE. (2) For the relationship between the buttons and function dependencies: set the relational mode R (A1, A2 ... AN), f is the function dependent on R, X is a subset of R, 1X → A1a2 ... an ∈f (it means X can determine the unique tuple) 2 Do not exist X's true subset y, make Y can determine the unique tuple, then x is a candidate button (it It means X can determine the only one tuple but there is no extra property set). You can use ARMSTRONG's reasoning rules to find X to make X → Abcde. From D → A and AC → B, available: DC → B, from B → A: DC → A, and A → E obtained: DC → E. DC → C, DC → D. So you can see: DC → ABCDE. Therefore, the candidate key is CD.

3. If there is a relational mode R (A, B, C) and S (C, D, E), for the following relationship algebraic expression: E = πa, D (B <'2003' ∧rc = sc∧e =' 80 '(r × s)))

E = πa, D (r.c = S.c (σb <'2003' (r) × σE = '80 '(s))))))

E = πa, D (B <'2003' (r)

σE = '80 '(s)))

E = πa, D (σB <'2003' ∧e = '80' (r

S)) The correct conclusion is __ (20) __, the expression __ (21) __ is the highest.

(1) A. E1≡E2≡e3≡e4 B. E3≡e4 but E1 ≠ E2

C. E1≡E2 But E3 ≠ E4 D. E3 ≠ E4 But E2≡e4

(2) A. E1 C. E3 B. E2 D. E4

Answer: (1) a (2) c

Analysis: (1) Query meaning of this question is to find R.C = S.c, where B <'2003' and E = '80 ', only these records of A and D attributes. As seen from E1, E2, E3, and E4, they are equivalent. (2) The purpose of query optimization is to save both time and improve efficiency for the system. The optimized strategy has the following: 1 In the relational algebraic expression, the selection operation is performed as soon as possible (this is the most basic one) 2 to merge the Cartesian and subsequent selection operations. F Sub-operation (F join) 3 simultaneously calculate a series of selection and projection operations (simultaneously) 4 Reserved the result of the same sub-expression 5 At appropriate to preprocessing the relational file 6, it is estimated to calculate the calculation before calculating the expression. According to Article 1, E3 is the highest in the query efficiency.

4. Collection a = {d. b. The binary relationship R on C} is: r = {, , )}, then dual relational R is ____.

A. Anti-BRT B. Anti-reverse C. Symmetrical D. Transmitted

Answer: D

Analysis: This is the scope of discrete mathematics. Candidates can easily solve the meaning of the meaning of the impliance, anti-reversion, symmetry, and pass. R is not anti-negligation, because the R does not contain . Because R is contained in but does not contain . It is not against the opposite because it contains . It is not symmetrical because R is contained in but does not include . R is transmitted, because only , and can be delivered in R, while the result is in it.

转载请注明原文地址:https://www.9cbs.com/read-23940.html

New Post(0)