RDBMS Fundamentals Flashcards
What is an RDBMS? Tables, rows, columns Primary key, foreign key, composite key Constraints: NOT NULL, UNIQUE, CHECK, DEFAULT Relationships: One-to-One, One-to-Many, Many-to-Many Normalization: 1NF, 2NF, 3NF, BCNF Denormalization and its trade-offs (42 cards)
What is an RDBMS?
A Relational Database Management System stores data in structured formats using tables with rows and columns.
What are tables in RDBMS?
Tables are collections of related data organized in rows and columns.
What is a row in a table?
A row represents a single record or entry in a table.
What is a column in a table?
A column defines a specific attribute or field in the table, such as name or age.
What is a primary key?
A primary key uniquely identifies each row in a table and cannot contain NULL values.
What is a foreign key?
A foreign key links a column in one table to the primary key of another table to establish relationships.
What is a composite key?
A composite key is a combination of two or more columns used together to uniquely identify a row.
What is a NOT NULL constraint?
Ensures a column cannot have NULL values.
What is a UNIQUE constraint?
Ensures all values in a column are different.
What is a CHECK constraint?
Ensures that all values in a column satisfy a specific condition.
What is a DEFAULT constraint?
Provides a default value for a column when none is specified.
What is a One-to-One relationship?
Each row in Table A is linked to one and only one row in Table B.
What is a One-to-Many relationship?
A row in Table A can be linked to multiple rows in Table B.
What is a Many-to-Many relationship?
Rows in Table A can be linked to multiple rows in Table B and vice versa, usually via a join table.
What is normalization?
The process of organizing data to reduce redundancy and improve data integrity.
What is First Normal Form (1NF)?
A table is in 1NF if it contains only atomic values and each column contains values of a single type.
What is Second Normal Form (2NF)?
A table is in 2NF if it is in 1NF and all non-key attributes are fully dependent on the primary key.
What is Third Normal Form (3NF)?
A table is in 3NF if it is in 2NF and all its attributes are not transitively dependent on the primary key.
What is BCNF?
Boyce-Codd Normal Form is a stronger version of 3NF where every determinant is a candidate key.
What is denormalization?
The process of merging normalized tables to improve read performance at the cost of redundancy.
What are the advantages of normalization?
Reduces redundancy, improves data integrity, and simplifies data maintenance.
What are the disadvantages of normalization?
Can result in complex queries and slower read performance due to multiple joins.
What are the advantages of denormalization?
Improves query performance by reducing joins.
What are the disadvantages of denormalization?
Can lead to data redundancy and update anomalies.