Whodunnit - Databases

Learn about the features of databases and how to use them.

What is a database?

An organized collection of information, typically stored electronically in a computer system.

Wherever you collect and store information in an organised way, you have a database. Before computers, data might have been collected on cards or on organised pages in a book. Computers make storing information much easier, but they also make finding and using that data much easier as well.

Data can be sorted so that e.g. a class register is put into alphabetical order of first name or date order of birth date.

Data can be filtered so that e.g. a class register only shows the children born in August.

Table layout

Data is often presented in a table with columns and rows.

Data is often displayed in a table:
Rows - each row represents a record, in this case a suspect
Columns - each columns represents a field (or attribute), such as name or hair colour.

You can create a table with a spreadsheet such as Google Sheets or Excel. There is a copy button at the top of the suspects data page. Copy the data and paste it into cell A1 on your sheet. Using the spreadsheet, you are also able to filter the records to e.g. only show records with 'brown' in the hair column.

There are different types of fields in a database. These are the main types:
Text - searchable for matching strings (a series of letters)
Number - searchable using = , < and >
Boolean - such as checkboxes, can have one of only two values: TRUE or FALSE

Mailmerge

Data can be merged with with documents to provide e.g. personalised emails.

Mail merge is a way of using a database (a table of information) to create many documents automatically. Instead of writing the same thing again and again, you create one template, and the computer fills in the details for each person (or each suspect).

Think of it like this: you design a “blank” card that has spaces for information such as Name, Age, Hair, and Photo. The mail merge then uses the database to make one finished card for every record in the table.

Mail merge is often used for:

  • Letters & Emails (for example, an email to every parent with their child’s name included)
  • Certificates (same design, different names)
  • Labels (address labels for many people)
  • Cards (like Top Trumps style cards based on a table of data)
Click the button above to design a layout and then create a full set of trading cards using data from a table.

Relational Databases

Multiple linked tables.

If we wanted to show the flag of each nationality in our suspects table, we would have to repeat the British flag 31 times. Instead, we could create a second table called Countries. This table would store each country once, along with its flag.

Our suspects table would then store only the country name (or country ID). The database would automatically look up the correct flag in the Countries table and display it. We now only need to add the British flag once, rather than 31 times.

This is called a relational database. It is relational because the tables are linked together using shared values. In this example, the relationship is many-to-one, because many suspects can have one country.


Now go to the next page to solve the crimes.