1.1 — Databases: Supercharged Excel Workbooks
Key Concepts
Excel Term | SQL/Database Term | Analogy/Explanation |
---|---|---|
Worksheet/Table | Table | A set of rows and columns |
Column | Column/Field | Data attribute (e.g., "Amount") |
Row | Record | One item or transaction |
Workbook | Database | A collection of tables |
What is a Database?
A database is like an Excel workbook, but designed to handle much larger amounts of data—often millions of rows—without crashing or slowing down.
- Tables in a database are like your Excel sheets or tables.
- Each row is a record (like a sales transaction).
- Each column is a field (like "Date", "Product", "Amount").
Example:
SaleDate | Product | Amount |
---|---|---|
2024-05-01 | Apples | 120 |
2024-05-01 | Oranges | 80 |
This is both an Excel table and a SQL table!
Why Use Databases Instead of Excel?
- Handles more data: Millions of rows, not just thousands.
- Faster analysis: No more waiting for formulas to recalculate.
- Multiple users: Teams can access and update data at the same time.
- Data integrity: Reduces errors from manual copy-paste.
How Does SQL Fit In?
SQL (Structured Query Language) is the language you use to ask questions and get answers from your database—just like using filters or formulas in Excel, but much more powerful.
- Want to see all sales for "Apples"?
Use a SQL query instead of a filter.
Excel vs. SQL: The Big Picture
Task in Excel | Equivalent in SQL |
---|---|
Filter rows | WHERE clause |
Select columns | SELECT statement |
Sort data | ORDER BY clause |
Create calculated columns | Expressions in SELECT |
PivotTable | GROUP BY and aggregates |
Next Steps
In the next lesson, you’ll write your very first SQL query to select data from a table—just like viewing a table in Excel.