week 1 Relational Models and Relational Algebra Flashcards
Rows in the database represent
entities
Columns in the database represent
attributes
Are tuples ordered or unordered
unordered
cardinality
Cardinality refers to the relationship between a row of one table AND a row of another table. The only two options for cardinality are one OR many.
Example: Think of a credit card company that has two tables: a table for the person who gets the card and a table for the card itself.
Does each column have a domain
Yes each column have a domain. That is the value of the domain
Relation is also know as what in the course
Table
What is a procedural database language
Relational Algebra - Instructs the system to perform a sequence of operations to compute a results
What a non- procedural/ Declarative language
SQL / Relational Calculus - Tells what data is to be retrieved but does not tell the system how to retrieve the data
Relational Algebra - union
r U s = (what is in both tables) (add both tables)
Relational Algebra - difference
r -s = (difference between the two tables)
List IS NOT
Remove all like elements in both tables and the result is what is left over
Relational Algebra - cartesion product
r x = (all the rows in both)
Basically both tables combined (one big ass table or results)
Combines Columns
Relational Algebra - Selection
select a few rows in the relation on a condition
Sigma works on one operator
Filter everything except what you are looking for
It filters certain tuples in a relation based on given criteria.
Relational Algebra - Projection
Returns a set up attributes (only returns the a selected)
Symbol Pi
Just return some fields (columns)
Given two tuple sets (A with 10 elements and B with 5 elements), what is the maximum number of tuples in the union of these sets?
1) 5
2) 15
3) 10
4) 60
2) 15
Which mathematical operator must be used in order to display information about students who are majoring in Computer Science but not in Electrical Engineering?
1) Difference
2) Intersection
3) Union
4) cartesion product
1) Difference