What is a database?

A database is a collection of data organised in a way that makes it easy for a computer program to search and store information. You can think of it like an electronic filing system.

Where are databases used?

Databases are used in many different settings, for different purposes. A social network will use a database to store information about you, your friends, places you have visited or posts you have liked. Libraries will use databases to keep track of which books are available and which are out on loan.

Database concepts

A database is a persistent, organised store of data, meaning it will exist even when the power is off or the system has a failure.

Organisation of data

Data is organised into a table structure. A table is a collection of records, with each record stored as a row. Each record is a collection of information called attributes or fields.

The table below has five records. Each record has six attributes. Customer ID is a primary key.

Customer IDFirst nameLast nameGenderAddressTown/city
C0AliceAndersonF13 Monk WayLisburn
C1BobBuchannonM14b Iris StreetBelfast
C2ConorCrawleyM17 Eblana StreetArmagh
C3DavinaDevlinF53 Fitzwilliam StNewry
C4EdwardEllisonM42 Park ViewEnniskillen

Each record must be uniquely identified in order to access individual record details. A primary key is a unique value used to identify each record in a database. This could be a Customer ID in a shop database or a patient ID in a doctor's surgery.