What Are Database Fundamentals?
Key points
- Database fundamentals are the knowledge of how to organize and safely store and retrieve large amounts of data — the "shape" your data takes.
- The core ideas are "table design," "normalization," and "SQL."
- Understanding them lets you read a system's data structure and reason about the causes of bugs or performance problems.
(the language for working with data)
Teacher Pochi works with data like this every day, too
What is a "database," anyway?
A database is a mechanism that organizes large amounts of data according to a fixed set of rules so a computer can efficiently store, search, and update it.
Most systems use a "relational database (RDB)," which manages data in the form of "tables." A table is made up of "rows" and "columns," where a single row corresponds to one record of data, and a column corresponds to one type (field) of data.
data
the app
Teacher Pochi's hintPicture reorganizing a messy pile of loose papers into labeled folders in a filing box. Once everything's sorted, you no longer have to dig around wondering "where did I put that document?"
Why do we need a database?
You could store data in Excel files or plain text files too, but as a system grows larger, problems like these start to appear.
A database is a purpose-built mechanism that shines in exactly these situations — many users, large volumes of data, and the need for fast access.
The basic structure: tables, rows, and columns
A database table can be explained with three terms.
idColumn = a field1, John Smith, ...Row (record) = one unit of datausers tableTable = the table itselfA "table" is the table itself, a "column" is a type of field such as a name or email address, and a "row (record)" is one complete unit of data — for example, one person's worth of information. We cover this in more detail in the dedicated table design topic.
Teacher Pochi's hintThink of a class roster. The roster as a whole is the "table," field names like "name" and "student number" are the "columns," and each filled-in line for one student is a "row."
Primary keys and foreign keys: connecting tables
A marker used to uniquely identify a single row within a table is called a "primary key." A mechanism that connects two tables by holding one table's primary key inside another table is called a "foreign key."
(primary key: id)
(foreign key: customer_id)
This mechanism lets you relate multiple tables to each other without repeating the same customer information across tables. We cover this in more detail in the dedicated table design topic.
Teacher Pochi's hintThis resembles a library patron's "member number." Instead of writing out a patron's full name on every checkout record, the library records just the member number — the details can always be looked up in the patron register using that number.
Normalization: an organizing technique that prevents duplication and conflicts
If you cram every piece of information into a single table, the same data ends up being written over and over, which leads to missed updates and inconsistencies. "Normalization" is a design approach that splits data into tables at an appropriate level of granularity to prevent these problems.
(full of duplication)
one per role
Teacher Pochi's hintPicture keeping the class roster and each student's personal details on separate sheets — a "class roster" and a "student register" — instead of cramming them onto a single page. We cover this in more detail in the dedicated normalization topic.
SQL: the language for working with databases
SQL is a dedicated language for telling a database to "find," "add," "rewrite," or "delete" data.
Behind the scenes of an application, SQL like this is sent to the database every time a screen action happens. We cover this in more detail in the dedicated SQL basics topic.
Where are databases used?
Databases run behind the scenes of nearly all software, from business systems to smartphone apps.
It's invisible from the outside, but most of the apps we use every day are accessing a database behind the scenes to work.
Summary
Database fundamentals cover the basic structure of tables, rows, and columns; how primary and foreign keys connect tables together; normalization to prevent duplication; and SQL for operating on data — together, the knowledge of how to hold and shape your data.
You can dig deeper into each of these mechanisms in the dedicated topics below.
Related topics: