What is a relational database? #
A relational database is a type of database that stores and organises data with defined relationships, enabling users to identify and access data in relation to another piece of data.
Relational databases, which were introduced in the 1970s, are still the most widely-used model within many organisations, mainly due to their simplicity, data accuracy and integrity.
These databases are typically used for applications that require complex queries and transactions, such as financial systems and eCommerce platforms.
How does a relational database work? #
A relational database organises data into rows and columns, to collectively form a table – similar to a spreadsheet. A database management system (DBMS) then enables users to input, arrange, edit, delete or select these data fields, records and tables in the database.
A table consists of multiple rows (records) which, in turn, are made up of multiple columns (fields). A record is therefore the row of the database, which includes all the combined fields, which are unique to that that row.
Relational database schema #
Databases tend to store a large number of records, with only a small number of fields.
A database field is a specific piece of data, such as surname, telephone number or first line address, which combined together make a record. Some databases also allow fields to store images, complete files or links to these items.
An example would be a customer’s record:
Surname | First Name | Address | City | Postcode | Telephone | Email
For example, a manufacturer’s database may contain the following records and fields:
- Supplier data (company name, address, type of account etc.)
- Product data (price, size, weight, colour, inventory etc.)
- Customer data (name, address, telephone etc.)
The tables are joined together via data points which identify the different relationships between the tables and the stored items of business data and information contained within them.
Users or applications are then able to query the structured tables via SQL queries to combine different data points to help produce business performance information and reports, such as monthly sales figures, finance projections, inventory and account statements.
A relational database is the most efficient and flexible way to access structured information, and often used when connected data needs to be stored and retrieved with minimal system logic.
Relational database vs non-relational database #
Whilst relational databases store data in tables with pre-defined relationships between them, non-relational databases, also known as NoSQL databases, store data in a more flexible and dynamic way, without pre-defined relationships between data elements.
They are designed to handle large volumes of unstructured or semi-structured data, such as social media content, sensor data and documents. NoSQL databases can be categorised into several types, including document-oriented databases, key-value stores, graph databases, and column-family databases.
However, non-relational databases may not be ideal for applications that require complex querying and relational data modelling. Additionally, they may require more effort to maintain and manage due to their lack of pre-defined schema and relationships.
Relational database examples #
Popular examples of relational databases include: