当前位置:文档之家› 数据库系统基础教程答案

数据库系统基础教程答案

数据库系统基础教程答案
数据库系统基础教程答案

Exercise 3.1.1

Answers for this exercise may vary because of different interpretations.

Some possible FDs:

Social Security number → name

Area code → state

Street address, city, state → zipcode

Possible keys:

{Social Security number, street address, city, state, area code, phone number}

Need street address, city, state to uniquely determine location. A person could

have multiple addresses. The same is true for phones. These days, a person could

have a landline and a cellular phone

Exercise 3.1.2

Answers for this exercise may vary because of different interpretations

Some possible FDs:

ID → x-position, y-position, z-position

ID → x-velocity, y-velocity, z-velocity

x-position, y-position, z-position → ID

Possible keys:

{ID}

{x-position, y-position, z-position}

The reason why the positions would be a key is no two molecules can occupy the same point.

Exercise 3.1.3a

The superkeys are any subset that contains A1. Thus, there are 2(n-1) such subsets, since each of the n-1 attributes A2 through A n may independently be chosen in or out.

Exercise 3.1.3b

The superkeys are any subset that contains A1 or A2. There are 2(n-1) such subsets when considering A1 and the n-1 attributes A2 through A n. There are 2(n-2) such subsets when considering A2 and the n-2 attributes A3 through A n. We do not count A1 in these subsets because they are already counted in the first group of subsets. The total number of subsets is 2(n-1) + 2(n-2).

Exercise 3.1.3c

The superkeys are any subset that contains {A1,A2} or {A3,A4}. There are 2(n-2) such subsets when considering {A1,A2} and the n-2 attributes A3 through A n. There are 2(n-2) – 2(n-4) such subsets when considering {A3,A4} and attributes A5 through A n along with the individual attributes A1 and A2. We get the 2(n-4) term because we have to discard the subsets that contain the key {A1,A2} to avoid double counting. The total number of subsets is 2(n-2) +

2(n-2) – 2(n-4).

Exercise 3.1.3d

The superkeys are any subset that contains {A1,A2} or {A1,A3}. There are 2(n-2) such subsets when considering {A1,A2} and the n-2 attributes A3 through A n. There are 2(n-3) such subsets when considering {A1,A3} and the n-3 attributes A4 through A n We do not count A2 in these subsets because they are already counted in the first group of subsets. The total number of subsets is 2(n-2) + 2(n-3).

Exercise 3.2.1a

We could try inference rules to deduce new dependencies until we are satisfied we have them all. A more systematic way is to consider the closures of all 15 nonempty sets of attributes.

For the single attributes we have {A}+ = A, {B}+ = B, {C}+ = ACD, and {D}+ = AD. Thus, the only new dependency we get with a single attribute on the left is C→A.

Now consider pairs of attributes:

{AB}+ = ABCD, so we get new dependency AB→D. {AC}+ = ACD, and AC→D is nontrivial. {AD}+

= AD, so nothing new. {BC}+ = ABCD, so we get BC→A, and BC→D. {BD}+ = ABCD, giving us BD→A and BD→C. {CD}+ = ACD, giving CD→A.

For the triples of attributes, {ACD}+ = ACD, but the closures of the other sets are each ABCD. Thus, we get new dependencies ABC→D, ABD→C, and BCD→A.

Since {ABCD}+ = ABCD, we get no new dependencies.

The collection of 11 new dependencies mentioned above are:

C→A, AB→D, AC→D, BC→A, BC→D, BD→A, BD→C, CD→A, ABC→D, ABD→C, and BCD→A.

Exercise 3.2.1b

From the analysis of closures above, we find that AB, BC, and BD are keys. All other sets either do not have ABCD as the closure or contain one of these three sets.

Exercise 3.2.1c

The superkeys are all those that contain one of those three keys. That is, a superkey

that is not a key must contain B and more than one of A, C, and D. Thus, the (proper) superkeys are ABC, ABD, BCD, and ABCD.

Exercise 3.2.2a

i) For the single attributes we have {A}+ = ABCD, {B}+ = BCD, {C}+ = C, and {D}+ = D. Thus, the new dependencies are A→C and A→D.

Now consider pairs of attributes:

{AB}+ = ABCD, {AC}+ = ABCD, {AD}+ = ABCD, {BC}+ = BCD, {BD}+ = BCD, {CD}+ = CD. Thus the new dependencies are AB→C, AB→D, AC→B, AC→D, AD→B, AD→C, BC→D and BD→C.

For the triples of attributes, {BCD}+ = BCD, but the closures of the other sets are each ABCD. Thus, we get new dependencies ABC→D, ABD→C, and ACD→B.

Since {ABCD}+ = ABCD, we get no new dependencies.

The collection of 13 new dependencies mentioned above are:

A→C, A→D, AB→C, AB→D, AC→B, AC→D, AD→B, AD→C, BC→D, BD→C, ABC→D, ABD→C and ACD→B.

ii) For the single attributes we have {A}+ = A, {B}+ = B, {C}+ = C, and {D}+ = D. Thus, there are no new dependencies.

Now consider pairs of attributes:

{AB}+ = ABCD, {AC}+ = AC, {AD}+ = ABCD, {BC}+ = ABCD, {BD}+ = BD, {CD}+ = ABCD. Thus the new dependencies are AB→D, AD→C, BC→A and CD→B.

For the triples of attributes, all the closures of the sets are each ABCD. Thus, we get new dependencies ABC→D, ABD→C, ACD→B and BCD→A.

Since {ABCD}+ = ABCD, we get no new dependencies.

The collection of 8 new dependencies mentioned above are:

AB→D, AD→C, BC→A, CD→B, ABC→D, ABD→C, ACD→B and BCD→A.

iii) For the single attributes we have {A}+ = ABCD, {B}+ = ABCD, {C}+ = ABCD, and {D}+ = ABCD. Thus, the new dependencies are A→C, A→D, B→D, B→A, C→A, C→B, D→B and D→C.

Since all the single attributes’ closures are ABCD, any superset of the single

attributes will also lead to a closure of ABCD. Knowing this, we can enumerate the rest

of the new dependencies.

The collection of 24 new dependencies mentioned above are:

A→C, A→D, B→D, B→A, C→A, C→B, D→B, D→C, AB→C, AB→D, AC→B, AC→D, AD→B, AD→C, BC→A, BC→D, BD→A, BD→C, CD→A, CD→B, ABC→D, ABD→C, ACD→B and BCD→A.

Exercise 3.2.2b

i) From the analysis of closures in 3.2.2a(i), we find that the only key is A. All other sets either do not have ABCD as the closure or contain A.

ii) From the analysis of closures 3.2.2a(ii), we find that AB, AD, BC, and CD are keys.

All other sets either do not have ABCD as the closure or contain one of these four sets.

iii) From the analysis of closures 3.2.2a(iii), we find that A, B, C and D are keys. All other sets either do not have ABCD as the closure or contain one of these four sets.

Exercise 3.2.2c

i) The superkeys are all those sets that contain one of the keys in 3.2.2b(i). The superkeys are AB, AC, AD, ABC, ABD, ACD, BCD and ABCD.

ii) The superkeys are all those sets that contain one of the keys in 3.2.2b(ii). The superkeys are ABC, ABD, ACD, BCD and ABCD.

iii) The superkeys are all those sets that contain one of the keys in 3.2.2b(iii). The superkeys are AB, AC, AD, BC, BD, CD, ABC, ABD, ACD, BCD and ABCD.

Exercise 3.2.3a

Since A1A2…A n C contains A1A2…A n, then the closure of A1A2…A n C contains B. Thus it follows that A1A2…A n C→B.

Exercise 3.2.3b

From 3.2.3a, we know that A1A2…A n C→B. Using the concept of trivial dependencies, we can show that A1A2…A n C→C. Thus A1A2…A n C→BC.

Exercise 3.2.3c

From A1A2…A n E1E2…E j, we know that the closure contains B1B2…B m because of the FD A1A2…A n→

B1B2…B m. The B1B2…B m and the E1E2…E j combine to form the C1C2…C k. Thus the closure of

A1A2…A n E1E2…E j contains D as well. Thus, A1A2…A n E1E2…E j→D.

Exercise 3.2.3d

From A1A2…A n C1C2…C k, we know that the closure contains B1B2…B m because of the FD A1A2…A n→

B1B2…B m. The C1C2…C k also tell us that the closure of A1A2…A n C1C2…C k contains D1D2…D j. Thus, A1A2…A n C1C2…C k→B1B2…B k D1D2…D j.

Exercise 3.2.4a

If attribute A represented Social Security Number and B represented a person’s name,

then we would assume A→B but B→A would not be valid because there may be many people

with the same name and different Social Security Numbers.

Exercise 3.2.4b

Let attribute A represent Social Security Number, B represent gender and C represent name. Surely Social Security Number and gender can uniquely identify a person’s name (i.e.

AB→C). A Social Security Number can also uniquely identify a person’s name (i.e. A→C). However, gender does not uniquely determine a name (i.e. B→C is not valid).

Exercise 3.2.4c

Let attribute A represent latitude and B represent longitude. Together, both attributes can uniquely determine C, a point on the world map (i.e. AB→C). However, neither A nor B can uniquely identify a point (i.e. A→C and B→C are not valid).

Exercise 3.2.5

Given a relation with attributes A1A2…A n, we are told that there are no functional dependencies of the form B1B2…B n-1→C where B1B2…B n-1 is n-1 of the attributes from A1A2…A n and C is the remaining attribute from A1A2…A n. In this case, the set B1B2…B n-1 and any subset do not functionally determine C. Thus the only functional dependencies that we can make are ones where C is on both the left and right hand sides. All of these functional dependencies would be trivial and thus the relation has no nontrivial FD’s.

