The relational model (proposed by Edgar Codd, 1970) organises data into relations (tables). Each table has:
| Data type | Description | Example |
|---|---|---|
| INTEGER / INT | Whole number | Age: 17 |
| FLOAT / REAL | Decimal number | Price: 9.99 |
| VARCHAR(n) | Variable-length text up to n characters | Name: 'Smith' |
| CHAR(n) | Fixed-length text, exactly n characters | Gender: 'M' |
| DATE | Calendar date | DOB: 2005-03-14 |
| BOOLEAN | True or false | IsActive: TRUE |
| TEXT | Long-form text (no set limit) | Description |
Referential integrity: every foreign key value must match an existing primary key in the related table — or be null (if the relationship is optional). The DBMS enforces this automatically.
Violations of referential integrity:
ON DELETE CASCADE: if a parent record is deleted, all child records referencing it are automatically deleted.
ON DELETE SET NULL: if a parent record is deleted, child foreign keys are set to NULL.
| Constraint | Meaning |
|---|---|
| PRIMARY KEY | Unique identifier — automatically NOT NULL and UNIQUE |
| FOREIGN KEY | Must match a primary key in referenced table (referential integrity) |
| NOT NULL | Field must have a value — cannot be empty |
| UNIQUE | All values in the column must be different |
| CHECK | Value must satisfy a condition (e.g. Age >= 16) |
| DEFAULT | Provides a default value if none is supplied |
Validation: checking data is reasonable and meets defined rules (type check, range check, format check, presence check). Done by software automatically.
Verification: checking data was entered correctly — done by humans (double entry, proofreading).
Tables: Student(StudentID PK, FirstName, LastName, DOB, TutorGroupID FK) — TutorGroup(TutorGroupID PK, RoomNumber, TeacherID FK) — Teacher(TeacherID PK, TeacherName) — Enrolment(StudentID FK, CourseID FK — composite PK) — Course(CourseID PK, CourseName, TeacherID FK)
8 questions · instantly marked · AQA 7517 standard
| Term | Definition |
|---|
10 questions · 10 minutes