Introduction to Databases for Data Analysts
What a database is, how tables, rows, columns, and keys work, the difference between relational and NoSQL databases, and how SQL connects to all of it — explained from scratch before you write a single query.
Why Data Analysts Need to Understand Databases
In most companies, the data you need as an analyst does not live in a spreadsheet. It lives in a database. Customer records, orders, payments, inventory, user events — all of this is stored in structured database systems that have been running continuously for years. Your job as an analyst is to query that data, extract what you need, and turn it into insight.
You do not need to build or administer databases. But you need to understand how they work well enough to read a database diagram, write SQL that joins tables correctly, and understand why certain data looks the way it does.
What Is a Database?
A database is an organised collection of data stored on a server, designed to be searched, retrieved, and updated efficiently. Unlike a spreadsheet that lives as a file on someone's computer, a database runs as a continuous service on a server — available 24/7 to applications, analysts, and automated processes simultaneously.
Tables, Rows, and Columns
A relational database organises data into tables. A table is similar to a spreadsheet tab — it has rows and columns. But unlike a spreadsheet, each table represents one specific type of thing (customers, orders, products), and the structure is fixed.
customer_id is the primary key — it uniquely identifies each customer. No two customers share the same ID.
Primary Keys and Foreign Keys
Keys are how tables connect to each other. Understanding them is essential for writing correct JOINs in SQL.
orders.customer_id = customers.customer_id. This is exactly how SQL JOINs work.Common Database Data Types
Every column in a database has a data type — this tells the database what kind of value it holds and how to store it. Understanding data types matters because it affects what SQL operations you can perform and why some calculations fail.
Types of Databases — Relational vs NoSQL
Two major families of databases exist. As a data analyst, you will work with relational databases far more often — but knowing the difference helps you understand why data is sometimes in unexpected formats.
How SQL Connects to a Database
SQL (Structured Query Language) is the language used to communicate with relational databases. When you write a SQL query, you are giving instructions to the database engine: which table to look in, which rows to filter, which columns to return, and how to combine tables together.
What happened: The JOIN matched every order's customer_id to the corresponding customer's record. The result shows each customer's name, city, how many delivered orders they have placed, and how much they have spent in total. This single query draws from two tables simultaneously using the FK-PK link.
Frequently Asked Questions
What is the difference between a database and a spreadsheet?
A spreadsheet (Excel, Google Sheets) is a file on your computer. A database is a system that stores data persistently on a server, allows multiple users to read and write simultaneously, enforces rules about what data is valid, and can handle millions or billions of rows efficiently. The key practical differences: (1) Scale — Excel handles up to about 1 million rows; a database handles billions. (2) Multi-user — if two people open the same Excel file and edit it, you get conflicts. A database handles concurrent edits safely. (3) Integrity — a database prevents you from deleting a customer that still has active orders; Excel has no such protection. (4) Speed — Excel loads everything into RAM; a database queries only the rows you need. As a data analyst, you will start with spreadsheets for small tasks and move to databases when the data is too big, too shared, or too important to risk in a file.
What is a primary key in a database?
A primary key is a column (or combination of columns) that uniquely identifies each row in a table. No two rows can have the same primary key value, and the primary key cannot be NULL. In a customers table, customer_id is the primary key — every customer has a unique ID. In an orders table, order_id is the primary key. Primary keys are essential for joining tables — when you write a JOIN in SQL, you are connecting a foreign key in one table to the primary key in another. A well-designed database always has a primary key on every table. Common patterns in Indian systems: auto-incrementing integers (1, 2, 3…), UUIDs (for distributed systems), or business keys (PAN numbers, GST registration numbers as identifiers in financial systems).
What is the difference between relational and NoSQL databases?
A relational database (MySQL, PostgreSQL, SQL Server, Oracle) stores data in tables with rows and columns. Relationships between tables are defined by keys. The data structure (schema) must be decided in advance. SQL is the language used to query it. A NoSQL database stores data in other formats: documents (MongoDB), key-value pairs (Redis), wide columns (Cassandra), or graphs (Neo4j). The schema can be flexible — different records can have different fields. For data analysts, relational databases are the primary tool — virtually all business transaction data (orders, customers, products, payments, HR records, inventory) lives in relational databases. NoSQL databases appear in specific analytical contexts: MongoDB for JSON-based app data, Cassandra for time-series data at massive scale, Redis for real-time feature stores in ML. In interviews, if asked about database types, knowing MySQL and the concept of relational databases is the priority. NoSQL is secondary.
Does a data analyst need to know how to design databases?
At a junior level, no — a data analyst primarily reads data from existing databases rather than designing them. Database design (normalisation, schema design, indexing strategy) is primarily the responsibility of database administrators and data engineers. What an analyst must understand: how to read an entity-relationship (ER) diagram to understand a database's structure, how primary keys and foreign keys work so they can write correct JOINs, why data is split across multiple tables (normalisation) rather than kept in one big table, and what NULL values mean and how they affect aggregations and JOINs. As you progress to senior analyst or data engineer roles, understanding schema design, indexing, and query optimisation becomes more important.
EVIKA ACADEMY · NOIDA SECTOR 51
Learn to Query Real Databases
Our curriculum includes hands-on SQL practice on real Indian business datasets — e-commerce, banking, FMCG, healthcare — with direct database access, not toy examples.
Book Free Demo Class →