What Is a Database? Tables, SQL and Types of Database
The products in an online shop, the accounts at a bank, the users of an app. They all live in a database.
A database is a system where information is stored in an organised way so it can be found and updated quickly. Most apps work with a database in the background.
How is it different from a spreadsheet?
A spreadsheet file is fine for small lists. But as data grows and many people or apps start using it at once, problems appear. Databases:
- Can search millions of records quickly,
- Let many users read and write safely at the same time,
- Enforce rules that keep data consistent (for example, no second account with the same email),
- Control who can access which data.
Relational databases
The most common kind is the relational database, which stores data in tables of rows and columns. A shop might have “Customers”, “Products” and “Orders” tables. The orders table shows which customer bought which product through relationships between the tables. MySQL, PostgreSQL, SQLite and Microsoft SQL Server are well-known examples.
SQL
SQL (Structured Query Language) is used to talk to relational databases. For example, “get the customers in London” is written in SQL like this:
SELECT name, phone FROM customers WHERE city = 'London';
SQL is relatively easy to read and is a useful skill in many jobs that involve data.
NoSQL databases
Not all data fits neatly into tables. NoSQL databases store data in other forms, such as documents, key-value pairs or graphs. They may be chosen for apps whose data structure changes often or that need to scale across many machines.
Everyday examples
- WordPress sites store posts, pages and settings in a MySQL database.
- Many apps on your phone keep data in a small SQLite database on the device.
- Banks, hospitals and government bodies use large, highly secure database systems.
Frequently asked questions
How are databases backed up?
Database systems have their own backup tools. For websites, hosting providers usually offer automatic database backups; still, take your own backups regularly.
Is SQL hard to learn?
Basic queries can be learned in a few days. Advanced topics develop with experience.