week 1 Relational Models and Relational Algebra Flashcards

1
Q

Rows in the database represent

A

entities

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

Columns in the database represent

A

attributes

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

Are tuples ordered or unordered

A

unordered

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

cardinality

A

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.

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

Does each column have a domain

A

Yes each column have a domain. That is the value of the domain

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

Relation is also know as what in the course

A

Table

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

What is a procedural database language

A

Relational Algebra - Instructs the system to perform a sequence of operations to compute a results

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

What a non- procedural/ Declarative language

A

SQL / Relational Calculus - Tells what data is to be retrieved but does not tell the system how to retrieve the data

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

Relational Algebra - union

A

r U s = (what is in both tables) (add both tables)

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

Relational Algebra - difference

A

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

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

Relational Algebra - cartesion product

A

r x = (all the rows in both)

Basically both tables combined (one big ass table or results)

Combines Columns

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

Relational Algebra - Selection

A

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.

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

Relational Algebra - Projection

A

Returns a set up attributes (only returns the a selected)

Symbol Pi

Just return some fields (columns)

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

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

A

2) 15

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

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

A

1) Difference

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

Which statement about the selection operator is true?

1) It filters certain attributes in a relation based on given criteria.
2) It requires more than one relation as its input.
3) It requires more than one database as its input.
4) It filters certain tuples in a relation based on given criteria.

A

It filters certain tuples in a relation based on given criteria.

17
Q

Relational Algebra - Intersection

A

Returns what is the same in both tables.

Common tuples

18
Q

Join is similar to what

A

Similar to cartesion product, BUT it requires a common selection (like a common id)

19
Q

Consider a relation, STUDENT, with the following attributes: Name, ID number, Major, Graduation Year, and GPA. Consider a query using this relation: “List the names and ID numbers of students majoring in Computer Science.” Which operator is absolutely necessary for this query?

1) Union
2) Difference
3) Intersection
4) Projection

A

4) Projection

20
Q

What is the ϴ-Join operation used for?

1) To join two tuples in the same relation.
2) To join two attributes in the same relation.
3) To join two relations in a database.
4) To join two databases.

A

To join two relations in a database.

21
Q

Which statement about the selection operator is correct? (checkbox)

1) It displays certain tuples based on given criteria.
2) It displays certain attributes based on given criteria.
3) It requires more than one relation.
4) The selection operator can work on a relation even with a single attribute.

A

1) It displays certain tuples based on given criteria.

This is the output of the selection operator.

4)The selection operator can work on a relation even with a single attribute.

This makes sense too.