Chapter 8 (Section 1) Final Revision #1
No description yet. This curated deck is ready for daily study.
Card preview (24)
Section 1: Database Fundamentals
What is the definition of a database?
A structured collection of data items that are accessible by various applications.
What is a relational database?
A database that links data items together via the use of internal pointers, where data is stored in different tables which are linked using primary and foreign keys.
In a database context, what is a table?
A group of similar data organized into rows (for entities) and columns (for attributes).
Define a “Record” or “Tuple.”
A row in a table that represents a single instance of an entity.
Define a “Field” or “Attribute.”
A column/attribute in a table representing a specific data item or characteristic stored about an entity.
What is an “Entity”?
Anything about which data can be stored, such as a person, event, or object.
What is the purpose of “Indexing” in a database?
To optimize search operations by creating a structure for fast data retrieval based on specific columns.
Section 2: File-Based vs. Relational Approach
How is a file-based system defined?
A collection of data items structured as records, where each record contains fields about the same object.
What are the three primary data problems associated with file-based systems?
• Duplicate data (redundancy). • Format inconsistency. • Inconsistent data across different files.
Why is “Storage Wastage” a limitation of file-based systems?
Duplicated data across multiple files wastes storage space and increases data redundancy.
Explain the limitations of a file-based approach (why a file-based approach is not better than a relational database).
• Flat-file has more data redundancy: the same data is stored many times (in relational, data is stored in different tables which are linked). • 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. • 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. • It is not easy to perform complex searches/queries: a new program has to be written each time. • Flat files could have a lack of privacy: user views cannot easily be implemented.
Describe the advantages of using a relational database compared to a file-based approach.
• Reduced data redundancy // less repeated data: each item of data is only stored once because linked tables mean each data item is stored only once. • Maintains data consistency // improves data integrity: changes in one table will automatically update in another; linked data cannot be entered differently in two tables; only needs to be updated once. • Program-data independence: the data is separate from the software, so changes to the data do not require programs to be re-written. • Complex queries are easier to run. • Can provide different views: so users can only see specific aspects of the database.
What is “Data Independence” in a relational database?
The ability to perform diverse queries without being limited by the specific structure of the data or the software; data is separate from the software so structural changes do not require programs to be re-written.
How does a relational database handle data updates differently than a file-based system?
Data changes are instantly available across all applications because information is stored only once, ensuring consistency.
List the three main functions of a database management system.
• Adding new files. • Inserting/retrieving/updating data. • Cross-referencing data for analysis.
Section 3: Database Keys
What is a Candidate Key?
An attribute/field (or set of attributes/fields) that could be a primary key — the smallest set of attributes that can uniquely identify a record without duplication.
How does a Candidate Key differ from a Primary Key in theoretical terms?
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.
What is a Primary Key?
A unique identifier for a table selected from the available candidate keys.
Define a Secondary Key.
An alternative unique identifier used for accessing records.
What is the theoretical role of a Secondary Key?
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.
What is a Foreign Key?
A field/attribute in one table that is linked to a Primary Key in another table; it links records in one table to the primary key of another table.