Professional Documents
Culture Documents
and relation
Adatbázisrendszerek és alkalmazásaik
Relation schema
Definition
A relation schema R, denoted by R(A1, A2, ..., An), is
made up of a relation name R and a list of attributes, A1,
A2, ..., An.
Each attribute Ai is the name of a role played by some
domain D in the relation schema R. D is called the domain
of Ai and is denoted by dom(Ai), n is the degree of relation.
Adatbázisrendszerek és alkalmazásaik
Relation schema
Example
● CAR(brand, type, year_of_manufacture,
license_plate_number)
● STUDENT(name, address, speciality, year,
neptun_code)
● DEPARTMENT(id, dep_name,dep_dean,faculty)
Remark
It is possible that many attribute has the same domain. The attributes
indicates the different roles, interpretations of domain.
Adatbázisrendszerek és alkalmazásaik
Relation
Definition
A relation r of the relation schema R(A1, A2, ..., An), also
denoted by r(R), is a set of n-tuples r = {t1, t2 ...tm}.
Adatbázisrendszerek és alkalmazásaik
Relation
Adatbázisrendszerek és alkalmazásaik
Relation schema and relation
Interpretation
Heuristical
Remarks
Adatbázisrendszerek és alkalmazásaik
Relation and record
Remark
The Cartesian product specifies all possible combinations
of values from the under-lying domains.
We denote the total number of values, or cardinality, in a
domain D by |D| , the total number of tuples in the
Cartesian product is:
|dom(A1)| ∙ |dom(A2)| ∙ … ∙ |dom(An)|
Can be proved by induction!
Adatbázisrendszerek és alkalmazásaik
Relation and record
Ordering
Remarks
● From all possible combinations, a relation state at a
given time—the current relation state—reflects only
the valid tuples that represent a particular state of the
real world. As the state of the real world changes, so
does the relation state.
● the schema R is relatively static and changes very
infrequently.
Adatbázisrendszerek és alkalmazásaik
Relation and record
● Interpretation of relation
○ Predicate
■ Each record in relation correspond to a fact or a concrete
entity of the predicate
■ Example: a concrete student of STUDENT’schema : name Dick
Davidson, neptuncode HFJ345, date_of_birth 1991-
05-12
○ Condition
■ the values in every record satisfy a condition
■ Example: the STUDENT schema is true for 5 records in the
STUDENT relation, because represents 5 different facts from the
real
Adatbázisrendszerek és world
alkalmazásaik
Conventions
● A relation schema R of degree n is denoted by
R(A1, A2, ..., An)
● Q, R, S denote relation schema names.
● q, r, s denote relations/relation states
● t, u, v denote tuples
● A relation name represents the current state of relation
while R(A1, A2, …, An) refers only to the relation
schema
● An A attribute can be qualified with the name of relation
schema R to which its belong to: R.A
Adatbázisrendszerek és alkalmazásaik
Conventions
Adatbázisrendszerek és alkalmazásaik
The STUDENT relation
Adatbázisrendszerek és alkalmazásaik