Search
Browse
Create
Log in
Sign up
Log in
Sign up
Upgrade to remove ads
Only $2.99/month
Cs 4400 Ch 6 Vocab
STUDY
Flashcards
Learn
Write
Spell
Test
PLAY
Match
Gravity
Test 2 Vocab Ch 6
Terms in this set (46)
relational algebra
basic set of operations for the relational model
relational algebra expression
sequence of relational algebra operations
relational calculus
higher-level declarative language for specifying relational queries
select operation
subset of the tuples from a relation that satisfies a selection condition σ<selection condition>(R)
- Bool selection condition can be written:
<attribute name><comparison op><constant value> or <attribute name><comparison op><attribute name>
- ex: σ(Dno=4 AND Salary>25000) OR (Dno=5 AND Salary>30000)(EMPLOYEE)
- if TRUE, tuple selected
unary
applied to a single relation
selectivity
fraction of tuples selected by a selection condition
- cascade select operations into a single operation with AND condition
project operation
selects columns from table and discards the other columns
- π<attribute list>(R)
degree
the number of attributes in <attribute list>
duplicate elimination
result of project operation is a set of distinct tuples (no replicates)
in-line expression
π<Fname, Lname, Salary>(σ<Dno=5>(EMPLOYEE))
sequence of operations
DEP5_EMPS<-- σ<Dno=5>(EMPLOYEE)
RESULT<-- π<Fname, Lname, Salary>(DEP5_EMPS)
rename
can do this to attributes in intermediate results
ex: ρ<S(B1...Bn)>(R) or ρ<S>(R) or ρ<(B1...Bn)>(R)
operations from set theory
union, intersection, and minus
- merge the elements of two sets in various ways
- binary operations
- relations MUST HAVE the same type of tuples
union
R∪S: includes all tuples that are either in R or in S or in both R and S BUT duplicate tuples are eliminated
intersection
R∩S includes all tuples that are in both R and S ONLY
set difference or minus
R - S: includes all tuples that are in R but NOT in S
Cartesian product (cross product or join) operation
denoted by x, binary set operation, relations do not have to be union compatible, useful when followed by a selection that matches values of attributes
join operation
⋈, combine related tuples from two relations into single "longer" tuples
- form <condition> AND <condition> AND...
- ex: DEPT_MGR<-- DEPARTMENT⋈<Mgr_ssn=Ssn> EMPLOYEE
RESULT<--π<Dname, Lname, Fname>(DEPT_MGR)
theta join
each <condition> of the form Ai Θ Bj where Ai is an attribute of R and Bj is an attribute of S, both Ai and Bj are in the same domain, and Θ is one of the comparison operators {=, <, <=, >, >=, not=}
equijoin
only = comparison operator used, always have one or more pairs of attributes that have identical values in every tuple
natural join
denoted by *, removes second (superfluous) attribute in an Equijoin condition
join selectivity
expected size of join result divided by the maximum size nR*nS
inner joins
type of match and combine operation, defined formally as a combination of cartesian product and selection
complete set
set of relational algebra operations {σ, π, ∪, ρ, -, x}
division operation
denoted by ÷
ex: retrieve name of employees who work on all the projects that "John Smith" works on
- R(Z)÷S(X) attributes of R are a subset of the attributes of S
query tree
represents the input relations of query as leaf nodes of the tree, the relational algebra operations as internal nodes
generalized projection
allows functions of attributes to be included in the projection list π<F1...Fn>(R)
aggregate functions and grouping
common functions applied to collections of numeric values, includes SUM, AVERAGE, MAXIMUM, and MINIMUM
- fancy T used to denote
- Dno T <COUNT Ssn, AVERAGE Salary> (Employee)
recursive relationship
when applied between tuples of the same type
ex: BORG_SSN <-- π<Ssn>(σ<Fname="James" AND Lname="Borg">(EMPLOYEE))
SUPERVISION(Ssn1, Ssn2) <-- π<Ssn, Super_ssn>(Employee)
RESULT1(Ssn) <-- π<Ssn1>(SUPERVISION⋈<Ssn2=Ssn>BORG_SSN)
outer joins
keep all tuples in R, or all those in S, or all those in both relations regardless of whether or not they have matching tuples in the other relation
- left outer join, right outer join, full outer join
- ex: TEMP <-- (EMPLOYEE ⋈<Ssn=Mgr_Ssn> DEPARTMENT)
RESULT <-- π<Fname, Minit, Lname, Dname>(TEMP)
partially compatible
all tuples from both relations included in the result, tuples with the same value combination will appear only once
declarative expression
specify a retrieval request nonprocedural language
- any retrieval that can be specified in basic relational algebra can also be specified in relational calculus
tuple variables
ranges over a particular database relation
satisfy COND(t)
{t l COND(t)}
range relation
R of t: this is what needs to be specified for tuple variables
requested attributes
set of attributes to be retrieved
tuple relational calculus
general expression form:
{t1.Aj, t2.Ak...tn.Am l COND(t1, t2...tn+1...tn+m)}
ex: {t.Fname, t.Lname, t.Address l EMPLOYEE(t) AND (∃d)(DEPARTMENT(d) AND d.Dname="Research" AND d.Dnumber=t.Dno)}
--this lists the name and address of employees who work for the Research department
truth value
of an atom evaluates to either TRUE or FALSE for a specific combination of tuples
formula
boolean condition - made up of one or more atoms connected via logical operators AND, OR, and NOT
universal quantifier
∀ "for all"
existential quantifier
∃ "there exists"
free or bound
definition of a tuple variable in a formula
transforming quantifiers
transform one type of quantifier into other with negation - preceded by NOT
- AND and OR replace one another
- result: negated formula becomes unnegated, or unnegated formula becomes negated
safe expression
guaranteed to yield a finite number of tuples as its result and all values in its result are from the domain of the expression
atoms
formula is made up of these in the domain of relational calculus
truth values
formula is made up of atoms, and if these evaluate to either TRUE or FALSE for a specific set of values, they are called this
YOU MIGHT ALSO LIKE...
ch6 Relational algebra
35 terms
Murach Chapter 3 & 4 Test
33 terms
Python Ch 3
45 terms
Chapter 5
24 terms
OTHER SETS BY THIS CREATOR
GRE Vocab
60 terms
ECON 4350 CH14
17 terms
ECON 4350 CH 13
43 terms
3103 Quiz 2
33 terms