Exercise 3.2.6

Let’s prove this by using the contrapositive. We wish to show that if X+ is not a subset of Y+, then it must be that X is not a subset of Y.

If X+ is not a subset of Y+, there must be attributes A1A2…A n in X+ that are not in Y+. If any of these attributes were originally in X, then we are done because Y does not contain any of the A1A2…A n. However, if the A1A2…A n were added by the closure, then we must examine the case further. Assume that there was some FD C1C2…C m→A1A2…A j where A1A2…A j is some subset of A1A2…A n. It must be then that C1C2…C m or some subset of C1C2…C m is in X. However, the attributes C1C2…C m cannot be in Y because we assumed that attributes A1A2…A n are only in X+ and are not in Y+. Thus, X is not a subset of Y.

By proving the contrapositive, we have also proved if X ? Y, then X+? Y+.

Exercise 3.2.7

The algorithm to find X+ is outlined on pg. 76. Using that algorithm, we can prove that (X+)+ = X+. We will do this by using a proof by contradiction.

Suppose that (X+)+≠ X+. Then for (X+)+, it must be that some FD allowed additional attributes to be added to the original set X+. For example, X+→ A where A is some attribute not in X+. However, if this were the case, then X+ would not be the closure of X. The closure of X would have to include A as well. This contradicts the fact that we were

given the closure of X, X+. Therefore, it must be that (X+)+ = X+ or else X+ is not the closure of X.

Exercise 3.2.8a

If all sets of attributes are closed, then there cannot be any nontrivial functional dependencies. Suppose A1A2...A n→B is a nontrivial dependency. Then {A1A2...A n}+ contains B and thus A1A2...A n is not closed.

Exercise 3.2.8b

If the only closed sets are ? and {A,B,C,D}, then the following FDs hold:

A→B A→C A→D

B→A B→C B→D

C→A C→B C→D

D→A D→B D→C

AB→C AB→D

AC→B AC→D

AD→B AD→C

BC→A BC→D

BD→A BD→C

CD→A CD→B

ABC→D

ABD→C

ACD→B

BCD→A

Exercise 3.2.8c

If the only closed sets are ?, {A,B} and {A,B,C,D}, then the following FDs hold:

A→B

B→A

C→A C→B C→D

D→A D→B D→C

AC→B AC→D

AD→B AD→C

BC→A BC→D

BD→A BD→C

CD→A CD→B

ABC→D

ABD→C

ACD→B

BCD→A

Exercise 3.2.9

We can think of this problem as a situation where the attributes A,B,C represent cities and the functional dependencies represent one way paths between the cities. The minimal bases are the minimal number of pathways that are needed to connect the cities. We do not want to create another roadway if the two cities are already connected.

The systematic way to do this would be to check all possible sets of the pathways. However, we can simplify the situation by noting that it takes more than two pathways to visit the two other cities and come back. Also, if we find a set of pathways that is minimal, adding additional pathways will not create another minimal set.

The two sets of minimal bases that were given in example 3.11 are:

{A→B, B→C, C→A}

{A→B, B→A, B→C, C→B}

The additional sets of minimal bases are:

{C→B, B→A, A→C}

{A→B, A→C, B→A, C→A}

{A→C, B→C, C→A, C→B}

Exercise 3.2.10a

We need to compute the closures of all subsets of {ABC}, although there is no need to think about the empty set or the set of all three attributes. Here are the calculations for the remaining six sets:

{A}+=A

{B}+=B

{C}+=ACE

{AB}+=ABCDE

{AC}+=ACE

{BC}+=ABCDE

We ignore D and E, so a basis for the resulting functional dependencies for ABC is: C→A and AB→C. Note that BC->A is true, but follows logically from C->A, and therefore may be omitted from our list.

Exercise 3.2.10b

We need to compute the closures of all subsets of {ABC}, although there is no need to think about the empty set or the set of all three attributes. Here are the calculations for the remaining six sets:

{A}+=AD

{B}+=B

{C}+=C

{AB}+=ABDE

{AC}+=ABCDE

{BC}+=BC

We ignore D and E, so a basis for the resulting functional dependencies for ABC is: AC→B.

Exercise 3.2.10c

We need to compute the closures of all subsets of {ABC}, although there is no need to

think about the empty set or the set of all three attributes. Here are the calculations

for the remaining six sets:

{A}+=A

{B}+=B

{C}+=C

{AB}+=ABD

{AC}+=ABCDE

{BC}+=ABCDE

We ignore D and E, so a basis for the resulting functional dependencies for ABC is: AC→B and BC→A.

Exercise 3.2.10d

We need to compute the closures of all subsets of {ABC}, although there is no need to

think about the empty set or the set of all three attributes. Here are the calculations

for the remaining six sets:

{A}+=ABCDE

{B}+=ABCDE

{C}+=ABCDE

{AB}+=ABCDE

{AC}+=ABCDE

{BC}+=ABCDE

We ignore D and E, so a basis for the resulting functional dependencies for ABC is: A→B, B→C and C→A.

Exercise 3.2.11

For step one of Algorithm 3.7, suppose we have the FD ABC→DE. We want to use Armstrong’

s Axioms to show that ABC→D and ABC→E follow. Surely the functional dependencies DE→D and DE→E hold because they are trivial and follow the reflexivity property. Using the transitivity rule, we can derive the FD ABC→D from the FDs ABC→DE and DE→D. Likewise, we can do the same for ABC→DE and DE→E and derive the FD ABC→E.

For steps two through four of Algorithm 3.7, suppose we have the initial set of

attributes of the closure as ABC. Suppose also that we have FDs C→D and D→E. According

to Algorithm 3.7, the closure should become ABCDE. Taking the FD C→D and augmenting both sides with attributes AB we get the FD ABC→ABD. We can use the splitting method in step

one to get the FD ABC→D. Since D is not in the closure, we can add attribute D. Taking the FD D→E and augmenting both sides with attributes ABC we get the FD ABCD→ABCDE.

Using again the splitting method in step one we get the FD ABCD→E. Since E is not in the closure, we can add attribute E.

Given a set of FDs, we can prove that a FD F follows by taking the closure of the left side of FD F. The steps to compute the closure in Algorithm 3.7 can be mimicked by Armstrong’s axioms and thus we can prove F from the given set of FDs using Armstrong’s axioms.

Exercise 3.3.1a

In the solution to Exercise 3.2.1 we found that there are 14 nontrivial dependencies, including the three given ones and eleven derived dependencies. They are: C→A, C→D,

D→A, AB→D, AB→ C, AC→D, BC→A, BC→D, BD→A, BD→C, CD→A, ABC→D, ABD→C, and BCD→A.

We also learned that the three keys were AB, BC, and BD. Thus, any dependency above that does not have one of these pairs on the left is a BCNF violation. These are: C→A, C→D,

D→A, AC→D, and CD→A.

One choice is to decompose using the violation C→D. Using the above FDs, we get ACD and BC as decomposed relations. BC is surely in BCNF, since any two-attribute relation is. Using Algorithm 3.12 to discover the projection of FDs on relation ACD, we discover that ACD is not in BCNF since C is its only key. However, D→A is a dependency that holds in ABCD and therefore holds in ACD. We must further decompose ACD into AD and CD. Thus, the three relations of the decomposition are BC, AD, and CD.

Exercise 3.3.1b

By computing the closures of all 15 nonempty subsets of ABCD, we can find all the

nontrivial FDs. They are B→C, B→D, AB→C, AB→D, BC→D, BD→C, ABC→D and ABD→C. From the closures we can also deduce that the only key is AB. Thus, any dependency above that does not contain AB on the left is a BCNF violation. These are: B→C, B→D, BC→D and

BD→C.

One choice is to decompose using the violation B→C. Using the above FDs, we get BCD and AB as decomposed relations. AB is surely in BCNF, since any two-attribute relation is. Using Algorithm 3.12 to discover the projection of FDs on relation BCD, we discover that BCD is in BCNF since B is its only key and the projected FDs all have B on the left side. Thus the two relations of the decomposition are AB and BCD.

Exercise 3.3.1c

In the solution to Exercise 3.2.2(ii), we found that there are 12 nontrivial dependencies, including the four given ones and the eight derived ones. They are AB→C, BC→D, CD→A, AD→B, AB→D, AD→C, BC→A, CD→B, ABC→D, ABD→C, ACD→B and BCD→A.

We also found out that the keys are AB, AD, BC, and CD. Thus, any dependency above that does not have one of these pairs on the left is a BCNF violation. However, all of the FDs contain a key on the left so there are no BCNF violations.

No decomposition is necessary since all the FDs do not violate BCNF.

Exercise 3.3.1d

In the solution to Exercise 3.2.2(iii), we found that there are 28 nontrivial dependencies, including the four given ones and the 24 derived ones. They are A→B, B→C, C→D, D→A, A→C, A→D, B→D, B→A, C→A, C→B, D→B, D→C, AB→C, AB→D, AC→B, AC→D,

AD→B, AD→C, BC→A, BC→D, BD→A, BD→C, CD→A, CD→B, ABC→D, ABD→C, ACD→B and BCD→A.

We also found out that the keys are A,B,C,D. Thus, any dependency above that does not

have one of these attributes on the left is a BCNF violation. However, all of the FDs contain a key on the left so there are no BCNF violations.

No decomposition is necessary since all the FDs do not violate BCNF.

Exercise 3.3.1e

By computing the closures of all 31 nonempty subsets of ABCDE, we can find all the nontrivial FDs. They are AB→C, DE→C, B→D, AB→D, BC→D, BE→C, BE→D, ABC→D, ABD→C, ABE→C, ABE→D, ADE→C, BCE→D, BDE→C, ABCE→D, and ABDE→C. From the closures we can

also deduce that the only key is ABE. Thus, any dependency above that does not contain ABE on the left is a BCNF violation. These are: AB→C, DE→C, B→D, AB→D, BC→D, BE→C, BE→D, ABC→D, ABD→C, ADE→C, BCE→D and BDE→C.

One choice is to decompose using the violation AB→C. Using the above FDs, we get ABCD

and ABE as decomposed relations. Using Algorithm 3.12 to discover the projection of FDs on relation ABCD, we discover that ABCD is not in BCNF since AB is its only key and the FD B→D follows for ABCD. Using violation B→D to further decompose, we get BD and ABC as decomposed relations. BD is in BCNF because it is a two-attribute relation. Using Algorithm 3.12 again, we discover that ABC is in BCNF since AB is the only key and AB→C

is the only nontrivial FD. Going back to relation ABE, following Algorithm 3.12 tells us that ABE is in BCNF because there are no keys and no nontrivial FDs. Thus the three relations of the decomposition are ABC, BD and ABE.

Exercise 3.3.1f

By computing the closures of all 31 nonempty subsets of ABCDE, we can find all the nontrivial FDs. They are: C→B, C→D, C→E, D→B, D→E, AB→C, AB→D, AB→E, AC→B, AC→D, AC→E, AD→B, AD→C, AD→E, BC→D, BC→E, BD→E, CD→B, CD→E, CE→B, CE→D, DE→B,

ABC→D, ABC→E, ABD→C, ABD→E, ABE→C, ABE→D, ACD→B, ACD→E, ACE→B, ACE→D, ADE→B, ADE→C, BCD→E, BCE→D, CDE→B, ABCD→E, ABCE→D, ABDE→C and ACDE→B. From the closures we can also deduce that the keys are AB, AC and AD. Thus, any dependency above that does not contain one of the above pairs on the left is a BCNF violation. These are: C→B, C→D,

C →E,

D →B, D →E, BC →D, BC →E, BD →E, CD →B, CD →E, C

E →B, CE →D, DE →B, BCD →E, BCE →D and CDE →B.

One choice is to decompose using the violation D →B. Using the above FDs, we get BDE and ABC as decomposed relations. Using Algorithm 3.12 to discover the projection of FDs on relation BDE, we discover that BDE is in BCNF since D, BD, DE are the only keys and all the projected FDs contain D, BD, or DE in the left side. Going back to relation ABC,

following Algorithm 3.12 tells us that ABC is not in BCNF because since AB and AC are its only keys and the FD C →B follows for ABC. Using violation C →B to further decompose, we get BC and AC as decomposed relations. Both BC and AC are in BCNF because they are two-attribute relations. Thus the three relations of the decomposition are BDE, BC and AC.

Exercise 3.3.2

Yes, we will get the same result. Both A →B and A →BC have A on the left side and part of

the process of decomposition involves finding {A}+

to form one decomposed relation and A

plus the rest of the attributes not in {A}+

as the second relation. Both cases yield the same decomposed relations.

Exercise 3.3.3

Yes, we will still get the same result. Both A →B and A →BC have A on the left side and

part of the process of decomposition involves finding {A}+

to form one decomposed

relation and A plus the rest of the attributes not in {A}+

as the second relation. Both cases yield the same decomposed relations.

Exercise 3.3.4

This is taken from Example 3.21 pg. 95.

Suppose that an instance of relation R only contains two tuples.

The projections of R onto the relations with schemas {A,B} and {B,C} are:

If we do a natural join on the two projections, we will get:

The result of the natural join is not equal to the original relation R.

Exercise 3.4.1a

This is the initial tableau:

→A.

Since there is not an unsubscripted row, the decomposition for R is not lossless for this set of FDs.

We can use the final tableau as an instance of R as an example for why the join is not lossless. The projected relations are:

The joined relation is:

The joined relation has three more tuples than the original tableau.

Exercise 3.4.1b

This is the initial tableau:

This is the final tableau after applying FDs AC→E and BC→D

Since there is an unsubscripted row, the decomposition for R is lossless for this set of FDs.

Exercise 3.4.1c

This is the initial tableau:

This is the final tableau after applying FDs A→D, D→E and B→D.

Since there is an unsubscripted row, the decomposition for R is lossless for this set of FDs.

Exercise 3.4.1d

This is the initial tableau:

This is the final tableau after applying FDs A→D, CD→E and E→D

Since there is an unsubscripted row, the decomposition for R is lossless for this set of FDs.

Exercise 3.4.2

When we decompose a relation into BCNF, we will project the FDs onto the decomposed relations to get new sets of FDs. These dependencies are preserved if the union of these new sets is equivalent to the original set of FDs.

For the FDs of 3.4.1a, the dependencies are not preserved. The union of the new sets of FDs is CE→A. However, the FD B→E is not in the union and cannot be derived. Thus the two sets of FDs are not equivalent.

For the FDs of 3.4.1b, the dependencies are preserved. The union of the new sets of FDs is AC→E and BC→D. This is precisely the same as the original set of FDs and thus the two sets of FDs are equivalent.

For the FDs of 3.4.1c, the dependencies are not preserved. The union of the new sets of FDs is B→D and A→E. The FDs A→D and D→E are not in the union and cannot be derived. Thus the two sets of FDs are not equivalent.

For the FDs of 3.4.1d, the dependencies are not preserved. The union of the new sets of FDs is AC→E. However, the FDs A→D, CD→E and E→D are not in the union and cannot be derived. Thus the two sets of FDs are not equivalent.

Exercise 3.5.1a

In the solution to Exercise 3.3.1a we found that there are 14 nontrivial dependencies. They are: C→A, C→D, D→A, AB→D, AB→ C, AC→D, BC→A, BC→D, BD→A, BD→C, CD→A,

ABC→D, ABD→C, and BCD→A.

We also learned that the three keys were AB, BC, and BD. Since all the attributes on the right sides of the FDs are prime, there are no 3NF violations.

Since there are no 3NF violations, it is not necessary to decompose the relation.

Exercise 3.5.1b

In the solution to Exercise 3.3.1b we found that there are 8 nontrivial dependencies. They are B→C, B→D, AB→C, AB→D, BC→D, BD→C, ABC→D and ABD→C.

We also found out that the only key is AB. FDs where the left side is not a superkey or the attributes on the right are not part of some key are 3NF violations. The 3NF violations are B→C, B→D, BC→D and BD→C.

Using algorithm 3.26, we can decompose into relations using the minimal basis B→C and

B→D. The resulting decomposed relations would be BC and BD. However, none of these two sets of attributes is a superkey. Thus we add relation AB to the result. The final set of decomposed relations is BC, BD and AB.

Exercise 3.5.1c

In the solution to Exercise 3.3.1c we found that there are 12 nontrivial dependencies. They are AB→C, BC→D, CD→A, AD→B, AB→D, AD→C, BC→A, CD→B, ABC→D, ABD→C, ACD→B and BCD→A.

We also found out that the keys are AB, AD, BC, and CD. Since all the attributes on the right sides of the FDs are prime, there are no 3NF violations.

Since there are no 3NF violations, it is not necessary to decompose the relation.

Exercise 3.5.1d

In the solution to Exercise 3.3.1d we found that there are 28 nontrivial dependencies. They are A→B, B→C, C→D, D→A, A→C, A→D, B→D, B→A, C→A, C→B, D→B, D→C, AB→C,

AB→D, AC→B, AC→D, AD→B, AD→C, BC→A, BC→D, BD→A, BD→C, CD→A, CD→B, ABC→D,

ABD→C, ACD→B and BCD→A.

We also found out that the keys are A,B,C,D. Since all the attributes on the right sides

of the FDs are prime, there are no 3NF violations.

Since there are no 3NF violations, it is not necessary to decompose the relation.

Exercise 3.5.1e

In the solution to Exercise 3.3.1e we found that there are 16 nontrivial dependencies. They are AB→C, DE→C, B→D, AB→D, BC→D, BE→C, BE→D, ABC→D, ABD→C, ABE→C, ABE→D, ADE→C, BCE→D, BDE→C, ABCE→D, and ABDE→C.

We also found out that the only key is ABE. FDs where the left side is not a superkey or the attributes on the right are not part of some key are 3NF violations. The 3NF

violations are AB→C, DE→C, B→D, AB→D, BC→D, BE→C, BE→D, ABC→D, ABD→C, ADE→C, BCE→D and BDE→C.

Using algorithm 3.26, we can decompose into relations using the minimal basis AB→C,

DE→C and B→D. The resulting decomposed relations would be ABC, CDE and BD. However,

none of these three sets of attributes is a superkey. Thus we add relation ABE to the result. The final set of decomposed relations is ABC, CDE, BD and ABE.

Exercise 3.5.1f

In the solution to Exercise 3.3.1f we found that there are 41 nontrivial dependencies. They are: C→B, C→D, C→E, D→B, D→E, AB→C, AB→D, AB→E, AC→B, AC→D, AC→E, AD→B, AD→C, AD→E, BC→D, BC→E, BD→E, CD→B, CD→E, CE→B, CE→D, DE→B, ABC→D, ABC→E,

ABD→C, ABD→E, ABE→C, ABE→D, ACD→B, ACD→E, ACE→B, ACE→D, ADE→B, ADE→C, BCD→E, BCE→D, CDE→B, ABCD→E, ABCE→D, ABDE→C and ACDE→B.

