Chapter 3 Flashcards

1
Q

What are the characteristics of a relational table?

A

1) A table is perceived as a 2-dim structure composed of rows and columns.

2) Each table row represents a single entity occurrence within the entity set.

3) Each table column represents an attribute, and each column has a distinct name.

4) Each intersection of a row and column represents a single data value.

5) All values in a column must conform to the same data format.

6) Each column has a specific range of values knows as the attribute domain.

7) The order of the rows and columns is immaterial to the DBMS.

8) Each table must have an attribute or combination of attributes that uniquely identifies each row (each row has a unique entity, that distinguish these records from others).

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

What is a primary key?

A

Is a key that will identify the whole row (record). For example, the student number (n…) is the primary key that uniquely identifies any given row. Can be a single or, two or more. You have to set it up (not automatic).

All of the values in the primary key must be unique.

No key attribute in the primary key can contain a null

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

What is a foreign key?

A

The primary key of one table that has been placed into another table to create common attribute

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

What is Functional dependence?

A

Value of one or more attributes determines the value of one or more other attributes

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

What is Determinant?

A

Attribute whose value determines another. only the primary key is called determinate.

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

What is Dependent?

A

Attribute whose value is determined by the other attribute

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

What is Superkey?

A

A key that can uniquely identify any row in the table.

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

What is Secondary key?

A

Key used strictly for data retrieval purposes.

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

What are the ways of handling Nulls?

A

Flags: Special codes used to indicate the absence of some value (pop-up messages).

NOT NULL constraint, For example, we cannot duplicate student number (N…)

UNIQUE constraint

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

What is relational algebra?

A

Theoretical way of manipulating table contents using relational operators.

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

What is a Relvar?

A

Variable that holds a relation.

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

What is a closure?

A

Use of relational algebra operators on existing relations produces new relations.

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

What is select as a relational operator?

A

Filtering in the database. You are selecting pieces or all data of the database. For example, “Select all” or “Select only price less than $2.00 yields”.

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

What is project as a relational operator?

A

A projecting (focusing) what you are looking for. Will choose one attribute (not the whole record) –> creating a new table. Väljer en kolumn och skapar en ny tabell

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

What is union as a relational operator?

A

Unionizing (adding) tables. Do not have to repeat if they are already in the table (you do not want duplicates).

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

What is Intersect as a relational operator?

A

What is in common between two tables; intersect them.

17
Q

What is difference as a relational operator?

A

Is the difference between table 1 to table 2 (not the vice versa!), that is subtract table right from the table 1. Table 1 will have a precedence (företräde) of table 2.

Yields all rows in one table that are not found in theother table

18
Q

What is Product as a relational operator?

A

Multiply each row(record) in table 1 with each row in table 2.

19
Q

What is a join?

A

Allows information to be intelligently combined from two or more tables

20
Q

What is a Natural join (product)?

A

Links tables by selecting only the rows with common values in their common attributes

21
Q

What is an Equijoin?

A

Links tables on the basis of an equality condition that compares specified columns of each table

22
Q

What is a Theta join?

A

Extension of natural join, denoted by adding a theta subscript after the JOIN symbol

23
Q

What is an Outer join?

A

Matched pairs are retained and unmatched values in the other table are left null

24
Q

What is a Left outer join?

A

Yields all of the rows in the first table,including those that do not have a matching value in the second table

25
Q

What is a Right outer join?

A

Yields all of the rows in the second table, including those that do not have matching values in the first table

26
Q

What is Divide?

A

Accuracies. Uses one 2-column table as the dividend and one single-column table as the divisor. Output is a single column that contains all values from the second column of the dividend that are associated with every row in the divisor.