Chapter 8 Flashcards
_________ is the basic set of operations for the relational model.
Relational algebra
T/F: Relational operations enable a user to specify basic retrieval requests (or queries.)
True.
T/F: The result of a relational operation is a new relation, which may have been formed from one or more input relations.
True.
“The result of a relational operation is a new relation, which may have been formed from one or more input
relations.”
This property makes the algebra ______.
“closed” (all objects in relational algebra are relations)
T/F: Not all objects in relational algebra are relations.
F, all objects in relational algebra are relations.
T/F: The new relations produced by the algebra operations can be further manipulated using operations of the same algebra.
True.
A sequence of relational algebra operations forms a ______________.
relational algebra expression
T/F: The result of a relational algebra expression is also a relation that represents the result of a database query (or retrieval request.)
True.
Relational Algebra consists of several groups of operations…
1.Unary Relational Operations, includes:
SELECT
PROJECT
RENAME
What are their symbols?
σ (sigma), π (pi), ρ (rho)
Relational Algebra consists of several groups of operations…
- Relational Algebra Operations From Set Theory
Which include?
UNION , INTERSECTION, DIFFERENCE (or MINUS, – ), CARTESIAN PRODUCT ( x ).
Relational Algebra consists of several groups of operations…
- Binary Relational Operations
Which include?
JOIN (several variations of JOIN exist), DIVISION.
Relational Algebra consists of several groups of operations…
- Additional Relational Operations
Which include?
OUTER JOINS, OUTER UNION, AGGREGATE FUNCTIONS.
In general, the select operation is denoted by:
σ <selection>(R)</selection>
Write the query statement using algebra operations:
Select the EMPLOYEE tuples whose department number is 4.
σ DNO = 4 (EMPLOYEE)
Write the query statement using algebra operations:
Select the employee tuples whose salary is greater than $30,000.
σ SALARY > 30,000 (EMPLOYEE)
T/F: The number of tuples in the result of a SELECT is less than (or equal to) the number of tuples in the input relation R.
True.
T/F: SELECT σ is commutative.
true. ex:
σ <condition1>(σ < condition2> (R)) = σ <condition2> (σ < condition1> (R))</condition2></condition1>
T/F: The SELECT operation σ <selection>(R) produces a relation S that has the same schema (same attributes) as R.</selection>
true.
Write the sql equivalent of the following:
σ SALARY > 30,000 (EMPLOYEE)
SELCT * FROM Employee WHERE Salary > 30000;
Name the algebra operation:
_________ operation keeps certain columns (attributes) from a relation and discards the other columns.
PROJECT
Name the algebra operation:
________ creates a vertical partitioning.
PROJECT.
(In other words, The list of specified columns (attributes) is kept in each tuple,
while the other attributes in each tuple are discarded.)
Write the query for the following using relational operations:
List each employee’s first and last name and salary.
π LNAME, FNAME, SALARY (EMPLOYEE)
The general form of the project operation is:
π<attribute>(R)</attribute>
The project operation removes any __________ tuples.
duplicate