We also found out that the keys are AB, AC and AD. FDs where the left side is not a superkey or the attributes on the right are not part of some key are 3NF violations. The

3NF violations are C→E, D→E, BC→E, BD→E, CD→E and BCD→E.

Using algorithm 3.26, we can decompose into relations using the minimal basis AB→C, C→D, D→B and D→E. The resulting decomposed relations would be ABC, CD, BD and DE. Since relation ABC contains a key, we can stop with the decomposition. The final set of decomposed relations is ABC, CD, BD and DE.

Exercise 3.5.2a

The usual procedure to find the keys would be to take the closure of all 63 nonempty subsets. However, if we notice that none of the right sides of the FDs contains

attributes H and S. Thus we know that attributes H and S must be part of any key. We eventually will find out that HS is the only key for the Courses relation.

Exercise 3.5.2b

The first step to verify that the given FDs are their own minimal basis is to check to see if any of the FDs can be removed. However, if we remove any one of the five FDs, the remaining four FDs do not imply the removed FD.

The second step to verify that the given FDs are their own minimal basis is to check to see if any of the left sides of an FD can have one or more attributes removed without losing the dependencies. However, this is not the case for the four FDs that contain two attributes on the left side.

Thus, the given set of FDs has been verified to be the minimal basis.

Exercise 3.5.2c

Since the only key is HS, the given set of FDs has some dependencies that violate 3NF. We also know that the given set of FDs is a minimal basis. Thus the decomposed relations are CT, HRC, HTR, HSR and CSG. Since the relation HSR contains a key, we do not need to add an additional relation. The final set of decomposed relations is CT, HRC, HTR, HSR and CSG.

None of the decomposed relations violate BCNF. This can be verified by projecting the given set of FDs onto each of the decomposed relations. All of the projections of FDs have superkeys on their left sides.

Exercise 3.5.3

The usual procedure to find the keys would be to take the closure of all 63 nonempty subsets. However, if we notice that none of the right sides of the FDs contains

attributes I and S. Thus we know that attributes I and S must be part of any key. We eventually will find out that IS is the only key for the Stocks relation.

The first step to verify that the given FDs are their own minimal basis is to check to see if any of the FDs can be removed. However, if we remove any one of the four FDs, the remaining three FDs do not imply the removed FD.

The second step to verify that the given FDs are their own minimal basis is to check to see if any of the left sides of an FD can have one or more attributes removed without losing the dependencies. However, this is not the case for the one FD that contains two attributes on the left side.

Thus, the given set of FDs has been verified to be the minimal basis.

Since the only key is IS, the given set of FDs has some dependencies that violate 3NF. We also know that the given set of FDs is a minimal basis. Thus the decomposed relations are SD, IB, ISQ and BO. Since the relation ISQ contains a key, we do not need to add an additional relation. The final set of decomposed relations is SD, IB, ISQ and BO.

Exercise 3.5.4

This is the initial tableau:

This is the final tableau after applying FDs AB→C, C→B and A→D.

Since there is an unsubscripted row, the decomposition for R is lossless for this set of FDs.

Exercise 3.5.5

Suppose that our relation relates to the work environment and has three attributes, Name, RoomNumber and ComputerID. Suppose also that only the following FDs hold:

Name→RoomNumber

ComputerID→RoomNumber

The first FD says that a person can only be in one office at a time. The second FD says that each computer can only be associated with one office at a time (i.e. the computer is fixed to each room). None of the left sides of the FDs are keys and the respective right side attributes do not belong to any key. Using algorithm 3.20 to decompose, we take the violating FD Name→RoomNumber and use it to decompose the initial relation into two smaller relations:

R1(Name,RoomNumber)

R2(Name,ComputerID)

We do not need to further decompose the two relations so we are done. However, we have lost the FD ComputerID→RoomNumber with this decomposition. Suppose that ‘John Doe’

works in room number ‘1’. Suppose also that computer ID ‘A’ is located in room ‘1’. The original relation would contain the tuple:

{‘John Doe’, 1, ‘A’}

If we follow the decomposition, we would expect the tuple above to be broken into two smaller tuples:

{‘John Doe’, 1}

{‘John Doe’, ‘A’}

Suppose that ‘John Doe’ moves to room 2 and ‘Jane Doe’ moves into room 1 and that

‘Jane Doe’ is using computer ID ‘A’. The following tuples would be in the respective relations:

{‘John Doe’, 2}

{‘Jane Doe’, 1}

{‘John Doe’, ‘A’}

{‘Jane Doe’, ‘A’}

If we were to join back the two relations, we would get:

{‘John Doe’, 2, ‘A’}

{‘Jane Doe’, 1, ‘A’}

which violates the FD ComputerID→RoomNumber

Exercise 3.6.1

Since A B, and all the tuples have the same value for attribute A, we can pair the B-value from any tuple with the value of the remaining attribute C from any other tuple. Thus, we know that R must have at least the nine tuples of the form (a,b,c), where b is any of b1, b2, or b3, and c is any of c1, c2, or c3. That is, we can derive, using the definition of a multivalued dependency, that each of the tuples (a,b1,c2), (a,b1,c3),

(a,b2,c1), (a,b2,c3), (a,b3,c1), and (a,b3,c2) are also in R.

Exercise 3.6.2a

First, people have unique Social Security numbers and unique birthdates. Thus, we expect the functional dependencies ssNo→name and ssNo→birthdate hold. The same applies to children, so we expect childSSNo→childname and childSSNo→childBirthdate. Finally, an automobile has a unique brand, so we expect autoSerialNo→autoMake.

There are two multivalued dependencies that do not follow from these functional dependencies. First, the information about one child of a person is independent of other information about that person. That is, if a person with social security number s has a tuple with cn,cs,cb, then if there is any other tuple t for the same person, there will

also be another tuple that agrees with t except that it has cn,cs,cb in its components for the child name, child Social Security number, and child birthdate. That is the multivalued dependency

ssNochildSSNo→→childName childBirthdate

Similarly, an automobile serial number and make are independent of any of the other attributes, so we expect the multivalued dependency

ssNo→→autoSerialNo autoMake

The dependencies are summarized below:

ssNo → name, birthdate

childSSNo → childName, childBirthdate

autoSerialNo → autoMake

ssNo →→ childSSNo, childName, childBirthdate

ssNo →→ autoSerialNo, autoMake

Exercise 3.6.2b

We suggest the relation schemas:

{ssNo, name, birthdate}

{ssNo, childSSNo}

{childSSNo, childName childBirthdate}

{ssNo, autoSerialNo}

{autoSerialNo, autoMake}

An initial decomposition based on the two multivalued dependencies would give us:

{ssNo, name, birthDate}

{ssNo, childSSNo, childName, childBirthdate}

{ssNo, autoSerialNo, autoMake}

Functional dependencies force us to decompose the second and third of these.

Exercise 3.6.3a

Since there are no functional dependencies, the only key is all four attributes, ABCD. Thus, each of the nontrvial multivalued dependencies A→→B and A→→C violate 4NF.

We must separate out the attributes of these dependencies, first decomposing into AB and ACD, and then decomposing the latter into AC and AD because A→→C is still a 4NF violation for ACD. The final set of relations is AB, AC, and AD.

Exercise 3.6.3b

数据库系统教程(何玉洁 李宝安 编著)第2章习题答案

第2章数据模型与数据库结构习题答案

1.解释数据模型的概念,为什么要将数据模型分成两个层次? 数据模型(Data Model)是对现实世界数据特征的抽象。 根据模型应用的不同目的,分为两大类。 2.概念层数据模型和组织层数据模型分别是面对什么的数据模型? 概念层数据模型面对现实世界,组织层数据模型面对信息世界。 3.实体之间的联系有哪几种,请为每一种联系举出一个例子。 一对一联系(1:1),例:部门和经理 一对多联系(1:m),例:公司和员工 多对多联系(m:m),例:学生和课程 4.说明实体-联系模型中的实体、属性和联系的概念。 实体是具有公共性质并可相互区分的现实世界对象的集合。 属性是描述实体或联系的性质或特征的数据项。 联系是数据间的关联关系,是客观存在的应用语义链。 5.指明下列实体间联系的种类: 教研室和教师(假设一个教师只属于一个教研室,一个教研室可有多名教师)1:m 商店和顾客m:m 国家和首都1:1 飞机(座位)和乘客1:m 6.数据库包含哪三级模式,试分别说明每一级模式的作用。 内模式描述数据的存储结构。 外模式对现实系统中用户感兴趣的整体数据的局部描述,以满足数据库不同用户对数据的需求。 模式描述数据库中全体数据的逻辑结构和特征,是所有用户的公共数据视图。

7.数据库管理系统提供的两级映像的作用是什么,它带来了哪些功能? 作用:在数据库内部实现对数据库三级模式的联系和转换。 功能:保证了数据库中的数据能够具有较高的逻辑独立性和物理独立性,使数据库应用程序不随数据库数据的逻辑或存储结构的变动而变动。 8.数据库三级模式划分的优点是什么,它能带来哪些数据独立性? 数据库三级模式是对数据的三个抽象级别,它把数据的具体组织留给DBMS管理,使用户能逻辑、抽象地处理数据,而不必关心数据在计算机中的具体表示方式与存储方式。 外模式/模式映像保证了程序与数据的逻辑独立性,模式/内模式映像保证了数据与程序的物理独立性。 *以上内容仅供参考

数据库系统基础教程(第二版)课后习题答案

