Week 3 Flashcards

1
Q

What does UNION do?

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

What does DIFFERENCE do?

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

What does entity integrity mean?

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

What does relational integrity mean?

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

What are superkeys?

A

An attribute or set of attributes which identify a particular tuple.

Their only property is that they are unique.

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

What are candidate keys?

A

These are a subset of superkeys that have no subset that can be a superkey.

They are also referred to as MINIMAL superkeys.

A primary key is chosen from the candidate keys.

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

What are the attributes needed to allow a union between relations?

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

What are secondary keys?

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

What does SELECT/RESTRICT do? Notation

A

Returns a horizontal subset within a relation.

Sigma

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

What does PROJECT do? Notation?

A

Returns a vertical subset in a relation.

Pi

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

Are candidate keys superkeys? Whats the difference?

A

Yes. Candidate keys have no redundant components. All the components are required to indentify whatever the candidate key is for.

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

What does a relation consist of?

A
  • Heading

- Body

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

What is a relation heading/relational schema?

A

Consists of all fixed set of attributes for relation R

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

What are tuples?

A

Instances of the heading,

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

What is a relation body/instance

A

Consists of a time varying set of n-tuples.

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

What is referred by relation cardinality?

A

The number of tuples

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

What is the relation degree?

A

The number of valies in tuple (number of attribute)

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

What are the fundamental relation properties?

A
  • NO duplicate tuples
  • Tuples are UNORDERED within a relation
  • NO ordering of attributes within a tuple
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What are the fundamental relation properties?

A
  • NO duplicate tuples
  • Tuples are UNORDERED within a relation
    • can only be accesed via data within tuple
  • NO ordering of attributes within a tuple
  • Tuple values are atomic (cant be divided)
20
Q

Are tables and relations the same?

A

NO, tables are visual/tabula representations of relations. THEY ARE NOT THE SAME.

21
Q

Are multivalued/repeating attributes allowed in a tuple?

22
Q

What is functional dependancy?

A

When one attribute determines another attribute.

Attribute A can be be used to determine attribute B.

Attribute A = unique

23
Q

What are alternate keys?

A

These are candidate keys that were NOT chosen as PKs

23
Q

What are alternate keys?

A

These are candidate keys that were NOT chosen as PKs

24
What is a surrogate key?
This is an attribute that is soley present to act as a primary key.
25
Should primary keys be free of semantics?
Yes, they should not provide any additional information (especially important info) E.g. Although TFN could be a PK, best not to use TFN in a public setting as it is private info.
26
What is a NULL?
This refers to when there is NO VALUE. NOTE: 0 IS NOT A NULL VALUE
27
Do NULLs exist in the relational model?
NO, they were only implemented by the relation database system.
28
What is the naming convention for relations?
- Name is all caps and singular - PK is start of tuple and underlines - Rest of attributes NOT ordered
29
Is there redundant data in a relational database?
YES, a minimal amount in foreign keys/composite keys.
30
What are the functions of a PK?
- To ensure that a tuple is unique | - To act as a foreign key to relate (logical connection between) tuple
31
What are the rules for FKs?
- They MUST point to a COMPLETE PK | - If no match with full PK then NULL
31
What are the rules for FKs?
- They MUST point to a COMPLETE PK | - If no match with full PK then NULL
32
Do FKs need the same name as PKs?
No, they can have different names.
33
What is domain/column integrity?
All values in a given column must come from the same domain (same datatype and within the range)
34
What does a "closure" property refer to?
Queries on relations produce relations.
34
What does a "closure" property refer to?
Queries on relations produce relations.
35
What is procedural?
You have to specify the instructions as well as the order of instructions.
36
What are the basic operations in relational algebra?
single relation: selection, projection two relations: - cartesian product, join - union - intersection - difference - division
37
What does JOIN do?
Combines data from two or more relations based on a common attribute or attributes
38
Types of joins?
- Theta (generalised join) - Equi - Natural
39
What is a theta join?
RELATION.attribute F RELATION2.attribute F is an operator ( etc.)
40
What is a natural join?
Projection of the results from an equijoin ???
41
What is an equijoin?
A join where two attributes are made to be equal
42
What is a canonical query?
43
What is a canonical query?
44
Ways to be more efficient when querying?
Grabbing data as early as possbile