A flat file stores all data in a single table (e.g. a spreadsheet). Problems with flat files:
A relational database splits data into multiple related tables — eliminating redundancy and these anomalies.
| Term | Definition | Example |
|---|---|---|
| Entity | A real-world object or concept about which data is stored | Student, Course, Teacher |
| Attribute | A property or characteristic of an entity | StudentID, FirstName, DOB |
| Table (relation) | A structured set of rows and columns storing data about one entity | Student table |
| Field (column) | One attribute in a table | FirstName column |
| Record (row/tuple) | One instance of an entity — a complete row of data | One student's data |
| Primary key | Unique identifier for each record in a table — must be unique and not null | StudentID |
| Foreign key | A field in one table that is the primary key of another — creates a link | CourseID in Student table links to Course table |
| Composite key | A primary key made from two or more fields combined | StudentID + CourseID in an Enrolment table |
ERDs show the relationships between entities. Three types of relationship:
| Relationship | Symbol | Example |
|---|---|---|
| One-to-one (1:1) | Each entity has at most one related entity | Person ↔ Passport (one person has one passport) |
| One-to-many (1:M) | One entity relates to many of another | Customer → Orders (one customer makes many orders) |
| Many-to-many (M:M) | Many of each entity can relate to many of the other | Student ↔ Course (student takes many courses; course has many students) |
Resolving many-to-many: Create a link/junction table with a composite key of both primary keys. E.g. StudentID + CourseID in Enrolment table.
A DBMS is software that manages access to a database. Functions:
Examples of DBMS: MySQL, PostgreSQL, Microsoft SQL Server, Oracle, SQLite.
8 questions · instantly marked · AQA 7517 standard
| Term | Definition |
|---|
10 questions · 10 minutes