database - Functional dependency vs one-to-many (or many-to-many ) relationships -
i understand what
1) fd (functional dependency) is
--> b i.e value a1 in there corresponding unique value b1 in b.
2) , in one-to-many relationship,
value a1 in there 1 or more corresponding values i.e. b1 or b1, b2, b3 etc in b. question on one-to-may part.
q1) there other name relationship in normalization terminology. ( mvd can come in picture, can ignore while speaking 1 set of data unless rest considered null. )
q2) one-to-many relationship fd (or mvd - clarifying, otherwise ignore this) ?? might crazy ask this. there lot of relationship here between , b values of b still determined , come problem domain (which in other words ... functional world). ex -a student still determines courses want enroll. might still have freedom enroll 5 or 7 course cardinality. still student , student determines course ( , how many of them.) or in other words - one-to-many says "cardinality" relationship itself. call what? (can still called functional or thing else speaks determining rest)
a functional dependency a → b
in relation r (a, b, c, ...)
constraint satisfied instances of r
(that set of tuples of r
) in which, every time there 2 or more tuples same value of attribute a
, all of them have same value of attribute b
(note a
, b
can set of attributes) (the “valid” instances of r
).
since cannot have different values of b
value of a
, situation called “functional dependency”, , “meaning” modeling world in value uniquely determined (for instance, given ssn of person, have unique birthdate).
while in modelling situations can set of values of attributes uniquely determined (for instance, given ssn of person, have unique set of skills), there no “equivalent” constraint in normalization theory, , reason attribute of relation can have elementary value, not set of values. so, if have modeled situation relation attributes ssn , skill, need put in instance multiples rows same ssn , different skills represent skills of single person.
what can have, instead, in normalization theory, constraint, called multivalued dependency, significant when have, in same relation, at same time, multiple situations of example above. instance, if have relation employees(ssn, skill, child)
, if employee has n skills , m children, should rapresent information n x m rows employee, m rows children each skill, , simmetrically n rows skills each child. in case, can instance valid if satifies couple of mvds ssn →→ skill
, ssn →→ child
, or, equivalenty, binary join dependency employees = ssn skill ⨝ ssn child
. , equivalent relation can safely1 decomposed in 2 relations, e1(ssn, skill)
, e2(ssn, child)
.
1 i.e., without loss of information.
Comments
Post a Comment