Databases and Relational Database Concepts#
š¦ Data Preparation šļø Databases & Data Sources Lesson 016
ā Previous Ā· Next ā¶ Ā· ā Section Ā· ā Hub
Important
⨠AI-generated content. This page was written with the assistance of an AI language model and is provided as a learning aid. Despite careful review, it may still contain mistakes, omissions, or out-of-date information. Whether you are new to the topic, a team lead, or a senior practitioner, treat it as a starting point rather than an authoritative reference: read it critically and independently verify anything you act on (code, commands, figures, and factual claims) against official documentation and primary sources before relying on it.
Where organisational data really lives#
Spreadsheets are where analysts often work, but they are rarely where organisational data lives. That home is the database ā a structured collection of data stored electronically and organised for efficient access, management, and retrieval. Most business data of any scale sits in databases, and the dominant kind is the relational database, whose concepts every analyst needs, because SQL ā the language of the coming sections ā is the language of exactly these systems.
The relational model#
A relational database organises data into tables (rows and columns, the tabular structure from earlier) and ā crucially ā defines relationships between those tables, so related information stored separately can be linked. The core concepts:
Tables hold one kind of entity each ā a
customerstable, anorderstable, aproductstable ā rather than cramming everything into one giant sheet.Primary key ā a column (or combination) whose value uniquely identifies each row in a table: a
customer_idthat is different for every customer. It is the tableās guarantee that each record is distinct and addressable.Foreign key ā a column in one table that refers to the primary key of another, creating the link between them. An
orderstableāscustomer_idcolumn is a foreign key pointing at thecustomerstable, recording which customer placed each order.Relationships ā the connections foreign keys express (one customer has many orders; each order belongs to one customer), letting data be stored once and joined when needed.
Why not just one big table?#
Relational structure exists to avoid redundancy and the errors it breeds. Storing each order alongside a full copy of its customerās details would repeat that customerās name and address on every order, waste space, and ā worse ā create inconsistency the moment one copy is updated and another is not. Keeping customers in one table and referring to them by key means each fact is stored once, in one authoritative place. This principle (roughly, normalisation) is why real databases are many small linked tables rather than one sprawling sheet, and why joining them is a core analytical skill.
Why analysts need this#
Three practical reasons. The data you will query is shaped this way, so
understanding tables and keys is understanding what you are querying. Answering
real questions usually means combining tables ā customer data with order
data with product data ā via their relationships, which is what SQL JOIN
(the analysis sectionās topic) does. And the āstored once, in one placeā
principle explains data you will meet: why an orders table has a bare
customer_id instead of full customer details, and where to go to look them
up.
The caveat#
The relational model is dominant but not universal ā other database kinds (document, key-value, graph, and other āNoSQLā stores) organise data differently for different needs, and very large or unstructured data often lives outside neat relational tables. Relational concepts are the essential foundation and the right starting point, but not the whole storage landscape. The next lessons stay with this world, turning to the metadata that describes what is in these databases and the governance that manages it.
Hint
See also
Source article Adapted (context, re-expressed) in our own words from: https://insightful-data-lab.com/2023/09/04/databases-and-relational-database-concepts/ (insightful-data-lab.com).