Understand the relationship between databases, tables, and SQL β the language you use to talk to them.
Save
Complete lesson & earn 250 PX
A is an organised collection of tables. SQL is the language you use to ask questions and give instructions.
EXERCISE
2Relational databases store data in tables that are connected to each other through shared keys β this is what makes them "relational".
Save
Tables, rows, and columns:
customers table:
ββββββ¬βββββββββββ¬ββββββββββββββββββββββββ¬βββββββββββ
β id β name β email β city β
ββββββΌβββββββββββΌββββββββββββββββββββββββΌβββββββββββ€
β 1 β Arjun β arjun@example.com β Mumbai β
β 2 β Priya β priya@example.com β Delhi β
β 3 β Rohan β rohan@example.com β Bangaloreβ
ββββββ΄βββββββββββ΄ββββββββββββββββββββββββ΄βββββββββββ
How tables connect β the relationship:
orders table:
ββββββ¬ββββββββββββββ¬βββββββββ¬ββββββββββ
β id β customer_id β total β status β
ββββββΌββββββββββββββΌβββββββββΌββββββββββ€
β 1 β 1 β 2999 β shipped β
β 2 β 1 β 499 β pending β
β 3 β 2 β 1200 β shipped β
ββββββ΄ββββββββββββββ΄βββββββββ΄ββββββββββ
orders.customer_id points back to customers.id. Arjun (id=1) has two orders. Priya (id=2) has one. No data is duplicated β Arjun's name lives in one place only.
π‘ Key Insight: This is why it is called "relational" β the tables are related through shared keys, not because data is copied between them.
EXERCISE
1A database is an organised collection of data stored so it can be quickly found, updated, and queried. SQL is the language you use to communicate with it.
Save
EXERCISE
3SQL is a language standard. MySQL is one of many software products that implement it. Understanding this distinction prevents confusion when you move between tools.
Save
The spreadsheet analogy:
Most people start with spreadsheets β but are built for something spreadsheets cannot handle well:
| Spreadsheet | Database |
|---|---|
| One flat file | Many related tables |
| No rules on data | Strict types and constraints |
| Breaks at millions of rows | Handles billions of rows |
| No simultaneous users | Hundreds of users at once |
| Manual relationships | Foreign keys enforce links |
What SQL actually does:
SQL (Structured Query Language) is a language for talking to a . It is not a programming language like Python β it is a query language. You describe what you want, and the database figures out how to get it.
-- Plain English: "Show me the names of all customers in Mumbai"
SELECT name
FROM customers
WHERE city = 'Mumbai';
What is MySQL?
MySQL is a database management system β the software that stores your data and understands SQL. Other systems (PostgreSQL, SQLite, SQL ) also use SQL, but with small dialect differences. This course uses MySQL.
π‘ Key Insight: SQL has been around since 1974 and is still the most-used data skill in job listings. Learning it once gives you leverage across almost every industry.
SQL is a standard β MySQL is a product:
SQL (language standard)
βββ MySQL β free, open-source, most popular for web apps
βββ PostgreSQL β free, open-source, more powerful features
βββ SQLite β lightweight, used in mobile apps / local files
βββ SQL <TopicPreview slug="server">Server</TopicPreview> β Microsoft, common in enterprise Windows shops
βββ Oracle β enterprise, very powerful, expensive
All of these understand core SQL. The differences are in:
This course uses MySQL syntax:
-- MySQL date function:
SELECT NOW(); -- current timestamp
SELECT CURDATE(); -- current date only
-- These are MySQL-specific (PostgreSQL uses NOW() and CURRENT_DATE)
What stays the same across all :
-- This works in MySQL, PostgreSQL, SQLite, SQL Server, Oracle:
SELECT name, email
FROM customers
WHERE city = 'Mumbai'
ORDER BY name;
π‘ Key Insight: Master MySQL first. Moving to PostgreSQL later takes about one day β 95% of what you learn here transfers directly.