February 9, 2010
Relational algebra - A formal system for
Relation – A property that assigns truth values to
combinations (k-tuples (sets))
Formal System – In this case algebra.
Similar to Set Algebra but slightly different.
Relational algebras received little attention until the
publication of E.F. Codd's relational model of data in
Published paper while working at
IBM, however IBM was slow to
implement his design until rivals
started implementing them.
Larry Ellison was inspired by the paper written by
Edgar F. Codd and founded Oracle in 1977.
He had heard about the IBM
System R database, also based
on Codd’s theories, and wanted
Oracle to be compatible with it,
but IBM made this impossible
by refusing to share System R’s
A relational database matches data by using common
characteristics found within the data set.
Example: A data set containing all the real-estate
transactions in a town can be grouped by the year the
transaction occurred; or it can be grouped by the sale
price of the transaction; or it can be grouped by the
buyer's last name.
SQL - Structured Query Language
Designed for managing data in relational database
management systems (RDBMS), and originally based
upon Relational Algebra.
During the 1970s, a group at IBM’s San Jose Research
Laboratory developed the System R relational database
management system. Donald D. Chamberlin and
Raymond F. Boyce of IBM subsequently created the
Structured English Query Language (SEQUEL or SEQL)
to manage data stored in System R.
Clauses - Which are
of statements and queries.
Expressions - Produce
either scalar values or tables consisting of columns and rows of
Predicates - Specify conditions that can be evaluated to
boolean truth values and which are used to limit the effects of
statements and queries, or to change program flow.
Queries - Retrieve data based on specific criteria.
Statements - Have persistent effect on schemas and data, or
which may control transactions, program flow, connections,
sessions, or diagnostics.
Which records in TABLE_A do not share A_KEY in
select * from TABLE_A where A_KEY not in (select A_KEY
What are the records of TABLE_A that share a KEY with
records of TABLE_B?
select * from TABLE_A where TABLE_A.KEY in (select
TABLE_B.KEY from TABLE_B)