Database Systems: The Complete Book Solutions for Chapter 2 Solutions for Section 2.1 Exercise 2.1.1 The E/R Diagram. Exercise 2.1.8(a) The E/R Diagram Kobvxybz Solutions for Section 2.2 Exercise 2.2.1 The Addresses entity set is nothing but a single address, so we would prefer to make address an attribute of Customers. Were the bank to record several addresses for a customer, then it might make sense to have an Addresses entity set and make Lives-at a many-many relationship. The Acct-Sets entity set is useless. Each customer has a unique account set containing his or her accounts. However, relating customers directly to their accounts in a many-many relationship conveys the same information and eliminates the account-set concept altogether. Solutions for Section 2.3 Exercise 2.3.1(a) Keys ssNo and number are appropriate for Customers and Accounts, respectively. Also, we think it does not make sense for an account to be related to zero customers, so we should round the edge connecting Owns to Customers. It does not seem inappropriate to have a customer with 0 accounts;

VF基础教程

菜鸟学习VFP 前言 大学的暑假是珍贵的,像我这样暑假呆在家里面,整天无所事事的同学不在少数,为了应付枯燥乏味的暑假,我决定在暑假学习一些知识,挑来挑去还是觉得选VFP比较有意义,因为这门科需要过二级,相信许多看到这篇文章的朋友也要过二级,那么我们大家就从今天开始共同学习吧。 所以从今天起,我的网上VFP学习课程便开张了,希望我能写完。说起为什么会开这个专题,我相信很多读者都有疑问,学习就学习是了,干嘛还将自己的学习成果放到网上来?我在这里要澄清一下,之所以我会选择这样做,是因为我觉得一个人在家里面学习太没有那种气氛了,我希望能够放到网上来,大家看着想着,遇到问题大家可以在一起讨论,在一起互相提意见,还有就是希望能够帮到有心学习VFP,但是却觉得枯燥乏味而放弃的朋友。在更新期间,我将在我的QQ空间(https://www.doczj.com/doc/fc14731319.html,/591841742/infocenter?ptlang=2052天下人犯是一家),上更新。欢迎大家转载,转载请注明出处,也希望大家能够在我的博客上踊跃发言。 首先要说明的是本文仅针对上机考试编写,让你能够在计算机上完成初级的数据库程序开发。关于理论的请多阅读教材。另外是针对VFP的初学者,也就是菜鸟级人物来学习,为了应付随之而来的省和国家二级VFP考试的同学使用,如果是VFP数据库专业人员来这里的话,希望多提提意见,不要见笑,错误之处,还请指正,就此拜谢!呵呵。 VFP是microsoft公司开发的一款数据库管理系统(DBMS),全称是Visual FoxPro。作为二级考试科目的是采用关系数据库系统Visual FoxPro 6.0 (为了区分版本,在以后的文章中简称为VF6),VF6是小型数据库管理系统的杰作,它以强大的性能,完整而又丰富的工具,较高的处理速度,友好的界面以及较完备的兼容性等特点,备受广大用户的欢迎。(注:该段内容来自国家二级考试VFP课本前言——高等教育出版社出版) 好了,套话到此结束,本来上面的那一段话不想写的,然后又觉得至少把出处点明,在吹吹牛,说VFP多好多好,毕竟人家公司开发这系统也不容易。由于VF6毕竟作为一门课程来学习,枯燥乏味在所难免,但在这里,我尽量用友好,和谐,幽默的语言来面对大家,希望给赏光的读者带来一个愉快又充实的暑假。 第一次写前言,写的不好,大家请多多海涵,不要留言骂我

mysql数据库系统及应用综合练习附答案

《MySQL数据库系统及应用》综合练习__1附答案 一、单项选择题(只有一个正确答案) 【1】执行语句"SELECT '2008-01-20'+ INTERV AL 2 DAY; "结果为()。A: 2010-01-20 B: 2008-01-22 C: 2008-02-11 D: 2008-03-20 答案: B 【2】下列是不正确的MySQL的变量命名方式的是()。 A: @name! B: @name C: @_name D: @n$ame 答案: A 【3】字符串'hel'lo'输出结果为()。 A: hel\'lo B: 'hello' C: hel'lo D: 'hel lo' 答案: C 【4】关系数据库模型是以()方式组织数据结构。 A: 文本 B: 网状 C: 树状 D: 二维表 答案: D 【5】使用下列语句中的()可以删除表中所有数据,但保留表结构。A: rename table B: delete C: drop table D: turn cate table 答案: D 【6】E-R图设计属于()。 A: 需求分析设计 B: 物理结构设计

C: 逻辑结构设计 D: 概念结构设计 答案: D 【7】执行语句"GREATEST(10,9,128,1)"结果为()。 A: 128 B: 1 C: 10 D: 9 答案: A 【8】在一个关系中,若有这样一个属性存在,它的值能唯一地标识关系中的每一个元组,则称这个属性为()。 A: 候选码 B: 主键 C: 主键值 D: 数据项 答案: B 【9】数据库管理系统能实现对数据库中数据的查询、插入、修改和删除等操作。这种功能称为()。 A: 数据控制功能 B: 数据管理功能 C: 数据操纵功能 D: 数据定义功能 答案: C 【10】1999年10月1日在mysql中表示方法错误的是()。 A: "1999/10/01" B: "1999%10%01" C: "1999\10\01" D: "1999-10-01" 答案: A 【11】两个表中的行按照给定的条件进行拼接而形成新表的运算为()。 A: 连接 B: 集合 C: 选择 D: 投影 答案: A 【12】向表中插入一个新行的纪录的命令为()。 A: insert from B: insert into C: replace from D: replace into 答案: B 【13】\n在MySQL中表示()。 A: 退格符 B: 换行符

数据库系统教程试卷-A

《数据库系统教程》试卷(A卷,2005.1) 一、单项选择题(本大题共15小题,共25分。 1.DBS具有较高的数据独立性,是因为DBS采用了 [ B ] A.嵌入式语言B.三级模式结构C.DD D.六个层次的存储介质 2.在层次、网状模型中,起导航数据作用的是[ A ] A.指针B.关键码C.DD D.索引 3.设关系R(A,B,C)和关系S(B,C,D), 那么与R?S等价的关系代数表达式是 2=1 [ B ] A.σ2=4(R?S)B.σ2=4(R×S)C.σ2=1(R?S) D.σ2=1(R×S)4.设关系R和S的结构相同,分别有m和n个元组,那么R-S操作的结果中元组个数为 [ C ] A.为m-n B.为m C.小于等于m D.小于等于(m-n)5.元组比较操作(a1,a2)>=(b1,b2)的意义是 [ D ] A.(a1>=b1)AND(a2>=b2)B.(a1>=b1)OR((a1=b1)AND(a2>=b2)) C.(a1>b1)AND((a1=b1)AND(a2>=b2))D.(a1>b1)OR((a1=b1)AND(a2>=b2))

6.设有关系R(A,B,C)的值如下: A B C 5 6 5 6 7 5 6 8 6 下列叙述正确的是[ B ] A.函数依赖C→A在上述关系中成立B.函数依赖AB→C在上述关系中成立 C.函数依赖A→C在上述关系中成立D.函数依赖C→AB在上述关系中成立 7.设关系模式R(A,B,C,D),F是R上成立的FD集,F={ A→C,BC→D },那么ρ={ ABD,AC }相对于F [ B ] A.是无损联接分解,也是保持FD的分解 B.是无损联接分解,但不保持FD的分解 C.不是无损联接分解,但保持FD的分解 D.既不是无损联接分解,也不保持FD的分解 8.概念设计的结果得到的是概念模式。概念模式是[ D ] A.与DBMS有关的B.与硬件有关的 C.独立于DBMS的D.独立于DBMS和硬件的

南京理工大学《数据库系统基础教程》试题和答案

一、选择题60(选择一个最合适的答案,在答题纸上涂黑) 1.一个事务中的一组更新操作是一个整体,要么全部执行,要么全部不执行。这是事务的:A.原子性B.一致性 C.隔离性 D.持久性 2.在数据库的三级模式结构中,描述一个数据库中全体数据的全局逻辑结构和特性的是:A.外模式 B.模式 C.存储模式D.模式 3.关于联系的多重性,下面哪种说法不正确? A.一个多对多的联系中允许多对一的情形。 B.一个多对多的联系中允许一对一的情形。 C.一个多对一的联系中允许一对一的情形。 D.一个多对一的联系中允许多对多的情形。 4.考虑学校里的"学生"和"课程"之间的联系,该联系的多重性应该是: A. 一对一 B. 多对一 C. 一对多 D. 多对多 5.下面哪种约束要求一组属性在同一实体集任意两个不同实体上的取值不同。 A. 键(key)约束。 B. 单值约束。 C. 参照完整性。 D. 域(domain)约束 6.关系模型要求各元组的每个分量的值必须是原子性的。对原子性,下面哪种解释不正确:A.每个属性都没有部结构。 B.每个属性都不可再分解。 C.各属性值应属于某种基本数据类型。 D.属性值不允许为NULL。 7.对于一个关系的属性(列)集合和元组(行)集合,下面哪种说法不正确: A.改变属性的排列次序不影响该关系。 B.改变元组的排列次序不影响该关系。 C.改变元组的排列次序会改变该关系。 D.关系的模式包括其名称及其属性集合。 8.若R是实体集R1与R2间的一个多对多联系,将其转换为关系R',哪种说法不正确:A.R'属性应包括R1与R2的所有属性。 B.R'属性应包括R1与R2的键属性。 C.R1与R2的键属性共同构成R'的键。 D.R'的属性应包括R自身定义的属性。 9.关于函数依赖的判断,下面哪种说法不正确? A.若任意两元组在属性A上一致,在B上也一致,则有A → B成立。 B.若任意两元组在属性A上一致,在B上不一致,则A → B不成立。 C.若任意两元组在属性A上不可能一致,则不管在B上是否一致,有A → B成立。

软考数据库系统工程师考试复习资料

目录 第一章计算机系统知识 (2) 第二章数据结构与算法 (9) 第三章操作系统知识 (12) 第四章程序设计基础 (17) 第六章多媒体基础知识 (21) 第七章数据库技术基础 (24) 第八章关系数据库 (31) 第九章SQL语言 (35) 第十章系统开发与运行 (41) 第十一章数据库设计 (45) 第十二章网络与数据库 (52) 第十四章知识产权基础知识 (55) 第十五章标准化基础知识 (56)

第一章计算机系统知识 1. 计算机软件=程序+数据+相关文档。 2. 操作数包含在指令中是立即寻址,操作数的地址包含在指令中是直接寻址。 3. 计算机硬件的典型结构:单总线结构、双总线结构、采用通道的大型系统结构。 4. CPU由运算器和控制器组成;控制器由程序计数器(PC)、指令寄存器(IR)、指令译码器(ID)、状态条件寄存器、时序产生器和微操作信号发生器组成。 a) PC: pc自动增加一个值,指向下一条要执行的指令,当程序转移时将转移地址送入PC。 b) IR:用于存放当前要执行的指令。 c) ID:对现行的指令进行分析,确定指令类型、指令要完成的操作和寻址方式。 5. 指令执行的过程: a) 取指令:控制器首先按程序计数器所指出的指令地址从内存中取出一条指令。 b) 指令译码:将指令的操作码部分送入指令译码器中进行分析,然后根据指令的功能发出控制命令。 c) 按指令操作码执行。 d) 形成下一条指令地址。

