Logical Data Modeling - Relational Model and Normalization

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/45

flashcard set

Earn XP

Description and Tags

Midterm

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

46 Terms

1
New cards

What was the relational model commonly adopted to build?

Both logical and internal data models

2
New cards

Ordered list of attribute values. This is the row of the table

Tuple

3
New cards

How is a relational schema denoted?

Name(Attribute1, Attribute2, …AttributeN)

4
New cards

A set S of relation schemas that belong to the same database

Relational Database Scheme

5
New cards

T/F: All values in a tuple are considered atomic

True

6
New cards

Where must each value in a tuple be from?

The domain of the attribute for that column

7
New cards

What are the four types of constraints in the relational model?

Domain

Key

Entity Integrity

Referential Integrity

8
New cards

When are integrity constraints specified

When relations are designed and created in DBMS

9
New cards

When are integrity constraints checked by the DBMS?

When relation status is changed

10
New cards

Constraint where every value in a tuple must be from the domain of its attribute

Domain Constraint

11
New cards

What is a key constraint

Each row(tuple) has a key that uniquely identifies that tuple in the table

12
New cards

Set of attributes of a relation where no two tuples will have the same value for the set of attributes

Superkey

13
New cards

A ______ is a minimal superkey

key

14
New cards

What does a key being a “minimal” superkey mean

No two tuples of R have the same value for this set of attributes

If any attribute is removed from this set then it won’t be a superkey

15
New cards

T/F: not every key is also a superkey

False, any key is also a superkey but not every superkey is a key

16
New cards

Any set of attributes that ______ a key is a ________

contains, superkey

17
New cards

If a relation has several cadidate keys, one is chose to be the ________

Primary key

18
New cards

Constraint where the primary key attributes of each relation cannot have null values in any tuple

Entity integrity constraint

19
New cards

Constraint used to specify a relationship among tuples. All foreign key constraints are enforced

Referential Integrity Constraint

20
New cards

In a referential integrity constraint, what must the value in the foreign key be?

Either a value existing in the corresponding primary key or a null

21
New cards

How do you map a multivalued attribute to the relational schema?

It becomes a separate relation with a foreign key taken from the superior entity

22
New cards

virtual table in a relational database that presents data from one or more underlying tables

View

23
New cards

Underlying table whose value is really stored in the database

Base table

24
New cards

T/F: Views store data

False

25
New cards

What do views display

Only necessary information

26
New cards

What are the benefits of using views

Data abstraction: hides complexity of base tables and simplifies data access

Security: restricts access to sensitive data by allowing specific users to see it

Simplified queries: enables reuse of complex queries

Logical data independence: allows changes to database schema without affecting how others access the data

27
New cards

What is the goal of relational schema design

Avoid redundancy and anomalies

28
New cards

What are the four problems when relations are not well structured?

Redundant storage: some information stored repeatedly

Update Anomalies: if one copy of repeated data is updated, inconsistency occurs unless all copies are updated

Insertion Anomalies: adding new rows forces user to create duplicate data

Delete Anomalies: deleting rows can cause loss of data that would be needed for future rows

29
New cards

Relation that contains a minimal amount of redundancy, and allows users to insert, delete, and update tuples in a relation without errors or inconsistency

Well-structured relation

30
New cards

An effect where updating a value of an attribute, like its name, does not update anywhere else. This causes inconsistencies.

Anomaly

31
New cards

The value of one attribute determines the value of another attribute

Functional Dependency

32
New cards

When is a functional dependency a fully functional dependency

If removal of any attribute from X means that the dependency won’t hold anymore

33
New cards

 If X, A -> Y, and you remove A, X still determines Y.

Partial dependency

34
New cards

 If A -> B, and B -> C, then A -> C

Transitive dependency

35
New cards

What is the main technique for schema refinement

Decomposition

36
New cards

Systematic process of decomposing relations with anomalies to produce smaller, well-structured relations

Normalization

37
New cards

What is normalization used for?

Used for evaluating and correcting relational schemas to minimize data redundancies

38
New cards

State of a particular relation determined based on functional dependencies

Normalization form

39
New cards

What are the normalization forms

1NF: First normal form

2NF: Second normal form

3NF: Third normal form

BCNF: Boyce-Codd normal form

4NF: Fourth normal form

40
New cards

What are the conditions for 1NF?

Every attribute is atomic and single

The relation has a relation name

41
New cards

What are the conditions for 2NF?

It is in 1NF

It includes no partial dependencies

42
New cards

T/F: it isn’t possible to exhibit transitive dependencies in 2NF

False

43
New cards

What do we have to do if the relation is not in 2NF

Decompose and set up new relation for each partial key together with its dependent attribute types

Keep a relation with the original primary key and any attributes that are fully functionally dependent on it

44
New cards

What are the steps for the normalization process to 2NF

  1. Write each key component on a separate line

  2. Create a relation per each key component and assign corresponding dependent attributes

45
New cards

What are the conditions for 3NF

it is a 2NF

it contains no transitive dependencies

46
New cards

What are the steps for the normalization process to 3NF

  1. Identify each new determinant

  2. Identify the dependent attributes and add them in a new table

  3. Remove the dependent attributes of the transitive dependencies from the original table. All that should be left is the foreign key