Chapter 8 (Section 1) #2 Flashcards

(61 cards)

1
Q

Section 1: Database Fundamentals

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

What is the definition of a database?

A

A structured collection of data items that are accessible by various applications.

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

What is a relational database?

A

A database that links data items together via the use of internal pointers.

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

In a database context, what is a table?

A

A group of similar data organized into rows (for entities) and columns (for attributes).

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

Define a “Record” or “Tuple.”

A

A row in a table that represents a single instance of an entity.

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

Define a “Field” or “Attribute.”

A

A column in a table representing a specific data item or characteristic stored about an entity.

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

What is an “Entity”?

A

Anything about which data can be stored, such as a person, event, or object.

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

What is the purpose of “Indexing” in a database?

A

To optimize search operations by creating a structure for fast data retrieval based on specific columns.

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

Section 2: File-Based vs. Relational Approach

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

How is a file-based system defined?

A

A collection of data items structured as records, where each record contains fields about the same object.

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

What are the three primary data problems associated with file-based systems?

A
  1. Duplicate data (redundancy).
  2. Format inconsistency.
  3. Inconsistent data across different files.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Why is “Storage Wastage” a limitation of file-based systems?

A

Duplicated data across multiple files wastes storage space and increases data redundancy.

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

What is “Data Independence” in a relational database?

A

The ability to perform diverse queries without being limited by the specific structure of the data or the software.

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

How does a relational database handle data updates differently than a file-based system?

A

Data changes are instantly available across all applications because information is stored only once, ensuring consistency.

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

List the three main functions of a database management system.

A
  1. Adding new files.
  2. Inserting/retrieving/updating data.
  3. Cross-referencing data for analysis.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Section 3: Database Keys

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

What is a Candidate Key?

A

The smallest set of attributes that can uniquely identify a record without duplication.

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

How does a Candidate Key differ from a Primary Key in theoretical terms?

A

A candidate key is any attribute or set of attributes that could uniquely identify a record; the primary key is the specific candidate key selected by the designer to perform that role.

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

What is a Primary Key?

A

A unique identifier for a table selected from the available candidate keys.

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

Define a Secondary Key.

A

An alternative unique identifier used for accessing records.

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

What is the theoretical role of a Secondary Key?

A

It serves as an alternative identifier for a record, used primarily to provide a different path for searching or indexing data without replacing the primary key.

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

What is a Foreign Key?

A

An attribute or set of attributes that links records in one table to the primary key of another table.

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

What is a Composite Key?

A

A primary key consisting of a set of two or more attributes that together provide a unique identifier for a record.

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

What defines a “Composite Key” in a relational structure?

A