6. CPU的基本功能: a) 程序控制 b) 操作控制 c) 时间控制 d) 数据处理——CPU的根本任务 7. 计算机体系结构和计算机组成的区别:体系结构要解决的问题是计算机系统在总体上、功能上需要解决的问题,而计算机组成要解决的是逻辑上如何具体实现的问题。 8. 计算机体系结构分类(指令流、数据流、多倍性): a) Flynn分类:传统的顺序执行的计算机在同一时刻只能执行一条指令(即只有一个控制流)、处理一个数据(即只有一个数据流),因此被称为单指令流单数据流计算机Single Instruction Single Data即SISD 计算机)。而对于大多数并行计算机而言,多个处理单元都是根据不同的控制流程执行不同的操作,处理不同的数据,因此,它们被称作是多指令流多数据流计算机,即MIMD(Multiple Instruction Multiple Data)计算机。曾经在很长一段时间内成为超级并行计算机主流的向量计算机除了标量处理单元之外,最重要的是具有能进行向量计算的硬件单元。在执行向量操作时,一条指令可以同时对多个数据(组成一个向量)进行运算,这就是单指令流多数据流(Single Instruction Multiple Data,SIMD)的概念。因此,我们将向量计算机称为SIMD 计算机。第四种类型即所谓的多指令流单数据(MultipleInstructionSingleData)计算机。在这种计算机中,各个处理

vf数据库基础知识习题与答案

第一章VF基础知识 一、选择题 1. 在一个二维表中,行称为________,列称为________。 A) 属性;元组B) 元组;属性 C) 关系;元组D) 属性;关系 2. 数据库系统的核心是________。 A) 数据库管理系统B) 数据库 C) 数据D) 数据库应用系统 3. VFP是一种________数据库管理系统。 A) 层次型B) 网状型 C) 关系型D) 树型 4. 支持数据库各种操作的软件系统是________。 A) 数据库系统B) 操作系统 C) 数据库管理系统D) 命令系统 5. 在关系模型中,从表中选出满足条件的记录的操作称为________。 A) 连接B) 投影 C) 联系D) 选择 6. 数据库系统与文件系统的主要区别是________。 A) 文件系统只能管理程序文件,而数据库系统可以管理各种类型的文件 B) 文件系统管理的数据较少,而数据库系统能管理大量数据 C) 文件系统比较简单,数据库系统比较复杂 D) 文件系统没有解决数据冗余和数据独立性问题,而数据库系统解决了这些问题 7. 在关系运算中,选择的操作对象是________;投影的操作对象是_______ _;连接的操作对象是________。 A) 一个表;一个表;两个表 B) 一个表;两个表;两个表 C) 一个表;一个表;一个表 D) 两个表;一个表;两个表 8. 在关系数据库中,基本的关系运算有三种,它们是________。 A) 选择、投影和统计B) 选择、投影和连接 C) 排序、索引和选择D) 统计、查找和连接 9. VFP是一种关系型数据库管理系统,所谓关系是指________。 A) 表中各个记录之间的联系 B) 数据模型满足一定条件的二维表格式 C) 表中各个字段之间的联系 D) 一个表与另一个表之间的联系 10. 一个仓库里可以存放多个部件,一种部件可以存放于多个仓库,仓库与部件之间是________的联系。 A) 一对一B) 多对一 C) 一对多D) 多对多 11. 自然连接要求被连接的两关系有若干相同的________。 A) 实体名B) 属性名

大工18春《SQL数据库系统及应用》在线作业2

------------------------------------------------------------------------------------------------------------------------------ (单选题) 1: 如果想查询订单表中订购金额大于等于800的所有信息,下面()语句能够完成此任务。 A: select * FROM 订单表 WHERE 订购金额<800 B: select * FROM 订单表 WHERE 订购金额>800 C: select * FROM 订单表 WHERE 订购金额<=800 D: select * FROM 订单表 WHERE 订购金额>=800 正确答案: (单选题) 2: 如果想查询订单表中前5条信息,下面()语句能够完成此任务。 A: select top 5 * FROM 订单表 B: select up 5 * FROM 订单表 C: select up_down 5 * FROM 订单表 D: select top_down 5 * FROM 订单表 正确答案: (单选题) 3: Select emp_id,emp_name,sex,title,wage from Yuangong order by emp_name 句子得到的结果集是按( )排序。 A: emp_id B: emp_name C: sex D: wage 正确答案: (单选题) 4: 如果要查询学校员工的平均收入,则使用以下()聚合函数。 A: sum() B: ABS() C: count() D: avg() 正确答案: (单选题) 5: 如果要查询学校员工的总收入,可以使用以下()聚合函数。 A: sum() B: ABS() C: count() D: MAX() 正确答案: (单选题) 6: Select count(*) from student 语句得到的结果是()。 A: 某个记录的详细信息 B: 全部记录的详细信息 C: 所有记录的条数 D: 得到16条记录 正确答案: (单选题) 7: SQL语句中,查询中分组的关键词是()。 A: ORDER BY B: LIKE C: CREATE D: GROUP BY

软考数据库系统工程师试题及答案

软考数据库系统工程师 试题及答案 TYYGROUP system office room 【TYYUA16H-TYY-TYYYUA8Q8-

2012年软考数据库系统工程师试题及答案 1.单个用户使用的数据视图的描述称为( ) A.外模式 B.概念模式 C.内模式 D.存储模式 2.子模式ddl 用来描述( ) A.数据库的总体逻辑结构 B.数据库的局部逻辑结构 C.数据库的物理存储结构 D.数据库的概念结构 3.在dbs中,dbms和os之间的关系是( ) A.相互调用 调用os 调用dbms D.并发运行 4.数据库物理存储方式的描述称为( ) A.外模式 B.内模式 C.概念模式 D.逻辑模式 5.在下面给出的内容中,不属于dba职责的是( ) A.定义概念模式 B.修改模式结构

C.编写应用程序 D.编写完整性规则 6.在数据库三级模式间引入二级映象的主要作用是( ) A.提高数据与程序的独立性 B.提高数据与程序的安全性 C.保持数据与程序的一致性 D.提高数据与程序的可移植性 、dbms 和dbs 三者之间的关系是( ) 包括dbms和dbs 包括db和dbms 包括db和dbs D.不能相互包括 中“第三级存储器”是指( ) A.磁盘和磁带 B.磁带和光盘 C.光盘和磁盘 D.快闪存和磁盘 9.位于用户和操作系统之间的一层数据管理软件是( ) 10.数据库系统中的数据模型通常由( )三部分组成 A.数据结构、数据操作和完整性约束 B.数据定义、数据操作和安全性约束

C.数据结构、数据管理和数据保护 D.数据定义、数据管理和运行控制 组织提出的dbtg 报告中的数据模型是( )的主要代表 A.层次模型 B.网状模型 C.关系模型 D.实体联系模型 12.数据库技术的三级模式中,数据的全局逻辑结构用( )来描述 A.子模式 B.用户模式 C.模式 D.存储模式 13.用户涉及的逻辑结构用( )描述 A.模式 B.存储模式 C.概念模式 D.子模式 14.数据库的开发控制,完整性检查,安全性检查等是对数据库的( ) A.设计 B.保护 C.操纵 D.维护 15.( )是控制数据整体结构的人,负责三级结构定义和修改 A .专业用户 B .应用程序员

大工20秋《SQL数据库系统及应用》在线作业1

大工20秋《SQL数据库系统及应用》在线作业1 1:删除表sst的命令( )。 A、DROP_FOR sst B、DELETES TABLE sst C、DROP TABLE sst D、DELETES sst 答案:C 2:在SQL语句中,修改表结构的命令是( )。 A、MODIFY_FOR TABLE B、MODIFY_FOR STRUCTURE C、ALTER TABLE D、ALTER STRUCTURE 答案:C 3:SQL语句中建立表的命令是( )。 A、DROP SCHEMA B、CREATE TABLE C、CREATE VIEW D、DROP INDEX 答案:B 4:在select语句查询时,使用WHERE子句指出的是( )。 A、创建删除条件 B、排序结果

