What is a record in a database table?
Based on: AQA 8525 · 3.7.1
Section 3.7 is short and precise. It covers what a relational database is and why it helps to eliminate redundancy and inconsistency, and writing SQL that does exactly what was asked, using the field names exactly as printed. Precision is the whole game here.
What is a record in a database table?
Based on: AQA 8525 · 3.7.1
What does SELECT * FROM Members do?
Based on: AQA 8525 · 3.7.2
What must be true of a primary key?
Based on: AQA 8525 · 3.7.1
What is a foreign key?
Based on: AQA 8525 · 3.7.1
A relational database stores data in several linked tables, each about one kind of thing, so each fact can be stored once and every table can refer to it through keys. That helps to eliminate data redundancy and data inconsistency, because a fact is updated in one place instead of in every copy.
A table holds records, which are the rows. Each record holds fields, which are the columns, and every field has a data type. A primary key is a field that uniquely identifies each record in a table. It cannot be empty and cannot repeat, which is why a surname is a bad primary key and an ID number is a good one. A foreign key is a field in one table that holds the primary key of another table. That is what links the two. For example, one customer can have many orders, so the order table carries a customer ID as a foreign key.
SQL is the language used to retrieve, insert, edit and delete data in a relational database. SELECT chooses which fields to return. FROM says which table they come from. WHERE filters which records. ORDER BY sorts the results, with ASC for ascending or DESC for descending. SELECT * FROM Members returns every field of every record. Naming the fields instead returns only those fields. WHERE conditions use the relational operators and can be combined with AND, OR and NOT. Text values go in quotes and numbers do not, as in WHERE Surname = 'Patel' AND Age > 15.
INSERT INTO adds a new record. You give the table, the fields and the values in matching order. UPDATE changes existing records, and its WHERE clause picks which records change; without WHERE, every record in the table would change. DELETE FROM removes records, again using WHERE to pick which ones, for the same reason. When a question gives you a table structure, read the field names exactly as printed and use them exactly.
| Primary key | Foreign key |
|---|---|
| Uniquely identifies each record in its own table. | Holds the primary key of another table. |
| Cannot be empty and cannot repeat. | Can repeat, because many records may point at the same record elsewhere. |
| An ID number is a good choice. A surname is not. | In a one to many relationship it sits in the many table. |
| Uniquely identifies each record in its table. | Creates the link between two tables. |
Data is split into separate tables that are linked by keys, so a fact such as a customer's address can be stored in one place and referred to, rather than copied. Used this way, a relational database helps to eliminate data redundancy and data inconsistency.
Two people can share a surname, so it is not unique, and surnames can change. A primary key must identify exactly one record and never be empty.
The many table in a one to many relationship. One customer has many orders, so the order table carries the customer ID.
Every record in the table is changed. The same is true of DELETE FROM without WHERE, which removes every record.
Yes. Text goes in quotes and numbers do not, as in WHERE Surname = 'Patel' AND Age > 15.
RiverMap Learning apps are independent study tools. They are not affiliated with, endorsed by, or connected to any government body or examination authority. Question content is original and based on publicly available official study materials.