Relational Data Model Flashcards

1
Q

Uses concept of mathematical relation as its building block and has theoretical basis in set theory and first-order predicate logic

A

Relational Data Model

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

Relational Data Model was first introduced by ______________ in ________

A

Edgar “Ted” F. Codd, 1970

“A Relational Model of Data for Large Shared Data Banks”

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

Relational Data Model represents the database as a collection of _____________

A

relations

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

Each __________ resembles a table of values wherein each “____” represents a fact that corresponds to a real-world entity or relationship

A

relation, row

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

The “_______” and “_______” names are used to help interpret them meaning of
the values of each “row”

A

table, column

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

In a relational data model, the attributes are represented as __________, and the tuple of values corresponding to an instance of a relation as a _______

A

column, row

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

The types of values that can appear in each attribute is the __________ of possible values

A

DOMAIN

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

Set of atomic values, Specify a data type from which the data values forming it are drawn

A

Domain

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

Relation Schema is denoted as

A

R(A1,A2, … An)
where R = Relation Name,
A = Attribute

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

Domain of Ai is denoted as

A

dom(Ai)

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

The number of attributes of its relation schema

A

Degree(or arity) of relation

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

What is the degree of the given relation below?

STUDENT(Student no, Name, Mobile phone, Address, Age, Gpa)

A

6 (6 attributes)

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

A ______________ (or just/simply relation) of the relation schema R denoted as r(R) is the set of n-tuples r = {t1,t2,…,t,}

A

relation state

Simply refers to all the rows stored in the table (that is the entire table)

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

A relation state at a given time is called the _________________________

A

current relation state

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

Notation for Relation State:

A

r(R)
ex: r(STUDENT), r(COURSE)

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

TRUE or FALSE:

A relation state is a subset of the Cartesian product of all domains of the attributes.

A

TRUE. A relation state is defined as A mathematical relation of degree n on the domains dom(A1), dom(A2), …, dom(An), which is a subset of the Cartesian product of
the domains:

r R ⊆ (dom A1 ⨯ dom A2 ⨯ … ⨯ dom An)

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

TRUE or FALSE:

Tuples in a relation DO NOT have a particular order

A

TRUE. The order of the rows doesn’t matter

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

TRUE or FALSE:

Values within a tuple do not have a particular order

A

FALSE. Order of values within a tuple (and of attributes) IS important. Although at a more abstract level, the order does not seem important as
long as the correspondence between them are maintained

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

TRUE or FALSE:

A value in a tuple can be composite or multivalued

A

FALSE. Each value in a tuple is an atomic value (Multivalued and Composite attributes are not allowed)

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

TRUE or FALSE:

NULL values are allowed and are used to represent values of attributes that are empty or zero.

A

FALSE. NULL does not have an inherent value. It is used to represent unknown, unavailable, or may not apply values.

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

The ________________ can be interpreted as a declaration or type of assertion

A

relation schema

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

A tuple (row) in a relation is also called as a _____________

A

FACT

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

Relational Model Constraints’ three main categories:

A
  1. Inherent model-based constraints
  2. Application-based constraints
  3. Schema-based constraints
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

Also called implicit constraints, Based on definition and characteristics of the model

A

Inherent model-based constraints

25
The constraint below is an example of: A relation cannot have duplicate tuples.
Inherent Model-based Constraints/ Implicit Constraints
26
Constraints that cannot be directly expressed in the schemas of the data model. Enforced by the application programs or in some other way (e.g. SQL triggers and assertions)
Application-based Constraints
27
The constraint below is an example of: The maximum number of hours an employee can work on all projects per week is 56.
Application-based Constraints
28
Also called semantic constraints or business rules
Application-based Constraints
29
Constraints that can be directly expressed in the schemas of the data model, typically specified in the DDL. Also called explicit constraints
Schema-based Constraints
30
The constraints below is an example of: 1. Domain constraints 2. Key constraints 3. Constraints on NULLs 4. Entity integrity constraints 5. Referential integrity constraints
Schema-based Constraints (explicit Constraints)
31
Within each tuple, the value of each attribute A must be an atomic value from the domain dom(A)
Domain Constraints
32
A subset of attributes of relation schema R wherein no two tuples in relation state r of R have the same combination of values for these attributes.
Superkey
33
TRUE or FALSE: A superkey is composed of one attribute that is unique to each tuple
FALSE. A superkey can be composite or a combination of attribute
34
Every relation has one superkey (i.e. set of all attributes)
Key constraints
35
A _____________ of relation schema R. That is, we cannot remove any attributes from it and still have the uniqueness constraint hold.
key or minimal superkey
36
KEY or SUPERKEY Combination of Name and StudentNo
SUPERKEY. Since we can remove the Name attribute and still have the uniqueness constraint hold via the studentNo
37
TRUE or FALSE: All SuperKeys are Keys
FALSE. All Keys are SuperKeys but not all superkeys are keys (since some SuperKeys that are combination may not be minimal)
38
Can uniquely identify each tuple in the relation, Is time-invariant
Key
39
TRUE or FALSE: A relation may have more than one key
TRUE. Can have a primary key, and candidate keys
40
TRUE or FALSE: In choosing primary key, it is usually better to pick one with single or smaller number of attributes and that rarely changes
TRUE.
41
TRUE or FALSE: A relation may have more than on primary key
FALSE. You may only assign one primary key that is denoted by an underlined attribute name
42
Specifies whether NULL values are permitted or not
Constraints on NULLs
43
No primary key value can be NULL
Entity Integrity Constraints
44
Specified between two relations and is used to maintain consistency among tuples in the two relations
Referential Integrity Constraints
45
In Referential Integrity Constraints, A tuple in one relation that refers to another relation must refer to an ______________ of that relation
existing tuple
46
Typically arise from the relationships among entities represented by relation schemas
Referential Integrity Constraints
47
A set of relational schemas S = {R1,R2, ... ,Rm} and a set of integrity constraints IC
Relational Database Schema
48
A ________________________ is a set of relation states DB = {r1, r2, ... , rm} such that each ri is a state of Ri and satisfy the integrity constraints specified in IC
relational database state ( DB of S )
49
Refers to both its schema and its current state
Relational Database
50
Satisfies all the constraints in the defined set of integrity constraints
Relational Database Valid State
51
Does not obey all the integrity constraints
Not Valid state of a Relational Database
52
There are three basic operations that can change the states of relations in the database:
1. Insert 2. Delete 3. Update
53
Used to add one or more tuples in a relation
Insert Operation
54
Can violate: ➢ Domain constraints – not appropriate data type ➢ Key constraints – key value already exists in another tuple ➢ NULL constraints – inserting a tuple with no value for an attribute with NOT NULL defined ➢ Entity integrity – any part of the PK of the new tuple is NULL ➢ Referential integrity – value of any FK refers to a tuple that does not exist in referenced relation
Insert Operation
55
Used to remove tuples in a relation
Delete Operation
56
➢ Referential integrity – if tuple being removed is referenced by FKs from other tuples in the database
Delete Operation
57
Used to change values of some attributes in existing tuples
Update Operation
58
Can violate: ➢ Domain constraints – not appropriate data type ➢ Key constraints – key value already exists in another tuple ➢ NULL constraints – modifying a tuple with no value for an attribute with NOT NULL defined ➢ Entity integrity – any part of the PK of the modified tuple is NULL ➢ Referential integrity – value of modified FK refers to a tuple that does not exist in referenced relation; or previous PK was being referenced by existing FKs
Update Operation