Relational databases Flashcards
What is a relational database?
A database that stores data in tables with rows as data records (entities) and columns as data attributes (properties).
How is data organized in a relational database?
Data is split into multiple tables connected by primary and foreign keys.
Why is relational database structure preferred over flat files?
Because it separates information into logical tables and uses relationships, making data easier to manage, update, and query.
What does each table in a relational database typically represent?
Each table represents a single informational theme or business concept.
What rule applies to attribute dependency in relational databases?
All attributes must depend only on the primary key.
Why is it important that attributes depend only on the primary key?
To ensure data integrity and avoid redundancy or anomalies.
What happens if a table has attributes that depend on something other than the primary key?
It can lead to data anomalies like update, insertion, or deletion anomalies.
What is a Relational Database Management System (RDBMS)?
Software that allows users to interact with and operate a relational database.
Why is an RDBMS like an operating system for the database?
Because it interprets user queries and commands to perform operations on the database.
Give examples of operations performed by an RDBMS.
Database design, construction, data manipulation, and reporting.
Why is an RDBMS essential for relational databases?
Because it provides tools to manage, secure, and query the data efficiently.
What is involved in database design?
Planning the structure and organization of the database tables and relationships.
What is involved in database construction?
The actual creation of the database and populating it with data.
What is data manipulation in relational databases?
Operations like inserting, updating, deleting, and querying data.
What is reporting in relational databases?
Summarizing and representing data for analysis and decision-making.
What programming language is used to interact with relational databases?
SQL (Structured Query Language).
Why is SQL important in relational databases?
Because it provides the commands to create, manage, and query the database.
If you need to connect two tables of customers and orders, what should you use?
Primary and foreign keys.
If you have multiple tables with similar data points, how do you avoid redundancy?
Design each table for a single informational theme and use keys to relate them.
What happens if you skip setting a primary key in a table?
The table may allow duplicate or null values, risking data integrity issues.
How does an RDBMS handle data manipulation commands?
It interprets and executes them to update the database accordingly.
Spot the mistake: ‘In relational databases, attributes should depend on multiple keys.’
Incorrect. Attributes should depend only on the primary key.
Spot the mistake: ‘An RDBMS is optional for relational databases.’
Incorrect. An RDBMS is essential to interact with and manage the relational database.
Explain in your own words the role of a foreign key.
A foreign key links two tables together by referencing the primary key of another table, maintaining referential integrity.
Explain why relational databases avoid data duplication.
By splitting data into multiple tables and using relationships, relational databases maintain data integrity and avoid duplication.
Describe the relationship between SQL and an RDBMS.
SQL is the language used to communicate with the RDBMS, which then performs operations on the database.
If you design tables poorly without primary keys, what risks arise?
Data duplication, integrity issues, and anomalies during data operations.