Relational Data Model Flashcards

Week 2.1 (22 cards)

1
Q

3 components of the relational data model

A
  1. a structural part - set of rules
  2. amanipulative part - operations allowed on data
  3. a set of integrity constraints
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

define relation

A

table with columns and rows

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

what data type is a row in a relation

A

tuple

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

define attribute

A

named column of a relation

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

define domain

A

a set of allowable values for one or more attributes

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

define degree

A

number of attributes in a relation

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

example of 3 types of degrees

A
  1. unary - 1
  2. binary - 2
  3. ternary - 3
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

define cardinality

A

number of tuples in a relation

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

define relational database

A

collection of normalised relations with distinct relation names

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

properties of relations

A
  • name is distinct
  • each cell contains exactly one single value
  • each attribute has a distinct name
  • values of an attribute are from the same domain
  • each tuple is distinct
  • order of attributes has no significance
  • order of tuples has no significance
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

define candidate key

A

a super key such that no proper subset is a super key within a relation

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

what are the 2 properties of a candidate key

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

what does irreducibility mean in candidate keys

A

no proper subset of K has the uniqueness property

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

define primary key

A

the candidate key that is used to uniquely identify a tuple within a relation

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

define foreign key

A

an attribute, or set of attributes, within one relation that matched the primary (or candidate) key of some relation

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

what are integrity constraints

A

set of rules to ensure the data is accurate by controlling the types of data that can be entered into a table

17
Q

what are the 2 main integrity constraints

A
  1. entity integrity
  2. referential integrity
18
Q

describe entity integrity

A
  • every relation must have a primary key and the primary key must not contain null values
  • implemented through primary key constraint
19
Q

describe referential integrity

A
  • if a foreign key exists in a relation:
    ○ 1 - either the foreign key value must match a candidate key value of some tuple in its home relation or
    ○ 2 - the foreign key values must wholly be null
  • implemented through the foreign key restraint
20
Q

what is null

A

represents a value of an attribute that is currently unknown or is not applicable for this tuple

21
Q

why do we use null

A

way to deal with incomplete or exceptional data

22
Q

define general constraints

A

additional rules specified by the users or database administrator