Loading subject…
| Feature | What it is | Example |
|---|---|---|
| Table | One entity type, stored as rows and columns | Customer table |
| Primary key | A column whose value is unique in every row | Customer.CustomerID |
| Foreign key | A column holding a primary key value from another table | Order.CustomerID |
| Composite key | A primary key made of two or more columns | Enrolment(StudentID, CourseID) |
| Relationship | The link a foreign key creates between two tables | One customer has many orders |
Tables
Tables are the core structure of a relational database, where data is organized into rows and columns.
Primary key
A primary key is a unique identifier for each record in a table.
Foreign key
A foreign key is a column (or set of columns) in one table that references the primary key of another table.
Composite key
A composite key is a primary key that consists of two or more columns.
Relationships
Relationships define how tables are connected in a relational database.