Fundamentals of RDBMS
- In RDBMS, a table(Relation) organizes data into rows and columns.
- The columns are known as attributes.
- The rows are known as records/tuples.
- Consider the Student Table here. student-id, name, city and age are the attributes.
- Student table is a relation.
- Formally relation is a set of tuples.
- Which means no duplicate tuple is allowed.
- Each table has a unique primary key that identifies the information in a table.

Relationship
- The relationship between tables can be set via the use of foreign keys.
- A field in a table that links to the primary key of another table is what is known as a Foreign Key.
- Here Student table and Course table are brought into the Enrollment table.
- For each student, the course he took and the marks that he obtained are included in the Enrollment table.
- Student-id is the primary key of the Student table.
- Course-id is the primary key of the Course table.
- Student-id and Course-id columns from ‘Enrolment Table’ are foreign keys. (Both becomes foreign keys for the enrollment table.)
- When put together, Student-id and Course-id will form the primary key of the Enrollment table.

yellow - primary key
red - foreign key
Index ⚡
One important feature that is required by a DBMS is the ability to fetch a record faster. Indexes support that feature.
- Index.
- Indexing is used to optimize the performance of a database by minimizing the number of disk accesses.
- The index is a type of data structure.
- It is used to locate and access the data in a database table quickly.