Relational Model Flashcards

1
Q

What is the relational model?

A

Logical data model representing data as relations (tables) with attributes (columns) and tuples (rows)

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

What is the difference between schema and instance ina database?

A

Schema describes structure, instance represents actual data at a specific point in time

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

Primary Key

A

Unique identifier for tuples in a table, ensuring no duplicate rows

One of the candidate keys, if there are multiple candidate keys

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

Superkey

A

Set of attributes that uniquely identify each row in a table

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

Candidate Key

A

minimal set of attributes that can uniquely identify a tuple

every table must have at least a single candidate key

minimal superkey, meaning no subset of its attributes can uniquely identify a tuple

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

A table can have multiple ____ keys but only one ____ key

A

Candiate;Primary

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

Alternate key

A

all keys that are not primary key

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

Foreign Key

A

Attribute in one table that references the primary key in another table, ensuring referential integrity

primary key in one tablle, secondary key in other table

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

Domain Constraints

A

Rules that restrict the values an attribute can have

Ranges, specific formats

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

Tuple Constraints

A

Conditionas that apply to individual tuples

price = cost + tax

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

Referential integrity constraints

A

Ensure foreign key values in a table correspond to primary key values in the referenced table

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

First Normal Form (1NF)

A

Property of a relation where all attribute values are atomic, with no nested or repeating groups

  • Prevents storing multiple pieces of data in once cell, ensuring each piece is individually accessible and updateable
  • What about 2NF and 3NF???
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Non-Prime Attribute

A

Not part of any candidate key

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

Why is normalization important?

A

Reduces redundancy and ensures data consistency

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

What does NULL represent in a databse

A

Absence of information or inapplicable value

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

Why does NULL != NULL

A

Because NULL represents unknown values, and two unknown values cannot be assumed equal

17
Q

What are the advantages of views in databases?

A

Tailored data access, enhanced security, and support for derived data without redundancy.