Relational set operators Flashcards

SELECT, PROJECT, JOIN, INTERSECT, UNION, DIFFERENCE

1
Q

SELECT

A

σ A (R)

ex: σ Length_mRNA >1500
^ Length_mRNA < 2000 (GENE)

This translates to “select from gene table the attribute Length_mRNA that is between 1500 and 2000”.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

PROJECT

A

a form of restriction which restrict the subset of
columns that will be returned

ex: π gene_symbol, location (GENE)

This translates to “project from gene table the attributes gene_symbol and location”.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

JOIN

A

|X| (GENE.GeneID = EXPRESSION.GeneID)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

INTERSECT

A

returns those rows common to the specified relations

Symbol: ∩

Example:
σ Length_mRNA = 2000 (GENE)

σ ExpressionLevel > 5 (EXPRESSION)

SELECT * FROM A
INTERSECT
SELECT * FROM B

This is similar to INNER JOIN

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

UNION

A

combines all of the rows from the
specified tables BUT excludes duplicates

Symbol: ∪

Example:
σ Length_mRNA = 2000 (GENE)

σ ExpressionLevel > 5 (EXPRESSION)

SELECT * FROM A
UNION
SELECT * FROM B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

DIFFERENCE

A

turns all rows from
one table that are NOT in another

Symbol: -

Example:
σ Length_mRNA = 2000 (GENE)

σ ExpressionLevel > 5 (EXPRESSION)

SELECT * FROM A
EXCEPT
SELECT * FROM B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

operators used

A

+, -, =, <, >, /=, <=,>=

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

and, or, not

A

^, ∨, ¬

How well did you know this?
1
Not at all
2
3
4
5
Perfectly