Relational Database Design and Modeling for Software Engineers
Vote

0% completed

​

What is a Database?

Related, not a random pile

Organized, which means it describes itself

Built for a purpose, for someone

It survives

Databases come in every size

Database, DBMS, and database system

Where you already meet databases

Key Takeaways

Your phone has a contacts app. It holds a few hundred names, each with a number and maybe an email.

You can search it by name. You can add a contact, change one, or delete one. It never forgets a contact when you close the app.

That is a database. It is a small one, but it has every property that matters.

A database is an organized collection of related data, stored so that it can be searched and changed. Three words in that sentence do real work. This lesson takes them one at a time.

The data in a database describes one chosen part of the real world. Textbooks call that part the mini world.

For the contacts app, the mini world is the people you know. For a college, it is students, courses, teachers, and marks. For an online store, it is customers, products, and orders.

A folder holding one song, one tax form, and one holiday photo is not a database. Those three files have nothing to do with each other. A database is built around one subject, and every piece of data in it belongs to that subject.

Organized, which means it describes itself

This is the property that separates a database from a pile of files, and it is the one most people miss.

A database stores the data, and it also stores a description of that data. The description says there is a table called Contacts. It says that table has a column called phone. It says the column holds text and can never be empty.

A description of data is called metadata. The database keeps its metadata in a part of itself called the catalog.

A database holds the data and the description of that data, so any program can ask what is there
A database holds the data and the description of that data, so any program can ask what is there

Why this matters: a program does not need to know the layout in advance. It can ask the database what tables exist and what columns they hold.

In a file processing system, that knowledge lived only inside the program code. Lose the program, and the file became a row of bytes that nobody could read.

Built for a purpose, for someone

A database is designed for a set of users and a set of questions they need answered. Nobody collects data with no use in mind.

The contacts app is built for one person and one question: what is this person's number? A hospital database is built for doctors, nurses, and billing staff, and each group asks different questions.

The purpose decides the design. This is why the case studies later in this course always start with what the system must do, never with the tables.

It survives

The data stays after the program closes and after the machine is switched off. This property is called persistence.

Data that lives only in memory is not a database. It disappears when the power goes.

Databases come in every size

A contacts list with 200 rows on a phone is a database. A bank holding ten years of transactions for forty million customers is also a database.

The size changes the hardware, the cost, and the tuning. It does not change the definition.

Database, DBMS, and database system

These three terms get mixed up often, including in job interviews. They mean different things.

TermWhat it means
Databasethe stored data plus the description of that data
DBMSthe software that creates and manages databases
Database systemthe database and the DBMS together, plus the applications that use them

MySQL is a DBMS. The set of tables your company keeps inside MySQL is a database. The two of them plus your web application make a database system.

The next lesson is about the middle row of that table.

Where you already meet databases

Online stores keep products, carts, orders, and payment records, and they must never lose an order.

Hospitals keep patient records, test results, and prescriptions, with strict rules about who may read what.

Banks keep accounts and transactions, where a single lost update means lost money.

Social apps keep users, posts, and the links between people, and they answer the same few questions billions of times a day.

Every one of these started as a description of a mini world, written by somebody doing the job you are learning now.

Key Takeaways

  • A database is an organized collection of related data, stored so that it can be searched and changed.
  • All the data in a database describes one chosen part of the real world, called the mini world.
  • A database stores a description of its own data, called metadata, in a part of itself called the catalog. This is what makes it self describing.
  • A database is designed for known users and known questions, so the purpose comes before the tables.
  • Data in a database is persistent. It survives after the program closes and the machine is switched off.
  • A database is the data, a DBMS is the software that manages it, and a database system is both together with the applications.

The definition above is deliberately narrow, because the rest of the course depends on it. Next we look at the software that makes all of it work. We follow what happens between pressing enter on a query and seeing rows come back.

Reading Progress

0%


Vote for new content

On This Page

Related, not a random pile

Organized, which means it describes itself

Built for a purpose, for someone

It survives

Databases come in every size

Database, DBMS, and database system

Where you already meet databases

Key Takeaways