C、查询条件 D、查询视图 答案:C 5:若想查询出所有姓王的且民族为汉族的学生信息,则WHERE条件应为( )。 A、name like '王%'and Minzu='汉族' B、name like '王%'and Minzu!='汉族' C、name like '王%'and Minzu ISS '汉族' D、name like '王_'and Minzu IS '汉族' 答案:A 6:以下说法中正确的是( )。 A、student_3是不合法的变量名 B、SQL中用户变量也称为全局变量 C、a2是不合法的变量名 D、可以使用语句来为变量赋值 答案:D 7:下面聚合函数中正确的是( )。 A、SUM (*) B、COUNT (*) C、MAX (*) D、AVG (*) 答案:B 8:以下聚合函数中用于返回最大值的是( )。 A、VARP

数据库系统基础教程(第二版)课后习题答案2

Database Systems: The Complete Book Solutions for Chapter 2 Solutions for Section 2.1 Exercise 2.1.1 The E/R Diagram. Exercise 2.1.8(a) The E/R Diagram Kobvxybz Solutions for Section 2.2 Exercise 2.2.1 The Addresses entity set is nothing but a single address, so we would prefer to make address an attribute of Customers. Were the bank to record several addresses for a customer, then it might make sense to have an Addresses entity set and make Lives-at a many-many relationship. The Acct-Sets entity set is useless. Each customer has a unique account set containing his or her accounts. However, relating customers directly to their accounts in a many-many relationship conveys the same information and eliminates the account-set concept altogether. Solutions for Section 2.3 Exercise 2.3.1(a) Keys ssNo and number are appropriate for Customers and Accounts, respectively. Also, we think it does not make sense for an account to be related to zero customers, so we should round the edge connecting Owns to Customers. It does not seem inappropriate to have a customer with 0 accounts;

数据库系统工程师

[编辑本段] 考试简介以及报考资格 数据库系统工程师考试属于全国计算机技术与软件专业技术资格考试(简称计算机软件资格考试)中的一个中级考试。考试不设学历与资历条件,也不论年龄和专业,考生可根据自己的技术水平选择合适的级别合适的资格,但一次考试只能报考一种资格。考试采用笔试形式,考试实行全国统一大纲、统一试题、统一时间、统一标准、统一证书的考试办法。笔试安排在一天之内。 [编辑本段] 报名流程 根据《计算机技术与软件专业技术资格(水平)考试实施办法》第八条相关规定:符合《暂行规定》(即《计算机技术与软件专业技术资格(水平)考试暂行规定》)第八条规定的人员,由本人提出申请,按规定携带身份证明到当地考试管理机构报名,领取准考证。凭准考证、身份证明在指定的时间、地点参加考试。 各地的报名办法由考生报考所在地的当地考试机构决定。考生相关报考费用标准由当地物价部门核准。 考生报名方式主要分为:网上报名与考生本人到指定地点报名两种。 注:报名时依据的身份证明包括:居民身份证、军人的证件、护照、户口本等。 [编辑本段] 科目内容 考试科目1:信息系统知识 1. 计算机系统知识 1.1 硬件知识 1.1.1 计算机体系结构和主要部件的基本工作原理 ·CPU和存储器的组成、性能、基本工作原理 ·常用I/O设备、通信设备的性能,以及基本工作原理 ·I/O接口的功能、类型和特点 ·CISC/RISC,流水线操作,多处理机,并行处理 1.1.2 存储系统 ·虚拟存储器基本工作原理,多级存储体系 ·RAID类型和特性

1.1.3 安全性、可靠性与系统性能评测基础知识 ·诊断与容错 ·系统可靠性分析评价 ·计算机系统性能评测方法 1.2 数据结构与算法 1.2.1 常用数据结构 ·数组(静态数组、动态数组) ·线性表、链表(单向链表、双向链表、循环链表) ·栈和队列 ·树(二叉树、查找树、平衡树、遍历树、堆)、图、集合的定义、存储和操作 ·Hash(存储位置计算、碰撞处理) 1.2.2 常用算法 ·排序算法、查找算法、数值计算、字符串处理、数据压缩算法、递归算法、图的相关算法 ·算法与数据结构的关系,算法效率,算法设计,算法描述(流程图、伪代码、决策表),算法的复杂性 1.3 软件知识 1.3.1 操作系统知识 ·操作系统的类型、特征、地位、内核(中断控制)、进程、线程概念 ·处理机管理(状态转换、同步与互斥、信号灯、分时轮转、抢占、死锁) ·存储管理(主存保护、动态连接分配、分段、分页、虚存) ·设备管理(I/O控制、假脱机、磁盘调度) ·文件管理(文件目录、文件的结构和组织、存取方法、存取控制、恢复处理、共享和安全) ·作业管理(作业调度、作业控制语言(JCL)、多道程序设计) ·汉字处理,多媒体处理,人机界面 ·网络操作系统和嵌入式操作系统基础知识 ·操作系统的配置 1.3.2 程序设计语言和语言处理程序的知识 ·汇编、编译、解释系统的基础知识和基本工作原理 ·程序设计语言的基本成分:数据、运算、控制和传输,程序调用的实现机制 ·各类程序设计语言的主要特点和适用情况 1.4 计算机网络知识 ·网络体系结构(网络拓扑、OSI/RM、基本的网络协议) ·传输介质,传输技术,传输方法,传输控制 ·常用网络设备和各类通信设备

第一章VF数据库基础教案

第一章 VF数据库基础 一、什么叫数据: 是指存储在某种媒体上的能够识别的物理符号如:数字、字母、文字、特殊字符组成的文本形式数据,还有图形、动画、影像、声音等多媒体数据,而最多、最常用的是文字数据。 注:数据包括:描述事物特性的内容和存储在媒体上的数据形式。 二、什么叫数据处理? 是指将数据转换成信息的过程。 三、数据处理的目的(其中核心问题是数据管理) 计算机对数据的管理发展阶段及特点:经历了五个阶段: 1、人工管理阶段:20世纪50年代;数据和程序不具有独立性,无法进行长期保存,数据不能共享,数据冗余大。 2、文件管理阶段:20世纪50年代后期至60年代中后期,程序和数据有一定的独立性,程序和数据分开存储。 3、数据库系统管理;从20世纪60年代后期开始:特点:数据和程序具有较高的独立性,实现了数据共享,减少数据冗余(注:但并不是完全避免数据冗余) 4、分布式数据库系统:20世纪70年代后期,是数据库技术和计算机网络技术紧密结合的产物。 5、面向对象数据库系统:20世纪80年代引入计算机科学领域的一种新的程序设计技术模型 特点:就是按照人们认识世界和改造世界的习惯方法对现实世界的客观事物对象进行最自然的最有效的抽象和表达,同时又以各种严格高效的行为规范和机制实施客观事物的有效模拟和处理。 注:在数据管理技术的发展过程中:数据库系统可以实现数据共享。 一、数据库系统: 1、数据库(DB):是存储在计算机设备上结构化的相关数据的集合,它不仅包括描述事物数据本身,而且还包括相关事物之间的联系。可以被多个和户、多个应用程序共享 2、数据库应用系统(DBAS):是指系统开发人员利数据库系统资源开发出来的。 3、数据库管理系统(DBMS):是对数据库的建立,使用和维护进行管理。 4、数据库系统(DBS):是指引进数据库技术后的计算机系统,实现有组织地、动态地存储大量相关数据提供数据处理和信息资源共享的便利条件。 注:visual Foxpro中的数据库管理系统(DBMS)是操作系统支持下的系统软件; 数据库DB、数据库系统DBS、数据库管理系统DBMS三者之间的关系是:DBS包括DB和DBMS。

数据库系统及应用复习

