中文网站
  Advanced Search
Read the latest Blogs from IT professionals in the field. Read and write community created documents. Need IT help? Ask our staff. Connect with your peers. Check our Tech Shop for posters, books and software tools. Home

7.4.1 Database Systems: Multivalued Dependencies

1. Functional dependencies rule out certain tuples from appearing in a relation.

If A →B, then we cannot have two tuples with the same A value but different B values.

2. Multivalued dependencies do not rule out the existence of certain tuples.

Instead, they require that other tuples of a certain form be present in the relation.

3. Let R be a relation schema, and let α ∈ R and β ∈ R.

The multivalued dependency α→→ β

  α β R- α- β

t1

t1

a1...ai

b1...bi

ai+1...aj

bi+1...bj

aj+1...an

bj+1...bn

t3

t4

a1...ai

a1...ai

ai+1...aj

bi+1...bj

bj+1...bn

aj+1...an

Figure 7.5: Tabular representation of α→→ β.

name address car

Tom

Tom

Tom

Tom

North Rd.

Oak St.

North Rd.

Oak St.

 

Toyota

Honda

Honda

Toyota

 

Figure 7.6: (name; address; car) where name →→address and name →→car.

holds on R if in any legal relation r(R), for all pairs of tuples t1 and t2 in r such that t1[ α] = t2[ α], there exist tuples t3 and t4 in r such that:

t1[ α] = t2[ α] = t3[ α] = t4[ α]
t3[ β] = t1[ β]
t3[R- β] = t2[R- β]
t4[ β ] = t2[ β ]
t4[R- βí°€ ] = t1[R- βí°€ ]

4. Figure 7.5 (textbook 6.10) shows a tabular representation of this. It looks horrendously complicated, but is
really rather simple. A simple example is a table with the schema (name; address; car), as shown in Figure
7.6.

  • Intuitively, α→→ βsays that the relationship between and is independent of the relationship between and R.ô€€€
  • If the multivalued dependency α→→ βis satisfied by all relations on schema R, then we say it is a trivial multivalued dependency on schema R.
  • Thus α→→ βis trivial β∈α if or β∪ α= R.

5. Look at the example relation bc relation in Figure 7.7 (textbook 6.11).

  • We must repeat the loan number once for each address a customer has.
  • We must repeat the address once for each loan the customer has.
  • This repetition is pointless, as the relationship between a customer and a loan is independent of the relationship between a customer and his or her address.
loan# cname street ccity

23

23

93

Smith

Smith

Curry

North

Main

Lake

Rye

Manchester

Horseneck

Figure 7.7: Relation bc, an example of redundancy in a BCNF relation.

loan# cname street ccity

23

27

Smith

Smith

North

Main

Rye

Manchester

Figure 7.8: An illegal bc relation.

  • If a customer, say "Smith", has loan number 23, we want all of Smith's addresses to be associated with that loan.
  • Thus the relation of Figure 7.8 (textbook 6.12) is illegal.
  • If we look at our de nition of multivalued dependency, we see that we want the multivalued dependency cname →→street ccity to hold on BC-schema.

6. Note that if a relation r fails to satisfy a given multivalued dependency, we can construct a relation r0 that does satisfy the multivalued dependency by adding tuples to r.

Database System Structure: