9.2 n-ary Relations and their Applications Flashcards
n-ary Relations and its degree and its domains:
Let A1, A2, … , An be sets. An n-ary relation on these sets is a subset of A1 × A2 × ⋯ × An.
The sets A1, A2, … , An are called the domains of the relation, and n is called its degree.
a ≡ b (mod m)
Integer a is congruent to integer b modulo m > 0, if a and b give the same remainder when divided by m.
The notation a ≡ b (mod m).
( Alternative defnition: a ≡ b (mod m)
= m|(b −a). idk)
The time required to manipulate information in a database depends on?
The time required to manipulate information in a database depends on how this information is
stored.
Fields:
entries of n-tuple.
Records:
n tuples made up of fields.
Database:
It consists of records.
The relational data Model:
The relational
data model represents a database of records as an
n-ary relation.
Relation used to represent databases:
describe it, what are attributes?
Tables.
Each column corresponds to an attribute of the database.
Attribute = Column Name
Primary Key:
A domain of an n-ary relation is called a primary key when the value of the n-tuple from
this domain determines the n-tuple. That is, a domain is a primary key when no two n-tuples in
the relation have the same value from this domain.
Intension and extension:
The more permanent part of a database, including the
name and attributes of the database is called its intension.
The foll collection of n-tuples in a relation
is called the extension of the relation.
(Ackermann, 231455, Computer Science, 3.88)
(Adams, 888323, Physics, 3.45)
The property that a domain is a primary key is permanent?
Records are often added to or deleted from databases. Because of this, the property that a
domain is a primary key is time-dependent.
To make it permanent, it must serve as primary key to all possible extensions To do so, its required to analyze intentions to understand possible n tuple that can occur as extension.
Composite Key:
Combinations of domains can also uniquely identify n-tuples in an n-ary relation. When
the values of a set of domains determine an n-tuple in a relation, the Cartesian product of these
domains is called a composite key
Selection Operator:
Let R be an n-ary relation and C a condition that elements in R may satisfy. Then the selection
operator sC maps the n-ary relation R to the n-ary relation of all n-tuples from R that satisfy
the condition C.
Projections:
Projections are used to form new n-ary relations by deleting the same fields in every record
of the relation.
The projection P i1 i2,…,im where i1 < i2 < ⋯ < im, maps the n-tuple (a1, a2, … , an) to the
m-tuple (ai1, ai2, … , aim ), where m ≤ n.
In other words, the projection P i1 ,i2,…,im DELETES
n − m of the components of an n-tuple, leaving
the i1th, i2th, … , and imth components
P1,3 (a1, a2, a3, a4) = ( a1, a3)
Projections are formed by omitting certain columns, and then eliminating duplicate
rows.
Does the application of projection ever lead to fewer rows?
Fewer rows may result when a projection is applied to the table for a relation. This happens
when some of the n-tuples in the relation have identical values in each of the m components of
the projection, and only disagree in components deleted by the projection.