Week 4 Flashcards

1
Q

What is a Relation?

A

A 2-dimensional table that has specific characteristics

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

What is a Tuple in a Relation table?

A

Simply the horizontal row which contains all data for a single entity

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

What is the Candidate key in terms of Relations?

A

The minimal set of attributes whose values uniquely identify each tuple

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

What is the Foreign Key in terms of Relations?

A

An attribute, or set of attributes, withinb one relation that matches the primary key of another relation

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

What are properties of Relations?

A

A relation has a name that is distinct from all other relation names in the database

Each cell of the relation contains exactly one atomic (single) value

Each attribute has a distinct name

The values of an attribute are all from the same domain

Each tuple is distinct - there are no duplicate tuples

The order of attributes has no significance

The order of tuples has no significance

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

What is a Relation Schema?

A

A relation schema defines the structure and constraints of a relation in a relational database

R(A1,A2,A3…An)

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

What is a Relation Instance/state?

A

A set of tuples from a relation schema

r(R)

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

What are Integrity Constraints?

A

Restrictions placed on the values of attributes

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

What are the 3 types of Integrity Constraints (hint: E,R,D)?

A

Entity Integrity

Referential Integrity

Domain Constraint

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

Principles of Entity Integrity in Relational Databases

A

Uniqueness - No 2 tuples can have identical values for candidate keys

Not-Null- No attribute of a candidate key can be NULL
* Null - A value of an attribute is currently unknown or not applicable for this tuple

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

What is Referential Integrity?

A

If a foreign key exists in a relation:

  • Either the foreign key value matches a primary key value in its home relation
  • Or the foreign key value is NULL
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is a Domain Constraint?

A

Domain: the set of allowable values for one or more attributes

Domain Constraint simply puts constraints on what attributes can be eg. integer from 1-999

if invalid attribute is entered, then an error is given

eg. If the attribute Age is specified to be in the range 16-30, any number outside would give an error

eg. If the attribute Name is to hold a set of characters, then any multiplication or division operations on the attribute values are illegal

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

What is a View?

A

A subset of base relation(s)

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

What is a Base Relation?

A

A named relation corresponding to an entity in the conceptual schema, whose tuples are physically stored in the database

Eg .Students, Teachers, and Classes. Each of these entities would typically be represented by a base relation (table) in the database.

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

What are the Features of Views?

A

Virtual/Derived Relation - It does not necesasarily exist in the database, but can be produced upon request

Dynamic - The changes made to the base relation that affect the view are immediately reflected in the view

Generated by applying appropriate relational operations (eg. σ, π, x, ⋈ ,..)

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