IE 4/512 Final Exam Content

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/88

flashcard set

Earn XP

Description and Tags

New content after midterm exam, final exam will contain both midterm and final exam content.

89 Terms

1
New cards

A relational model represents data as a ___

collection of relations

2
New cards

What is an informal way to communicate the fact that relational models represent data in relations?

Each relation resembles a table of values

<p>Each relation resembles a <em>table of values</em></p>
3
New cards

What does a table of values contain?

Rows, table names, and column names

<p>Rows, table names, and column names</p>
4
New cards

What is a tuple?

A set of elements which can be the same as a row

<p>A set of elements which can be the same as a row</p>
5
New cards

What do table and column names do?

Help interpret the meaning of the values in each row

<p>Help interpret the meaning of the values in each row</p>
6
New cards

What is a domain?

A set of atomic values

  • Each value in the domain is indivisible


7
New cards

What does it mean to specify a domain?

To provide logical definitions for the domain names, which will imply what data falls within them.

  • USA_phone_numbers

  • Names


8
New cards

What does it look like for a data type to be specified for each domain?
Give an example for the domain type: 'USA_phone_numbers’

A data type can be declared as a character string, in which each letter represents a digit.

(ddd) ddd-dddd

9
New cards

What is a relation schema? How is it denoted?

Used to describe a relation

Denoted by R(A1 , A2 , A3 … An)

10
New cards

What is the attribute Ai?

The name of a role played by some domain D in a relation schema R

  • D is called the domain of Ai and is denoted by dom(Ai)


11
New cards

What is the degree of a relation?

The number of attributes n of its relation schema

12
New cards

What is a relation state?

An instance of relation r of the relation schema R(A1 , A2 , A3 … An), also denoted by r(R), is a set of n-tuples r = {t1 ,t2 ,…, tn)

13
New cards

What is a primary key?

An attribute in a relational schema that is a key attribute

Their values uniquely identify tuples in the relation

14
New cards

Key attributes become _____ which can be come ____ or _____

Key attribute become candidate keys which can become primary keys or unique keys.

15
New cards

What is the main physical characteristic of a primary key?

Attributes of that form are underlined

16
New cards

When a relation has more than one candidate key, the choice of one becoming a primary key is ____

Arbitrary

17
New cards

It is usually better to choose a primary key with ___ or ___

A single attribute or a small number of attributes

18
New cards

What does the entity integrity constraint state?

No primary key value can be NULL

19
New cards

A tuple that refers to another relation must ___

refer to an existing tuple in that relation

20
New cards

How do we enforce referential integrity constraints?

We use foreign keys

21
New cards

What is a foreign key?

A column, or group of columns, in a table whose values refer to a key in another table. It links the tables and enforces referential integrity

<p>A column, or group of columns, in a table whose values refer to a key in another table. It links the tables and enforces referential integrity</p>
22
New cards

What are the main rules that a foreign key must follow?

  1. The foreign-key columns must match the referenced key’s columns.

    1. Each foreign-key value must either match a key value in the other table or, if allowed, be empty (NULL).


23
New cards
<p>How many referential integrity rules are shown here?</p>

How many referential integrity rules are shown here?

8

24
New cards

What is the main goal of ER-to-Relational mapping

  • Preserve all information by including all attributes

  • Maintain the constraints to the extent possible

  • Minimize NULL values


25
New cards

What is the steps in creating an ER-to-Relational Schema?

  1. Map regular entity types

  2. Map the weak entity types

  3. Map binary 1:1 relation types

  4. Map binary 1:N relation types

  5. Map binary N:M relation types


26
New cards

What do you need to consider when mapping regular entity types?

  • Composite attributes are split into multiple simple attributes


27
New cards

What do you need to consider when mapping weak entity types?

  • The PK of the relation is the combination of the PK(s) of the owner(s) and the partial key of the weak entity type W


28
New cards

What do you need to consider when mapping binary 1:1 entity types?

There are three possible approaches

  1. Foreign key approach

  2. Merged relation approach

  3. Cross -reference / relationship relation approach


29
New cards

What is the Foreign Key approach for mapping Binary 1:1 relationship types?

Choose one of the relationships and include as an FK in S and PK of T

