Databases and SQL
GCSE Computer Science · AQA 3.7 Relational databases and structured query language (SQL)
Relational databases
- Table (entity), record (row), field (column). Primary key uniquely identifies a record; foreign key links to another table's primary key.
- Linked tables reduce data redundancy and inconsistency.
SQL
SELECT name, age FROM Students WHERE age > 15 ORDER BY name ASC
- INSERT INTO table (fields) VALUES (...); UPDATE table SET field = value WHERE ...; DELETE FROM table WHERE ...
- Use two tables with WHERE Table1.key = Table2.key to combine data.
Key terms and facts
- Database
- Organised store of data
- Table
- Data about one type of thing
- Record
- One row in a table
- Field
- One column in a table
- Primary key
- Field that uniquely identifies a record
- Foreign key
- Primary key from another table
- Relational database
- Tables linked by keys
- Data redundancy
- Same data stored more than once
- Data inconsistency
- Copies of data that don't match
- SQL SELECT
- Chooses which fields to show
- SQL FROM
- Chooses the table
- SQL WHERE
- Filters records
Practise databases and sql
← All GCSE Computer Science topics · Open GCSE Computer Science in StudySam