BTMA 331 02 - relational schema

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

1/23

flashcard set

Earn XP

Description and Tags

Relational Schema

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

24 Terms

1
New cards

what is a relation

a named, two-dimensional table of data.

  • A table consists of rows (records) and columns (attribute or field)

2
New cards

relational database

represents data in the form of tables

3
New cards

components of a relational model

data structure, data manipulation, data integrity

4
New cards

data structure

table and keys

5
New cards

data manipulation

Powerful SQL operations for retrieving and modifying data

6
New cards

data integrity

Mechanisms for implementing business rules that maintain integrity of manipulated

data

7
New cards

EER

enhanced entity relationship - more detailed + comprehensive version of ERD

8
New cards

requirements for a table to qualify as a relation

— It must have a unique name.

— Every attribute value must be atomic (not multivalued, not composite).

— Every row must be unique (can’t have two rows with exactly the same values for all their fields).

— Attributes (columns) in tables must have unique names.

— The order of the columns must be irrelevant.

— The order of the rows must be irrelevant.

9
New cards

entity integrity rule

No primary key attribute (or component of a primary key attribute) may be null

10
New cards

in entity integrity constraints, all primary key fields must be

NOT NULL and Unique to each other

11
New cards

referential integrity constraints

a rule that maintains consistency among the rows of two related tables

12
New cards

in referential integrity constraint, if there is a foreign key in one relation, then

either each foreign key value must match a primary key value in another relation or the foreign key value must be null.

13
New cards

approaches to ensure the referential integrity

restrict, cascade, set-to-null

14
New cards

restrict

don’t allow delete of “parent” side if related rows exist in “dependent” side

15
New cards

cascade

automatically delete “dependent” side rows that correspond with the “parent” side row to be deleted

16
New cards

set to null

set the foreign key in the dependent side to null if deleting from the parent side

17
New cards

functional dependency

constraint between two attributes in which the value of one attribute is determined by the value of another attribute

18
New cards

functional dependency example: The functional dependency of B on A is represented by an arrow: A → B… A functional dependency is not a mathematical dependency: B ____ be computed from A. Rather, if you know the value of A, there can be ___ ___ value for B.”

cannot, only one

19
New cards

candidate key

A unique identifier. One of the candidate keys will become the primary key

  • ex: there is both credit card number and SS# in a table...in this case both are candidate keys.

Each non-key field is functionally dependent on every candidate key

20
New cards

normalization

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

21
New cards

normalization is primarily a tool to

 to validate and improve a logical

design so that it satisfies certain constraints that

avoid unnecessary duplication of data

22
New cards

relations in first normal from (1NF)

contain no multivalued attributes or repeating groups

23
New cards

relations in second normal form (2NF)

are in first normal form and contains no partial functional dependencies

  • 1NF PLUS every non-key attribute is fully functionally dependent on the ENTIRE primary key

  • Every non-key attribute must be defined by the entire key, not by only

    part of the key

24
New cards

relations in third normal form (3NF)

is in second normal form and has no transitive dependencies. A transitive dependency… is a functional dependency between the primary key and one or more nonkey attributes that are dependent on the primary key via another nonkey attribute.”

  • 2NF PLUS no transitive dependencies (functional dependencies on non-primary-key attributes)

  • the primary key is a determinant for another attribute, which in turn is a determinant for a third