Relational Algebra Flashcards
(21 cards)
What is relational algebra
It defines the theoretical ways of manipulating table contents using relational operators.
what are the relational operatros
- Union / Intersect
- Difference / Product
- Select / Project / Join / Divide
Unary operator
work on one table at a time.
Select
yields values for all rows in a table satisfying a certain condition.
project
yields values for selected attributes. (cols).
Union
combines rows from two tables excluding duplicates.
what is union-compatible
the two tables must have the same attribute characteristics.
Intersect
yields the rows that appear in both tables.
must be union- compatible.
Difference
Yield all rows that are in the first table that are not found in the second table.
product
AKA catersian product
- yields all possible pairs of rows from two tables.
What is a join
A join allows information to be intelligently combined from two or more tables.
Natural join or Inner join
Returns the matched records from the tables being joined.
Naturally by:
-product
-select
-project
Outer join
The matched pairs would be retained, and any unmatched values in the
other table would be left null.
Left Outer join
All the matched rows as well as the unmatched rows of the left table. RIght will be null.
Right outer join
All matched rows plus the unmatched rows of the right table. left will be null.
Divide
identifying rows from one table associated with all rows in another.
Data dictionary
A detailed description of all tables in the database.
Contains the attribute names and characteristics of the table as well as metadata.
System catalog
Same as a Data dick.
Explain the bridge bitch
M:N not supported directly in relational environment.
bridge entity added between to make it 1:M and M:1…. you know this
what are Indexes
An index is an orderly arrangement used to logically access rows in a table.
- spoeds the data retrieval.
structure of an index
- Has a index key and a set of pointers.
Index key is the reference point.
The pointers point to the location of the data.