Notifications

Log in to see your notifications.

Tables and data entry is taught in the note for Databases. Read it below and look for the section on this topic.

Databases

14 min read

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.

Two linked tables in a databaseA database stores data in tables made of rows called records and columns called fields. The Students table has a primary key, StudentID, that is unique for each record. The Marks table uses StudentID as a foreign key to link each mark to a student. A query can then combine the two tables.StudentsStudentIDNameForm1Amina22Juma3MarksStudentIDSubjectMark1Maths782Maths64linkprimary key: StudentIDforeign key: StudentID
TermMeaningExample
TableA set of data about one subject, in rows and columnsStudents
RecordOne row: all the data about one itemAmina, Form 2
FieldOne column: one kind of informationName
Primary keyA field that is different for every recordStudentID
Foreign keyA field that links to the primary key of another tableStudentID 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.

ObjectPurpose
TableStores the data
QueryFinds and calculates
FormEnters and views data
ReportPrints summarised data
Try itHow much data?

Choose the number of records and the size of a record in bytes.

Check yourself A row in a table is called a
Check yourself A field that is different for every record is a
Check yourself A printed summary of data is a

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.