30
New cards

What is the merged relation approach for mapping Binary 1:1 relationship types?

Merge the two entity types and the relationship into a single relation

  • Only appropriate when both participations are total


31
New cards

What do you need to consider when mapping binary 1:N entity types?

identify the relation S that represents the participating entity type at the N-side of the relationship type.


32
New cards

What do you need to consider when mapping binary N:M entity types?

Create a new relation D to represent R

  • A relationship relation

Include as FK attribute in S the PKs of the relations that represent the entity types

  • Their combination will form the PK of S

Include any simple attributes too


33
New cards

What do you need to consider when mapping multi-valued attributes?

Create a new relation that will include an attribute corresponding to A, and the PK of the relation that represents the entity type or relationship type that has A as a multivalued attribute.

34
New cards

What do you need to consider when mapping N-ary relationship types?

Include as FK attributes in S the PKs of the relations that represent the participating entity types.

35
New cards

What is a relational database design? What are its main goals

The grouping of attributes to form good relational schemas

  • Minimize redundancy, information preservation


36
New cards

Why is it important to have a relational database design alongside a E-R or EE-R conceptual model?

You are analyzing why one grouping of attributes is better than the other

37
New cards

What are the two levels of “goodness” in relational schemas

Logical

Implementation

38
New cards

What is the logical level of a relational schema?

Shows how users interpret the relation schema and the meaning of their attributes

39
New cards

What is the implementation (physical) level of a relational schema? By what means is it created?

Shows how tuples in a base relation are stored and updated. Most likely created through a Data Definition Language.

40
New cards

What is a base relation? And how is the information in one stored.

A relation declared through the CREATE TABLE statement. Stored in tables in a DBMS platform.

41
New cards

The implementation level of relation schemas only apply to ________

Base relations

42
New cards

What are the informal guidelines of good relational design?

Remember (SSRN)

  • The semantics of the attributes are clear (Semantics)

  • Not allowing spurious (false) tuples (Spurious Tuples)

  • Reducing redundant information (Redundancy)

  • Reducing NULL values (NULL)


43
New cards

What are the formal concepts for functional dependencies?

  • First Normal Form (1NF)

  • Second Normal Form (2NF)

  • Third Normal Form (3NF)

  • Boyce-Codd Normal Form (BCNF)


44
New cards

What is informal guideline 1 (Semantics) for functional dependencies?

  • Each row should describe one thing (one person, one order, or one relationship between two things)

  • Design a schema that can be designed easily. Relation-by-Relation

  • If one table needs to refer to something described in another table, use a foreign key.


45
New cards

What conceptual competent should only refer to other entities as stated in guideline 1?

Foreign Keys

46
New cards

What are the negative effects of storing redundant information?

  • Wastes storage

  • Causes problems with update anomalies

    • Insertion, Deletion, and Modification operations


47
New cards

What is informal guideline 2 (anomalies) for functional dependencies?

Design a schema that does not suffer from insertion, deletion, or modification anomalies.

48
New cards

Describe an insertion anomaly, using example of EMP_PROJ

Cannot insert a project unless an employee is assigned to it

Cannot insert an employee unless they are assigned to a project

49
New cards

Describe an deletion anomaly, using example of EMP_PROJ

When a project is deleted, it will delete all employees that work on that project

50
New cards

Describe an modification anomaly, using example of EMP_PROJ

If we change the value for the manager of a department, then we will need to update all the corresponding values

51
New cards

What are the main reasons why NULL values might show up on a relational schema?

  • Attribute not applicable or invalid

  • Attribute value unknown

  • Value known to exist, but unavailable


52
New cards

What is informal guideline 3 (NULL) for functional dependencies?

Relations should be designed such that their tuples will have as few NULL values as possible.

Attributes that frequently have NULL values could be placed in different relations.

53
New cards

What is informal guideline 4 (spurious) for functional dependencies?

  • Have the appropreate primary and foreign key associated with each relation

  • Avoid relations that have the same attributes and are not foreign or primary keys


54
New cards

What could bad relations end up becoming in a DBMS platform?

Erroneous results for certain JOIN operations

55
New cards

What property is used to maintain results in a DMBS platform