A set of attributes that, when combined, provide a unique identifier for a table that cannot be uniquely identified by a single attribute alone.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Section 4: Referential Integrity and Data Logic
26
What is "Referential Integrity"?
A concept ensuring that table relationships remain consistent; every foreign key value must match a primary key value in the referenced table.
27
What is the theoretical purpose of Referential Integrity?
To ensure that the "links" between tables remain valid, meaning every value in a foreign key column must have a corresponding, matching value in the primary key column of the related table.
28
What is the rule regarding the deletion of a primary key in a relational database?
A primary key cannot be deleted if there are dependent records in other tables, unless a "cascading delete" is performed.
29
Define the concept of "Cascading Deletes" in data integrity.
A rule stating that a primary key record cannot be deleted until all dependent records (those referencing it via a foreign key) are deleted first to prevent orphaned data.
30
Define the concept of "Cascading Updates" in data integrity.
A rule ensuring that if a primary key value is changed, all corresponding foreign key values in related tables are automatically updated to maintain the relationship.
31
Section 5: Entity-Relationship (E-R) Modeling
32
What is the primary purpose of an E-R Diagram?
To provide a visual representation of database entities and the relationships between them.
33
When designing an E-R diagram, what is the first step?
Identifying the entities, which are typically the "nouns" within the requirements.
34
Why is identifying "Nouns" the standard method for choosing entities?
Because entities represent objects, people, or events that exist independently and about which specific attributes (data) can be stored.
35
Define a One-to-One (1:1) relationship.
Each record in the first table corresponds to exactly one record in the second table.
36
Define a One-to-Many (1:M) relationship.
One record in the first table connects to multiple records in the second table.
37
Define a Many-to-Many (M:M) relationship.
Multiple records in the first table relate to multiple records in the second table.
38
How is a "Many-to-Many" (M:M) relationship theoretically resolved in database design?
By introducing a third "link" or "junction" table that converts the M:M relationship into two separate "One-to-Many" (1:M) relationships.
39
Define "Cardinality" in the context of E-R Diagrams.
It defines the nature of the relationship between entities, indicating how many instances of one entity relate to another.
40
What does "Cardinality" describe in an Entity-Relationship model?
It defines the nature and numerical obligation of a relationship, specifying the minimum and maximum number of times an instance in one entity can relate to an instance in another.
41
What characterizes a "Mandatory Relationship"?
A relationship where each instance of an entity must relate to at least one instance of another entity.
42
What characterizes an "Optional Relationship"?
A relationship where an instance of an entity does not necessarily need a corresponding instance in the related entity.
43
What is the difference between a "Forward" and "Backward" reading of an E-R relationship?
A relationship always considers just one entity to begin a descriptive sentence (e.g., "One Band is booked for many Bookings"), and the "backward" reading describes it from the perspective of the other entity (e.g., "One Booking is for many Bands").
44
Section 6: Normalization
45
What is "Normalization"?
A design technique for constructing or improving table designs to efficiently organize data.
46
List the three main objectives of the normalization process.
1. Eliminating redundancy. 2. Ensuring data is stored in the correct table. 3. Eliminating the need for frequent database restructuring.
47
What is the theoretical definition of "Repeating Groups" in a non-normalized table?
A repeating group occurs when a single attribute or a set of attributes contains multiple data values for a single instance of an entity.
48
What defines a table in First Normal Form (1NF)?
A table that contains no repeating groups of attributes and where all data items are atomic.
49
What are the two mandatory conditions for a table to satisfy First Normal Form (1NF)?
1. It must contain no repeating groups of attributes. 2. Every attribute value must be atomic, meaning it cannot be divided further into multiple data items.
50
What does it mean for data to be "Atomic"?
Each field contains only a single value, and there are no multiple data items stored under one attribute.
51
What is "Partial Dependency"?
When a non-key attribute is dependent on only one part of a composite primary key rather than the whole key.
52
Theoretically, how is a 1NF table converted into Second Normal Form (2NF)?
By removing all "partial dependencies," which occur when a non-key attribute is dependent on only part of a composite primary key rather than the entire key.
53
What defines a table in Second Normal Form (2NF)?
A table that is in 1NF and contains no partial dependencies; all non-key attributes depend entirely on the primary key.
54
What are the specific characteristics of a table that has reached 2NF?
The table must already be in 1NF and must either have a single-attribute primary key or a composite primary key where every non-key attribute is dependent on every part of that key.
55
What is "Non-key Dependency" (or Transitive Dependency)?
When a non-key attribute depends on another non-key attribute rather than directly on the primary key.
56
What is the definition of "Transitive Dependency" (Non-key Dependency) in the context of 3NF?
It is a situation where a non-key attribute depends on another non-key attribute instead of being directly dependent on the primary key.
57
What defines a table in Third Normal Form (3NF)?
A table that is in 2NF and has no non-key dependencies; all attributes are dependent "on the key, the whole key, and nothing but the key".
58
What is the "Normalization Litany" used to summarize Third Normal Form (3NF)?
Every non-key attribute must be dependent on "the key, the whole key, and nothing but the key".
59
How are many-to-many (M:M) relationships usually handled during normalization?
They are typically resolved by creating a link table (often using a composite key) to break the M:M relationship into two 1:M relationships.
60
Explain why a file-based approach is usually not better than a relational database (Bobby is incorrect).
1. Flat-file has more data redundancy: the same data is stored many times. 2. There is program-data dependence with flat-files: any changes to the structure of the data means the programs that access that data have to be re-written. 3. Flat-file has more data inconsistency // worse data integrity: duplicated data might be stored differently; when data is updated in one place, it is not updated everywhere. 4. It is not easy to perform complex searches/queries: a new program has to be written each time. 5. Flat files could have a lack of privacy: user views cannot easily be implemented.
61
Describe the advantages of using a relational database compared to a file-based approach.
1. Reduced data redundancy // less repeated data: each item of data is only stored once. 2. Maintains data consistency // improves data integrity: changes in one table will automatically update in another; linked data cannot be entered differently in two tables. 3. Program-data independence: changes to the data do not require programs to be re-written. 4. Complex queries are easier to run. 5. Can provide different views: so users can only see specific aspects of the database.