Database
Database
The data can include text, numbers, pictures; anything that can
be stored in a computer.
Why are
databases
useful?
Why are
databases useful?
Databases prevent problems occurring because:
» if any changes or additions are made it only has to be done once – data is consistent
» data is only stored once in relational databases which means no data duplication.
What are databases used for?
What are databases used for?
To store information about people, for instance:
» patients in a hospital
» pupils at a school.
» cars to be sold
» books in a library.
» hotel bookings
» results of races.
Fields and Records
Inside a database, data is stored in tables, which consists of many records. Each record consists of several fields.
The number of records in a table will vary as new records can be added and deleted from a table as required.
The number of fields in a table is fixed so each record contains the same number of fields.
Each record is a row in the table and each field is a column in the table.
What is a data type?
Primary keys
As each record within a table contains data about a single item, person, or
event, it is important to be able to uniquely identify this item.
In order to reliably identify an item from the data stored about it in a record
there needs to be a field that uniquely identifies the item. This field is called the
primary key.
SQL (Structured Query Language)
Example
Example