Databases
A database is an organised collection of data stored so that it can be found, changed and used easily. A database management system (DBMS) such as Microsoft Access, MySQL or LibreOffice Base is the program that manages it. Examples: school records, a library catalogue, a hospital’s patient files, a shop’s stock list.
| Term | Meaning | Example |
|---|---|---|
| Table | A set of data about one subject, in rows and columns | Students |
| Record | One row: all the data about one item | Amina, Form 2 |
| Field | One column: one kind of information | Name |
| Primary key | A field that is different for every record | StudentID |
| Foreign key | A field that links to the primary key of another table | StudentID in Marks |
Tables and data entry
When designing a table choose a field name and a data type for each field: Text, Number, Date/Time, Currency, Yes/No. Set a primary key and field properties (size, format, a default value and a validation rule). Enter data by typing in datasheet view.
Queries
A query asks the database a question. It can select records that meet a condition (Form = 2 AND Mark > 50), sort them, calculate totals and combine fields from several tables. In SQL: SELECT Name FROM Students WHERE Form = 2;
Forms and reports
A form is a friendly screen for entering and viewing data one record at a time. A report is a formatted printout of data from tables or queries, with groups, totals and titles.
| Object | Purpose |
|---|---|
| Table | Stores the data |
| Query | Finds and calculates |
| Form | Enters and views data |
| Report | Prints summarised data |
Choose the number of records and the size of a record in bytes.
Key terms
- Database
- An organised collection of data.
- Record
- A row of data about one item.
- Field
- A column of one type of data.
- Query
- A question asked of the database.
Summary
- A database stores data in tables of records and fields.
- A primary key identifies each record.
- Queries find data, forms enter it and reports print it.
- Choose a data type for every field.