and CORRECT Answers
Attribute Domains - Correct Answer- The set of allowable values an attribute can take
examples:
- can be defined by a rule
- can be a set of values
- can be a particular data type and length
Domain Compatibility - Correct Answer- 1) they have the same number of attributes
2) each corresponding attribute has the same domain
Relational Operators - Correct Answer- 1) Projection
2) Selection
3) Union*
4) Difference*
5) Intersection*
6) Product
7) Join
8) Division
* Assumes domain compatibility
Projection - Correct Answer- - Selects specified attributes (columns) from a relation
or
- subset of columns in a given relation
- SQL Select clause
, Selection - Correct Answer- Selects tuples (rows) from a relation; filters by some condition
- SQL where clause
Union - Correct Answer- - Adding rows from one relation A to those of another B.
- Denoted by A+B or A U B.
- A and B should be domain compatible
- commutative (order of rows don't matter)
- Eliminates duplicate values
Difference - Correct Answer- Includes rows that occur in the first relation A but not the
second B.
- Denoted by A-B
- A and B should be domain compatible
A-B != B-A
- Not commutative
Intersection - Correct Answer- Includes rows that are in both the first relation A and the
second relation B
- denoted by A (upside down union) B
- A and B should be domain compatible
- commutative (order of rows don't matter)
SQL subquery
Product - Correct Answer- The product of two relations, the concatenation of every row of
one relation A with every row of a second relation B
- denoted as AxB
Join - Correct Answer- Allows us to combine information from two or more tables