ZH计0418班数据库系统及应用复习 一、填空题 1、SQL具有数据定义、查询、操纵和控制等四种主要功能。 2、一个关系模型由若干个关系模式所组成。 3、若实体A和B是1对多的联系,实体B和C是多对1的联系,则实体A和C是多对_多_联系。 4、按照两关系中对应属性值相等的条件所进行的联接称为等值联接。 5、关系规范化就是使一个关系模式描述一个实体,或实体间的一种联系。 6、假定一个E-R图包含有A实体和B实体,并且从A到B存在着1:n 的联系,则转换成关系模型后,包含有 2 个关系模式。 7、SQL语言集数据查询、数据操纵、数据定义和数据控制功能于一体,充分体现了关系数据语言的特点和优点。 8、一个关系就是一张二维表,每个关系有一个关系名,每个关系在计算机中作为一个文件存储起来。 9、人们已经提出了许多种类型的数据依赖,其中最重要的是函数依赖和多值依赖。 10、任一种数据模型都有_型__和_值区别;层次模型是一棵_树__结构,关系模型是一个__二维表格 _结构。 11、在对象数据模型中,每个对象不仅要包含描述实体的__状态 ___特征,而且要包含描述实体的__行为_ _特征。 12、设一个关系为R(A,B,C,D,E),它的最小函数依赖集为FD={A→B,A→C,(C,D)→E},该关系只满足第一范式,若要规范化为第三范式,则将得到 3 个关系。 13、数据库管理系统提供了数据库的定义、操纵、查寻、控制和通信功能。 14、E-R模型是描述概念世界、建立概念模型的实用工具。 15、数据库系统的主要特点是实现数据共享、减少数据冗余、采用特定的数据模型、具有较高的数据独立性、具有统一的数据控制功能。 16、选择运算的结果关系同原关系具有相同的结构框架,投影运算的结果关系同原关系通常具有不同的结构框架。 17、在SQL所支持的数据库系统的三级模式结构中,视图属于外模式,基本表属于全局概念模式。 18、设X—Y是关系模式R的一个函数依赖,并且Y是X的子集,则称X→Y是平凡函数依赖。 19、数据库系统的核心是数据库管理系统或DBMS。 20、实体之间的联系按照联系方式的不同可分为1∶1、1∶n和m∶n。 21、假定利用CREATE TABLE命令建立如下一个基本表:BOOK(总编号C(6),分类号C(8),书名C(16),单价N(10,2)),则单价字段的类型为数值型,字段宽度为 10 ,其中包含有 2 位小数。 22、在关系模型中,实体以及实体间的联系都是用关系来表示的。 23、关系模式由3NF转化为BCNF是消除了主属性对码的部分函数依赖和传递函数依赖。 24、专门的关系运算包括选择、投影、连接和除四种。 25、在数据库系统中,DBMS是指数据库管理系统。 26、传统的三大数据模型分别是层次模型、网状模型和关系模型。 27、在关系运算的四种专门关系运算符中,它们分别是选择、摄影、连接和除运算。 28、SQL的含义是结构化查询语句。29、SQL的四大功能分别是查询、定义、操纵和控制。 30、在SQL的修改表结构命令中增加字段的关键字是ADD。 修改字段的属性的关键字是ALTER COLUMN。 31、在SQL常用的运算符号中,OR表示或,NOT表示否定,LIKE表示字符匹配。 32、在SQL的SELECT的格式中用于表示条件的关键字是WHERE。 如:SELECT*FROM A WHERE年龄>20的含义是:从A表中查询出所有年龄大于20的记录。 33、在SQL中创建视图的基本命令是:CREATE VIEW〈试图名〉AS〈SELECT查询语句〉。 34、在操作的表中,可以定义的触发器大概有三类:它们分别是更新触发器、插入触发器和删除触发器 二、选择题 1、关系演算的基础是( C )。 A、形式逻辑中的逻辑演算 B、形式逻辑中的关系演算 C、数理逻辑中的谓词演算 D、数理逻辑中的形式演算 2、若要求分解保持函数依赖,那么模式分解一定能够达到( B )。 A、2NF B、 3NF C、 BCNF D、 1NF 3、用于配置客户端网络连接的工具是(B )。 A、企业管理器 B、客户端网络实用工具 C、查询分析器 D、联机帮助文档 4、1级封锁协议加上T要读取的数据R加S锁,这是( C )。 A、3级封锁协议 B、4级封锁协议 C、2级封锁协议 D、1级封锁协议 5、在表设计视图中,如果要限定数据的输入格式,应修改字段的( D )属性。 A、字段大小 B、有效性规则 C、输入格式 D、格式 6、下列( D )是主键的标志。 A、 B、 C、 D、 7、数据库类型是按照( B )来划分的。 A、文件形式 B、数据模型 C、记录形式 D、数据存取方法 8、哪种情况应尽量创建索引(A )。 A、在Where子句中出现频率较高的列 B、具有很多NULL值的列 C、记录较少的基本表 D、需要更新频繁的基本表 9、建立数据字典的时机是( A )。 A、需求分析阶段 B、数据库物理设计阶段 C、数据库实施 D、概念结构设计阶段 10、如果要在SQL Server中存储图形图像、Word文档文件,不可采用的数据类型是( C )。 A、binary B、varbinary C、text D、image 11.数据库系统的核心是(C) A数据库B数据库系统C数据库管理系统D数据 12.实体之间的联系的基本类型有(D) A一对一B一对多C多对多D上述三种都是

数据库系统教程试卷-A

一、单项选择题(本大题共15小题,共25分。 1.DBS具有较高的数据独立性,是因为DBS采用了[ B ] A.嵌入式语言B.三级模式结构C.DD D.六个层次的存储介质 2.在层次、网状模型中,起导航数据作用的是[ A ] A.指针B.关键码C.DD D.索引 3.设关系R(A,B,C)和关系S(B,C,D), 那么与R?S等价的关系 代数表达式是[ B ] A.σ2=4(R?S)B.σ2=4(R×S)C.σ2=1(R?S)D.σ2=1(R×S) 4.设关系R和S的结构相同,分别有m和n个元组,那么R-S操作的结果中元组个数为[ C ] A.为m-n B.为m C.小于等于m D.小于等于(m-n) 5.元组比较操作(a 1,a 2 )>=(b 1 ,b 2 )的意义是[ D] A.(a 1>=b 1 )AND(a 2 >=b 2 )B.(a 1 >=b 1 )OR((a 1 =b 1 )AND(a 2 >=b 2 )) C.(a 1>b 1 )AND((a 1 =b 1 )AND(a 2 >=b 2 )) D.(a 1 >b 1 )OR((a 1 =b 1 )AND(a 2 >=b 2 )) 6.设有关系R(A,B,C)的值如下: A B C 5 6 5 6 7 5 6 8 6 下列叙述正确的是[ B ] A.函数依赖C→A在上述关系中成立B.函数依赖AB→C在上述关系中成立 C.函数依赖A→C在上述关系中成立D.函数依赖C→AB在上述关系中成立 7.设关系模式R(A,B,C,D),F是R上成立的FD集,F={ A→C,BC→D },那么ρ={ ABD,AC }相对于F [ B ] A.是无损联接分解,也是保持FD的分解 B.是无损联接分解,但不保持FD的分解 C.不是无损联接分解,但保持FD的分解 D.既不是无损联接分解,也不保持FD的分解 8.概念设计的结果得到的是概念模式。概念模式是[ D] A.与DBMS有关的B.与硬件有关的 C.独立于DBMS的D.独立于DBMS和硬件的 9.在有关“弱实体”的叙述中,不正确的是[ C ] A.弱实体的存在以父实体的存在为前提 B.弱实体依赖于父实体的存在 C.父实体与弱实体的联系可以是1:1、1:N或M:N D.父实体与弱实体的联系只能是1:1或1:N 10.有15个实体类型,并且它们之间存在着15个不同的二元联系,其中5个是1:1联系类型,5个是1:N联系类型,5个M:N联系类型,那么根据转换规则,这个ER结构转换成的关系模式有[ D ] 2=1

中级数据库系统工程师试题、答案及详细解析

试题某工厂的信息管理数据库的部分关系模式如下所示: 职工(职工号,姓名,年龄,月工资,部门号,电话,办公室) 部门(部门号,部门名,负责人代码,任职时间) 问题1]解答(a)PRIMARY KEY(b)FOREIGN KEY (负责人代码) REFERENCES职工 (c)FOREIGN KEY (部门号) REFERENCES部门(d)月工资>=500 AND<月工资=5000,或月工资BETWEEN 500 AND 5000(e)count(*),Sum (月工资),Avg (月工资)(f)GrOup by部门号 [问题2]解答 (1)该行不能插入“职工”关系,它违反了实体完整性中主码必须惟一区分关系中的每一个属性。 (2)该行可以插入“职工”关系,尽管部门号、电话和办公室为空,但是它表示该雇员没有分配到某个部门。(3)该行不能插入“职32'’关系,它违反了参照完整性。因为6在关系“部门”中不存在。 [问题3]解答(1)和(2)都不能更新,因为使用分组合聚集函数定义的视图是不可更新的。(3)不一定,视子查询的返回值而定,(4)和(5)允许查询。 [问题4]解答(1)对于外层的职工关系E中的每一个元组,都要对内层的整个职工关系M进行检索,因此查询效率不高。(2)Select 职工号from 职工,(Select Max (月工资) as 最高工资,部门号Group by 部门号)as depMax where 月工资=最高工资and 职工.部门号=depMax.部门号 [问题5]解答Select 姓名,年龄,月工资from 职工where 年龄>45; Union Select 姓名,年龄,月工资from 职工where 年龄月工资<1000; 试题某仓储超市采用POS(Point of Sale)收银机负责前台的销售收款,为及时掌握销售信息,并依此指导进货,拟建立商品进、销、存数据库管理系统。该系统的需求分析已经基本完成,下面将进入概念模型的设计。 试题解答 [问题1]解答 [问题2]解答商品(商品编号,商品名称,供应商,单价)直销商品(商品编号,生产批号,消费期限) 库存商品(商品编号,折扣率) [问题3]解答 销售详单(销售流水号,商品编码,数量,金额,收银员,时间) 销售日汇总(日期,商品编码,数量) 存货表(商品编码,数量) 进货表(送货号码,商品编码,数量,日期) 商品(商品编号,商品名称,供应商,单价) 直销商品(商品编号,生产批号,消费期限) 库存商品(直显组号,折扣率) [问题4]解答 1.采用商品信息集中存储在中心数据库中,则在销售前台的每笔计费中,都必须从中心数据库提取商品名称和单价,增加网络的负载,在业务繁忙时直接影响到前台的销售效率;同时,如果发生网络故障,则该POS机不能工作。采用这种方式,对商品库的更新,如引入新的商品和修改商品价格,会及时体现在前台的销售业务中。2.采用商品信息存储在中心数据库中,各POS机存储商品表的备份,POS机直接从本地读取商品信息,减少了网络的负载,可以提高交易的效率;同时即使有短时间的网络故障,也不影响该POS机的正常使用,只有当存在商品信息变更时才需要与中心数据库同步。采用这种方式,必须在每次商品信息变更时同步各POS机的数据。 [问题5]解答1.对销售详单关系模式做如下的修改,增加积分卡号属性。销售详单(销售流水号,商品编

相关主题
文本预览
相关文档 最新文档