Relational Databases
What is a Relational Database?
A relational database organizes data into structured tables (relations) consisting
of rows and columns. Each table represents an entity, and relationships between
tables are established through keys. Relational databases are highly efficient for
handling structured data and ensuring data integrity.
Key Concepts in Rlational Databases
1. Tables (Relations):
o The fundamental unit where data is stored.
o Columns (Attributes): Define the type of data (e.g., Name, Age).
o Rows (Tuples): Represent individual records (e.g., John, 25).
2. Primary Key:
o A unique identifier for each row in a table (e.g., ID).
3. Foreign Key:
o A column in one table that references the primary key of another
table to establish a relationship.
4. Relationships:
o One-to-One: One record in Table A corresponds to one record in
Table B.
o One-to-Many: One record in Table A corresponds to multiple records
in Table B.
o Many-to-Many: Multiple records in Table A correspond to multiple
records in Table B.
5. Schema:
o The structure that defines tables, columns, data types, and
relationships.
6. ACID Properties:
o Ensure reliable transactions:
Atomicity: All or nothing.
What is a Relational Database?
A relational database organizes data into structured tables (relations) consisting
of rows and columns. Each table represents an entity, and relationships between
tables are established through keys. Relational databases are highly efficient for
handling structured data and ensuring data integrity.
Key Concepts in Rlational Databases
1. Tables (Relations):
o The fundamental unit where data is stored.
o Columns (Attributes): Define the type of data (e.g., Name, Age).
o Rows (Tuples): Represent individual records (e.g., John, 25).
2. Primary Key:
o A unique identifier for each row in a table (e.g., ID).
3. Foreign Key:
o A column in one table that references the primary key of another
table to establish a relationship.
4. Relationships:
o One-to-One: One record in Table A corresponds to one record in
Table B.
o One-to-Many: One record in Table A corresponds to multiple records
in Table B.
o Many-to-Many: Multiple records in Table A correspond to multiple
records in Table B.
5. Schema:
o The structure that defines tables, columns, data types, and
relationships.
6. ACID Properties:
o Ensure reliable transactions:
Atomicity: All or nothing.