## Want to keep learning?

This content is taken from the Raspberry Pi Foundation & National Centre for Computing Education's online course, Introduction to Databases and SQL. Join the course to learn more.
1.5

# The make-up of a database

It is important to understand some basic database concepts before you start exploring your computer sales database. In this step, you will be introduced to these, and also to the different data types you’ll be using.

### Key terminology

A table is the name for a collection of associated data stored within a database; each table consists of columns and rows.

Your computer sales database contains three tables: manufacturer, model, and sales.

The characteristics of each table are known as fields.

If you are using DB Browser

Click on the arrow next to the manufacturer table in the Database Structure tab. The fields for the manufacturer table will appear:

If you are using SQLite Online

Click on the arrow next to the manufacturer table name. Then click in the arrow next to Column. The fields for the manufacturer table will appear:

The fields within the manufacturer table are: manufacturer_id, name, url, year_founded, and trading.

A record, also known as a row, is an individual entry that exists in a table. Each record contains data that relates to each field.

You saw the records when you browsed the tables in the previous step.

DB Browser

SQLite Online

You can see the records that are stored in the manufacturer table. The table below shows the first record in the manufacturer table:

Field name Data
manufacturer_id 1
name Raspberry Pi
url https://raspberrypi.org
year_founded 2008

### Data types

Each field has properties that can be used to describe the characteristics of the data that will be added to it. The data type property determines what type of data the field can store.

In DB Browser the data types are shown next to the field names in the Database Structure.

In SQLite Online, hover your mouse cursor over each field name to reveal the data type.

The following data types are used in your computer sales database:

Data type Description Example in your computer sales database
Text Contains letters, numbers, and symbols manufacturer name
Integer A whole number manufacturer_id
Date A date in the following format: YYYY-MM-DD. year_founded
Boolean One of two possible values (1 and 0) trading
Real A number that can have up to seven digits to the right of a decimal point cpu_speed

That was a lot of terminology! The table below recaps what you have covered.

Key term Definition
Database Management System (DBMS) Software that can find data, add new data, and change existing data in a database; it deals with finding and updating the requested data
Table A group of similar data with rows for records and columns for each field
Record A collection of items, which may be different data types, all relating to the individual or object the record describes
Field Stores a single particular unit of data for each record
Properties Each field will have properties that describe the characteristics of the field, such as the length and data type
Data type Defines what type of data is used in the field

### Questions

1. What other fields could be added to the model table? What data type would they each have?
2. What other fields could be added to the manufacturer table? What data type would they each have?