90 likes | 476 Views
8.2 n- ary Relations and their applications. Def– n- ary. Let A1, A2, …An be sets. An n- ary relation on these sets is a subset of A1xA2xA3… xAn . The sets A1, A2, …An are called domains of the relation and n its degree. Database.
E N D
Def– n-ary Let A1, A2, …An be sets. An n-ary relation on these sets is a subset of A1xA2xA3…xAn. The sets A1, A2, …An are called domains of the relation and n its degree
Database Database: Consists of records, n-tuples, made up of fields. The fields are the entries of the n-tuple.
Example Notice the repeats. Questions: Can we identify each table by major? __By name? __ ID#- primary key (a domain that determines the n tyuple) Major- not primary Favorite dessert- not primary Major and dessert could serve as a composite key (combination that determines the n-tuple)
Projections P14 maps (a1,a2,a3,a4) to (a1,a4)
Join Join operation: Jp combines two relations R1 and R2 into a new one by combining all m-tuples of R1 with all n-tuples of R2, where the last p components of R1 agree with the first p components of R2.