Introduction To Database Systems Relational Model and Algebra
Introduction To Database Systems Relational Model and Algebra
Introduction To Database Systems Relational Model and Algebra
Page 2
COSC 304 - Dr. Ramon Lawrence
Relation Example
relation
attributes
tuples
Page 4
COSC 304 - Dr. Ramon Lawrence
1) relation
2) tuple
3) attribute
Page 5
COSC 304 - Dr. Ramon Lawrence
Page 6
COSC 304 - Dr. Ramon Lawrence
Page 9
COSC 304 - Dr. Ramon Lawrence
Relation Instance
A relation instance r(R) can also be defined as a subset of the
Cartesian product of the domains of all attributes in the relation
schema. That is,
r(R) dom(A1) dom(A2) … dom(An)
Example:
R = Person(id, firstName, lastName)
dom(id) = {1,2}, dom(firstName) = {Joe, Steve}
dom(lastName) = {Jones, Perry}
dom(id) dom(firstName) dom(lastName) =
{ (1,Joe,Jones), (1,Joe,Perry), (1,Steve,Jones), (1,Steve,Perry),
(2,Joe,Jones), (2,Joe,Perry), (2,Steve,Jones), (2,Steve,Perry)}
Assume our DB stores people Joe Jones and Steve Perry, then
r(R) = { (1,Joe, Jones), (2,Steve,Perry)}. Page 11
COSC 304 - Dr. Ramon Lawrence
Properties of Relations
A relation has several properties:
1) Each relation name is unique.
No two relations have the same name.
2) Each cell of the relation (value of a domain) contains exactly
one atomic (single) value.
3) Each attribute of a relation has a distinct name.
4) The values of an attribute are all from the same domain.
5) Each tuple is distinct. There are no duplicate tuples.
This is because relations are sets. In SQL, relations are bags.
6) The order of attributes is not really important.
Note that this is different that a mathematical relation and our definitions
which specify an ordered tuple. The reason is that the attribute names
represent the domain and can be reordered.
7) The order of tuples has no significance.
Page 12
COSC 304 - Dr. Ramon Lawrence
Relational Keys
Keys are used to uniquely identify a tuple in a relation.
Note that keys apply to the relational schema not to the relational
instance. That is, looking at the current instance cannot tell you for sure
if the set of attributes is a key.
A superkey is a set of attributes that uniquely identifies a tuple
in a relation.
A key is a minimal set of attributes that uniquely identifies a
tuple in a relation.
A candidate key is one of the possible keys of a relation.
A primary key is the candidate key designated as the
distinguishing key of a relation.
A foreign key is a set of attributes in one relation referring to
the primary key of another relation.
Foreign keys allow referential integrity to be enforced.
Page 13
COSC 304 - Dr. Ramon Lawrence
A) true
B) false
Page 14
COSC 304 - Dr. Ramon Lawrence
A) true
B) false
Page 15
COSC 304 - Dr. Ramon Lawrence
A) true
B) false
Page 16
COSC 304 - Dr. Ramon Lawrence
Example Relations
Employee-Project Database:
Employees have a unique number, name, title, and salary.
Projects have a unique number, name, and budget.
An employee may work on multiple projects and a project may
have multiple employees. An employee on a project has a
particular responsibility and duration on the project.
Relations:
Emp (eno, ename, title, salary)
Proj (pno, pname, budget)
WorksOn (eno, pno, resp, dur)
Practice Questions
Consider a relation storing driver information including:
SSN, name, driver's license number and state (unique together)
Person Relation
SSN nam e L ic N u m L ic S ta te
1 2 3 - 4 5 - 6 7 8 9 S . S m ith 1 2 3 -4 5 6 IA
1 1 1 -1 1 -1 1 1 1 A . L e e 1 2 3 -4 5 6 NY
2 2 2 - 2 2 - 2 2 2 2 J . M ille r 5 5 5 -1 1 1 MT
3 3 3 -3 3 -3 3 3 3 B . C a se y 6 7 8 -1 2 3 OH
4 4 4 - 4 4 - 4 4 4 4 A . A d le r 4 5 6 -3 4 5 IA
Questions: Assumptions:
1) List the candidate keys for the relation. 1) A person has only one driver’s license.
2) Pick a primary key for the relation. 2) A driver’s license uniquely
3) Is name a candidate key for Person? identifies a person.
4) List all the superkeys for Person. Page 19
COSC 304 - Dr. Ramon Lawrence
Relational Integrity
Integrity rules are used to insure the data is accurate.
Constraints are rules or restrictions that apply to the database
and limit the data values it may store.
Types of constraints:
Domain constraint - Every value for an attribute must be an
element of the attribute's domain or be null.
null represents a value that is currently unknown or not applicable.
null is not the same as zero or an empty string.
Entity integrity constraint - In a base relation, no attribute of a
primary key can be null.
Referential integrity constraint - If a foreign key exists in a
relation, then the foreign key value must match a primary key
value of a tuple in the referenced relation or be null. Page 20
COSC 304 - Dr. Ramon Lawrence
A) domain constraint
Page 22
COSC 304 - Dr. Ramon Lawrence
A) Yes
B) No
Page 23
COSC 304 - Dr. Ramon Lawrence
A) Yes
B) No
Page 24
COSC 304 - Dr. Ramon Lawrence
Integrity Questions
Emp Relation WorksOn Relation
eno enam e title s a la r y eno pno re sp dur
E1 J. D oe EE AS E1 P0 n u ll 12
E2 n u ll SA 50000 E2 P1 A n a ly s t n u ll
E3 A . L ee 12 40000 n u ll P2 A n a ly s t 6
E4 J . M ille r PR 20000 E3 P3 C o n s u lta n t 10
E5 B . C asey SA 50000 E9 P4 E n g in e e r 48
n u ll L. C hu EE 30000 E4 P2 P ro g ra m m e r 1 8
E7 R . D a v is ME n u ll E5 n u ll M anager 24
E8 J. Jones SA 50000 E6 P4 M anager 48
E7 P6 E n g in e e r 36
Proj Relation
E7 P4 E n g in e e r 23
pno pnam e budget
n u ll n u ll M anager 40
P1 I n s tr u m e n ts 150000
P2 D B D e v e lo p 135000
Question:
P3 C A D /C A M 250000
How many violations of integrity constraints?
P4 M a in te n a n c e 3 1 0 0 0 0
A) 8 B) 9 C) 10 D) 11 E) 12
P5 n u ll n u ll
Page 25
COSC 304 - Dr. Ramon Lawrence
General Constraints
There are more general constraints that some DBMSs can
enforce. These constraints are often called enterprise
constraints or semantic integrity constraints.
Examples:
An employee cannot work on more than 2 projects.
An employee cannot make more money than their manager.
An employee must be assigned to at least one project.
Page 26
COSC 304 - Dr. Ramon Lawrence
Relational Algebra
A query language is used to update and retrieve data that is
stored in a data model.
Relational algebra is a set of relational operations for
retrieving data.
Just like algebra with numbers, relational algebra consists of
operands (which are relations) and a set of operators.
Every relational operator takes as input one or more relations
and produces a relation as output.
Closure property - input is relations, output is relations
Unary operations - operate on one relation
Binary operations - have two relations as input
A sequence of relational algebra operators is called a
relational algebra expression.
Page 27
COSC 304 - Dr. Ramon Lawrence
Selection Operation
The selection operation is a unary operation that takes in a
relation as input and returns a new relation as output that
contains a subset of the tuples of the input relation.
That is, the output relation has the same number of columns as
the input relation, but may have less rows.
Page 29
COSC 304 - Dr. Ramon Lawrence
where
R is a relation, t is a tuple variable
F is a formula (predicate) consisting of
operands that are constants or attributes
comparison operators: <, >, =, , ,
logical operators: AND, OR, NOT
Page 30
COSC 304 - Dr. Ramon Lawrence
Selection Example
Emp Relation title = 'EE' (Emp)
eno enam e title s a la r y
E1 J. D oe EE 30000 eno enam e title s a la r y
E2 M . S m ith SA 50000 E1 J. D oe EE 30000
E3 A . L ee ME 40000 E6 L. C hu EE 30000
E4 J . M ille r PR 20000
E5 B . C asey SA 50000 salary > 35000 OR title = 'PR' (Emp)
E6 L. C hu EE 30000
E7 R . D a v is ME 40000 eno enam e title s a la r y
Page 31
COSC 304 - Dr. Ramon Lawrence
Selection Question
Question: Given this table and the query:
salary > 50000 or title='PR'(Emp)
Page 32
COSC 304 - Dr. Ramon Lawrence
Page 33
COSC 304 - Dr. Ramon Lawrence
Selection Questions
WorksOn Relation
eno pno re sp dur Write the relational algebra expression that:
E1 P1 M anager 12 1) Returns all rows with an employee working
E2 P1 A n a ly s t 24 on project P2.
E2 P2 A n a ly s t 6 2) Returns all rows with an employee who is
E3 P3 C o n s u lta n t 10 working as a manager on a project.
E3 P4 E n g in e e r 48 3) Returns all rows with an employee working
E4 P2 P ro g ra m m e r 1 8 as a manager for more than 40 months.
E5 P2 M anager 24
E6 P4 M anager 48 Show the resulting relation for each case.
E7 P3 E n g in e e r 36
E7 P5 E n g in e e r 23
E8 P3 M anager 40
Page 34
COSC 304 - Dr. Ramon Lawrence
Projection Operation
The projection operation is a unary operation that takes in a
relation as input and returns a new relation as output that
contains a subset of the attributes of the input relation and all
non-duplicate tuples.
The output relation has the same number of tuples as the input
relation unless removing the attributes caused duplicates to be
present.
Question: When are we guaranteed to never have duplicates
when performing a projection operation?
Page 35
COSC 304 - Dr. Ramon Lawrence
where
R is a relation, t is a tuple variable
{A1,…,Am} is a subset of the attributes of R over which the projection
will be performed.
Order of A1,…, Am is significant in the result.
Cardinality of A ,…,A (R) is not necessarily the same as R because
1 m
of duplicate removal.
Page 36
COSC 304 - Dr. Ramon Lawrence
Projection Example
Emp Relation eno,ename (Emp)
eno enam e title s a la r y eno enam e
E1 J. D oe EE 30000 E1 J. D oe
E2 M . S m ith SA 50000 E2 M . S m ith
E3 A . L ee ME 40000 E3 A . L ee
E4 J . M ille r PR 20000 E4 J . M ille r
E5 B . C asey SA 50000 E5 B . C asey
E6 L. C hu EE 30000 E6 L. C hu
E7 R . D a v is ME 40000 E7 R . D a v is
E8 J. Jones SA 50000 E8 J. Jones
Projection Question
Question: Given this table and the query:
title (Emp)
Page 38
COSC 304 - Dr. Ramon Lawrence
Projection Questions
WorksOn Relation
eno pno re sp dur
E1 P1 M anager 12 Write the relational algebra expression that:
E2 P1 A n a ly s t 24
1) Returns only attributes resp and dur.
E2 P2 A n a ly s t 6
2) Returns only eno.
E3 P3 C o n s u lta n t 10
3) Returns only pno.
E3 P4 E n g in e e r 48
E4 P2 P ro g ra m m e r 1 8
Show the resulting relation for each case.
E5 P2 M anager 24
E6 P4 M anager 48
E7 P3 E n g in e e r 36
E7 P5 E n g in e e r 23
E8 P3 M anager 40
Page 39
COSC 304 - Dr. Ramon Lawrence
Union
Union is a binary operation that takes two relations R and S as
input and produces an output relation that includes all tuples
that are either in R or in S or in both R and S. Duplicate tuples
are eliminated.
General form:
R S = {t tR or tS}
where R, S are relations, t is a tuple variable.
Page 40
COSC 304 - Dr. Ramon Lawrence
Union Example
eno enam e title s a la ry
Emp E1 J. D oe EE 30000
E2 M . S m ith SA 50000
E3 A . L ee ME 40000
E4 J . M ille r PR 20000
E5 B . C asey SA 50000
E6 L. C hu EE 30000 eno(Emp) eno(WorksOn)
E7 R . D a v is ME 40000
E8 J. Jones SA 50000 eno
E1
Set Difference
Set difference is a binary operation that takes two relations R
and S as input and produces an output relation that contains all
the tuples of R that are not in S.
General form:
R – S = {t tR and tS}
where R and S are relations, t is a tuple variable.
Note that:
R – S S – R
R and S must be union compatible.
Page 42
COSC 304 - Dr. Ramon Lawrence
E7 R . D a v is ME 40000 E7 P3 E n g in e e r 36
E8 J. Jones SA 50000 E7 P5 E n g in e e r 23
Intersection
Intersection is a binary operation that takes two relations R
and S as input and produces an output relation which contains
all tuples that are in both R and S.
General form:
R S = {t tR and tS}
where R, S are relations, t is a tuple variable.
R and S must be union-compatible.
Page 44
COSC 304 - Dr. Ramon Lawrence
Intersection Example
eno enam e title s a la ry
Emp E1 J. D oe EE 30000
E2 M . S m ith SA 50000
E3 A . L ee ME 40000
E4 J . M ille r PR 20000
E5 B . C asey SA 50000
E6 L. C hu EE 30000 eno(Emp) eno(WorksOn)
E7 R . D a v is ME 40000
E8 J. Jones SA 50000 eno
E1
eno pno re s p dur
WorksOn E2
E1 P1 M anager 12
E3
E2 P1 A n a ly s t 24
E2 P2 A n a ly s t 6 E5
E3 P4 E n g in e e r 48 E6
E5 P2 M anager 24 E7
E6 P4 M anager 48
E7 P3 E n g in e e r 36
E7 P5 E n g in e e r 23
Page 45
COSC 304 - Dr. Ramon Lawrence
Set Operations
Union-compatible Question
Question: Two tables have the same number of fields in the
same order with the same types, but the names of some fields
are different. True or false: The two tables are union-
compatible.
A) true
B) false
Page 46
COSC 304 - Dr. Ramon Lawrence
Cartesian Product
The Cartesian product of two relations R (of degree k1) and S
(of degree k2) is:
Proj Relation E3
E4
A . L ee
J . M ille r
ME
PR
40000
20000
P2
P2
D B D e v e lo p
D B D e v e lo p
135000
135000
pno pnam e budget E1 J. D oe EE 30000 P3 C A D /C A M 250000
E2 M . S m ith S A 50000 P3 C A D /C A M 250000
P1 In s tru m e n ts 150000
E3 A . L ee ME 40000 P3 C A D /C A M 250000
P2 D B D e v e lo p 135000 E4 J . M ille r PR 20000 P3 C A D /C A M 250000
P3 C A D /C A M 250000
Page 48
COSC 304 - Dr. Ramon Lawrence
A) degree = 8, cardinality = 80
D) degree = 8, cardinality = 18
Page 49
COSC 304 - Dr. Ramon Lawrence
-Join
Theta () join is a derivative of the Cartesian product. Instead
of taking all combinations of tuples from R and S, we only take
a subset of those tuples that match a given condition F:
Page 50
COSC 304 - Dr. Ramon Lawrence
-Join Example
WorksOn Relation WorksOn dur*10000 > budget Proj
eno p n o re s p dur eno pno re sp dur P .p n o p n a m e budget
E1 P1 M anager 12 E2 P1 A n a ly s t 24 P1 In s tru m e n ts 150000
E2 P1 A n a ly s t 24 E2 P1 A n a ly s t 24 P2 D B D e v e lo p 135000
E3 P4 E n g in e e r 48 P1 In s tru m e n ts 150000
E2 P2 A n a ly s t 6
E3 P4 E n g in e e r 48 P2 D B D e v e lo p 135000
E3 P4 E n g in e e r 48 E3 P4 E n g in e e r 48 P3 C A D /C A M 250000
E5 P2 M anager 24 E3 P4 E n g in e e r 48 P4 M a in te n a n c e 310000
E6 P4 M anager 48 E5 P2 M anager 24 P1 In s tru m e n ts 150000
E5 P2 M anager 24 P2 D B D e v e lo p 135000
E7 P3 E n g in e e r 36
E6 P4 M anager 48 P1 In s tru m e n ts 150000
E7 P4 E n g in e e r 23 E6 P4 M anager 48 P2 D B D e v e lo p 135000
E6 P4 M anager 48 P3 C A D /C A M 250000
Proj Relation E6 P4 M anager 48 P4 M a in te n a n c e 310000
E7 P3 E n g in e e r 36 P1 In s tru m e n ts 150000
pno pnam e budget E7 P3 E n g in e e r 36 P2 D B D e v e lo p 135000
P1 I n s tr u m e n ts 150000 E7 P3 E n g in e e r 36 P3 C A D /C A M 250000
P2 D B D e v e lo p 135000 E7 P4 E n g in e e r 23 P1 In s tru m e n ts 150000
E7 P4 E n g in e e r 23 P2 D B D e v e lo p 135000
P3 C A D /C A M 250000
P4 M a in te n a n c e 3 1 0 0 0 0
P5 C A D /C A M 500000
Page 51
COSC 304 - Dr. Ramon Lawrence
Types of Joins
The -Join is a general join in that it allows any expression in
the condition F. However, there are more specialized joins that
are frequently used.
Page 52
COSC 304 - Dr. Ramon Lawrence
Equijoin Example
WorksOn Relation WorksOn WorksOn.pno = Proj.pno Proj
eno p n o re s p dur e n o p n o re sp dur P .p n o p n a m e budget
E1 P1 M anager 12 E1 P1 M anager 12 P1 I n s tr u m e n ts 150000
E2 P1 A n a ly s t 24 P1 I n s tr u m e n ts 150000
E2 P1 A n a ly s t 24
E2 P2 A n a ly s t 6 P2 D B D e v e lo p 135000
E2 P2 A n a ly s t 6
E3 P4 E n g in e e r 48 P4 M a in te n a n c e 310000
E3 P4 E n g in e e r 48 E5 P2 M anager 24 P2 D B D e v e lo p 135000
E5 P2 M anager 24 E6 P4 M anager 48 P4 M a in te n a n c e 310000
E7 P3 E n g in e e r 36 P3 C A D /C A M 250000
E6 P4 M anager 48
E7 P4 E n g in e e r 23 P4 M a in te n a n c e 310000
E7 P3 E n g in e e r 36
E7 P4 E n g in e e r 23
Proj Relation
pno pnam e budget What is the meaning of this join?
P1 I n s tr u m e n ts 150000
P2 D B D e v e lo p 135000
P3 C A D /C A M 250000
P4 M a in te n a n c e 3 1 0 0 0 0
P5 C A D /C A M 500000
Page 53
COSC 304 - Dr. Ramon Lawrence
Outer Joins
Outer joins are used in cases where performing a join "loses"
some tuples of the relations. These are called dangling tuples.
There are three types of outer joins:
1) Left outer join - R S - The output contains all tuples of R
that match with tuples of S. If there is a tuple in R that matches
with no tuple in S, the tuple is included in the final result and is
padded with nulls for the attributes of S.
2) Right outer join - R S - The output contains all tuples of
S that match with tuples of R. If there is a tuple in S that
matches with no tuple in R, the tuple is included in the final
result and is padded with nulls for the attributes of R.
3) Full outer join - R S - All tuples of R and S are included
in the result whether or not they have a matching tuple in the
other relation.
Page 56
COSC 304 - Dr. Ramon Lawrence
Proj Relation
pno pnam e budget
P1 I n s tr u m e n ts 150000
P2 D B D e v e lo p 135000
P3 C A D /C A M 250000
P4 M a in te n a n c e 3 1 0 0 0 0
P5 C A D /C A M 500000
Page 57
COSC 304 - Dr. Ramon Lawrence
B) 9 Proj Relation
C) 8 pno pnam e budget
P1 I n s tr u m e n ts 150000
D) 7 P2 D B D e v e lo p 135000
P3 C A D /C A M 250000
P4 M a in te n a n c e 3 1 0 0 0 0
P5 C A D /C A M 500000
Page 58
COSC 304 - Dr. Ramon Lawrence
Page 59
COSC 304 - Dr. Ramon Lawrence
Semi-Join Example
WorksOn Relation Proj ⋉Proj.pno = WorksOn.pno WorksOn
eno p n o re s p dur
pno pname budget
E1 P1 M anager 12
P1 Instruments 150000
E2 P1 A n a ly s t 24
P2 DB Develop 135000
E2 P2 A n a ly s t 6
P3 CAD/CAM 250000
E3 P4 E n g in e e r 48
P4 Maintenance 310000
E5 P2 M anager 24
E6 P4 M anager 48
E7 P3 E n g in e e r 36
E7 P4 E n g in e e r 23
Proj Relation
pno pnam e budget
P1 I n s tr u m e n ts 150000
P2 D B D e v e lo p 135000
P3 C A D /C A M 250000
P4 M a in te n a n c e 3 1 0 0 0 0
P5 C A D /C A M 500000
Page 60
COSC 304 - Dr. Ramon Lawrence
Anti-Join Example
WorksOn Relation Proj ⊳ Proj.pno = WorksOn.pno WorksOn
eno p n o re s p dur
pno pname budget
E1 P1 M anager 12
P5 CAD/CAM 500000
E2 P1 A n a ly s t 24
E2 P2 A n a ly s t 6
E3 P4 E n g in e e r 48
E5 P2 M anager 24
E6 P4 M anager 48
E7 P3 E n g in e e r 36
E7 P4 E n g in e e r 23
Proj Relation
pno pnam e budget
P1 I n s tr u m e n ts 150000
P2 D B D e v e lo p 135000
P3 C A D /C A M 250000
P4 M a in te n a n c e 3 1 0 0 0 0
P5 C A D /C A M 500000
Page 61
COSC 304 - Dr. Ramon Lawrence
Division Operator
The division operator on relations R and S, denoted as R ÷ S
produces a relation that consists of the set of tuples from R
defined over the attributes C that match the combination of
every tuple in S, where C is the set of attributes that are in R
but not in S.
For the division operation to be defined the set of attributes of S
must be a subset of the attributes of R.
Division Example
Find the employees who work on all the projects listed in Proj.
WorksOn Proj
ENO PNO PNAME BUDGET
PNO PNAME BUDGET
E1 P1 Instrumentation 150000
P1 Instrumentation 150000
E2 P1 Instrumentation 150000
E2 P2 Database Develop. 135000 P4 Maintenance 310000
E3 P1 Instrumentation 150000
E3 P4 Maintenance 310000
E4 P2 Instrumentation 150000
E5
E6
P2
P4
Instrumentation
Maintenance
150000
310000 eno,pno(WorksOn) ÷ pno(Proj)
E7 P3 CAD/CAM 250000
E8 P3 CAD/CAM 250000 ENO
E3
Page 63
COSC 304 - Dr. Ramon Lawrence
Division Questions
1) Can you give the relational algebra expression to find the
projects that are worked on by all employees?
Page 64
COSC 304 - Dr. Ramon Lawrence
Combining Operations
Relational algebra operations can be combined in one
expression by nesting them:
eno,pno,dur(ename='J. Doe' (Emp) ⨝ dur>16 (WorksOn))
Return the eno, pno, and duration for employee 'J. Doe' when
he has worked on a project for more than 16 months.
Rename Operation
Renaming can be applied when assigning a result:
Page 66
COSC 304 - Dr. Ramon Lawrence
Operator Precedence
Just like mathematical operators, the relational operators have
precedence.
Complete Set of
Relational Algebra Operators
It has been shown that the relational operators {, , , , -}
form a complete set of operators.
That is, any of the other operators can be derived from a
combination of these 5 basic operators.
Examples:
Intersection - R S R S - ((R - S) (S - R))
We have also seen how a join is a combination of a Cartesian
product followed by a selection.
Division operator: R(Z) S(X) where X Z and Y = Z - X:
T1 Y(R)
T2 Y((S T1) -R)
T T1 - T2
Page 68
COSC 304 - Dr. Ramon Lawrence
Queries:
List the names of all employees.
ename(Emp)
Page 69
COSC 304 - Dr. Ramon Lawrence
Practice Questions
Relational database schema:
branch (bname, address, city, assets)
customer (cname, street, city)
deposit (accnum, cname, bname, balance)
borrow (accnum, cname, bname, amount)
1) List the names of all branches of the bank.
2) List the names of all deposit customers together with their
account numbers.
3) Find all cities where at least one customer lives.
4) Find all cities with at least one branch.
5) Find all cities with at least one branch or customer.
6) Find all cities that have a branch but no customers who live
in that city. Page 70
COSC 304 - Dr. Ramon Lawrence
Page 73
COSC 304 - Dr. Ramon Lawrence
Conclusion
The relational model represents data as relations which are
sets of tuples. Each relational schema consists of a set of
attribute names which represent a domain.
Objectives
Define: relation, attribute, tuple, domain, degree, cardinality,
relational DB, intension, extension
Define: relation schema, relational database schema, relation
instance, null
Perform Cartesian product given two sets.
List the properties of relations.
Define: superkey, key, candidate key, primary key, foreign key
Define: integrity, constraints, domain constraint, entity integrity
constraint, referential integrity constraint
Given a relation be able to:
identify its cardinality, degree, domains, keys, and superkeys
determine if constraints are being violated
Page 75
COSC 304 - Dr. Ramon Lawrence
Objectives (2)
Define: relational algebra, query language
Define and perform all relational algebra operators.
List the operators which form the complete set of operators.
Show how other operators can be derived from the complete
set.
Page 76