The Lossless property - used to guarantee meaningful results.

56
New cards

What is a natural JOIN?

Combining two tables by matching rows that have equal values in every column name they share.

57
New cards

What is a functional dependency (FD)?

A constraint between two sets of attributes (in a relation state R) from the database on the possible tuples that can form from a relation state of R.

58
New cards

What does it mean for X to be functionally dependent on Y?

The values on the X component of the tuple are uniquely determine the values of the Y component.

59
New cards

What is the main use of an FD and how are they derived?

They come from real-world constraints on the attributes for the purposes of describing a relation schema and specifying which constraints hold at all times.

60
New cards

What is the most important concept in relational schema design theory?

Functional Dependency (FD)

61
New cards

What is a spurious tuple?

An extra row produced when you join tables that were split from a larger table.

It looks like valid data, but it asserts a relationship that wasn’t in the original data.

62
New cards

What is a single universal schema?

This terminology is used to describe an entire database as one relation (table) with all its attributes.

63
New cards

What is a candidate key?

The minimal set of attributes that uniquely identifies each row (column) in a relation (table).

64
New cards

What do we need to know in order to accurately determine which FDs will hold

We need to know the meaning of and the relationships among the attributes

65
New cards

What are legal relation states?

Relational extensions that satisfy the FD constraints

66
New cards

By what condition do you know that X functionally determines Y?

If whenever two rows in R have the same values for X, they also have the same values for Y

67
New cards

What is normalization?

The process of decomposing bad relations by breaking up their attributes into smaller relations

68
New cards

What does normalization do for a relation schema?

Takes a schema through a series of tests that certify if it satisfies a certain normal form.

69
New cards

What are all normal forms based from?

An analytical tool - the Functional Dependencies among the attributes of a relation.

70
New cards

What is the purpose of normalization?

  1. Minimize redundancy

  2. Minimize insertion, addition, and modification anomalies


71
New cards

What is the definition of a normal form?

The highest form condition that it meets, and shows the degree to which it had been normalized.

72
New cards

Do normal forms guarantee good DB design?

No they do not

73
New cards

What are the two decomposition properties that relational schemas must posess?

Dependency preservation and Lossless properties

74
New cards

Describe the nonadditive (lossless) JOIN property?

Ensures that spurious tuples do not occur with respect to relational schema after decomposition.

  • VERY CRITICAL


75
New cards

What is the dependency preservation property?

Ensures that each FD is represented in some individual relation after decomposition

  • Not as necessary, but important if it still occurs


76
New cards

Is it necessary to design to the highest normal form possible?

No it is not, 3rd Normal Form is the most common in relational schema design.

77
New cards

What is a superkey?

One or more attributes that together uniquely identify each row in a table.

78
New cards

Every relation has at least one _____

Superkey

79
New cards

What is an issue that can come up with Superkeys?

A superkey could include columns it doesn’t need. Even if you remove one of those columns, the remaining columns still uniquely identify every row.

80
New cards

What is the difference between a key and a superkey?

A key is a superkey with no extra attributes. If you remove any attribute from it, it can no longer uniquely identify every row.

  • Has to be minimal


81
New cards

What does it mean for a key (K) to be time-invariant?

The properties do not change overtime

82
New cards

If a relation has more than one key, it is called a ___

candidate key

83
New cards

What is the process of assigning a primary key from a candidate key?

It is an arbitrary process in which one key is titled a primary key and the other is a secondary key

84
New cards

What is a prime attribute?

A member of a candidate key

85
New cards

What does 1NF disallow?

Relations within relations or relations as attribute values within tuples (NON ATOMIC)

  • Composite attributes

  • Multivalued attributes

  • Nested relations


86
New cards

What does 2NF disallow?

This form disallows partial functional dependency within the relation. in which nonprime attributes are partially dependent on a composite primary key.

87
New cards

If a primary key contains a single attribute, does the 2NF test need to be executed?

No, because every attribute is already fully functionally dependent on the primary key

88
New cards

What does 3NF disallow?

This form disallows transitive dependency. Where one attribute determines a second attribute through a third attribute.

89
New cards

In X - Y and Y - Z, with X as the primary key, we consider this a problem only if Y _____

Not a primary key