It's your first week as a junior developer at Beacon Robotics, a small company building warehouse robots. Your manager walks over: "Can you pull up every employee in the Engineering team earning over 90,000, we're planning next quarter's budget." The company's employee records live in a database. The only way to actually answer that question is to ask the database directly, in its own language. That language is SQL, and this course follows you through learning it, one real task at a time, using Beacon Robotics' own data the whole way through.
Why Not Just Open a Spreadsheet?
Beacon Robotics has 40,000 employee records across its history, not 40. A spreadsheet would take real time to scroll and filter by hand, and that's before combining it with department budgets, project assignments, or anything else stored separately. A database stores exactly this kind of large, structured, interconnected data efficiently, and SQL is how you ask it precise questions and get an exact answer back in milliseconds, instead of scrolling.
Learning Objectives
- Explain what a relational database stores data in, and why that shape makes SQL possible.
- Describe where SQL sits between an application and its data.
- Tell SQL (the language) apart from MySQL, PostgreSQL, and other database systems that run it.
Your App
"Get this user's orders"
SQL Query
SELECT * FROM orders...
Database Engine
Finds the matching rows
Result
Rows sent back to your app
Data, Organized Into Tables
A relational database stores data in tables, which look a lot like spreadsheets. Beacon Robotics keeps an employees table, a departments table, a projects table, each one holding one kind of thing, and each row in that table is one record of that thing, one specific employee, one specific department. Each column is one piece of information every row has.
| Spreadsheet term | Database term | Example, at Beacon Robotics |
|---|---|---|
| Sheet | Table | employees |
| Row | Row (or "record") | one specific employee, like Ada |
| Column header | Column (or "field") | first_name, salary, department |
| One cell | A value | "Engineering" |
Your manager's question, every Engineering employee earning over 90,000, is really asking for specific rows (employees) from this table, filtered down to the ones where two column values match what's being asked for. That's exactly what the next few lessons teach you to do.
SQL Is a Language, Not a Product
SQL itself is a standard (maintained by ISO/ANSI), not a piece of software you install. A very common mix-up for new developers: hearing "I'm learning SQL" and "I installed MySQL" and assuming they're the same statement. They're not, MySQL, PostgreSQL, SQLite, SQL Server, Oracle Database, and MariaDB are all separate database systems, called SQL applications or database engines, built by different companies and projects, that all understand SQL as their query language. They agree on the core of SQL, which is what this course focuses on, but each adds its own extra features and small syntax differences, called out throughout this course wherever they genuinely matter.
SQL Applications: Which One, for What
| SQL application | Built by | Best for |
|---|---|---|
| MySQL | Oracle Corporation (open source) | Web apps and WordPress-style hosting, huge community, easy to find help for |
| PostgreSQL | Open source community | New production apps that want advanced features and strict standards compliance |
| SQLite | Open source | Learning, mobile apps, small local tools, no server to manage |
| SQL Server | Microsoft | Enterprises already invested in Microsoft infrastructure (.NET, Azure) |
| Oracle Database | Oracle Corporation | Large, long-standing enterprise systems, especially finance and government |
| MariaDB | Open source (a MySQL fork) | A drop-in MySQL alternative, the default on many Linux distributions |
This course's examples cover all six: MySQL, MariaDB, PostgreSQL, SQLite, SQL Server, and Oracle, and call out the specific syntax for each wherever a real difference exists. SQLite is the easiest to follow along with yourself, since it needs no server to install, just a free tool like DB Browser for SQLite.
SQL vs NoSQL
SQL databases (also called relational databases) are only one branch of how databases store data. The other major branch is NoSQL ("not only SQL"), a broad umbrella term, not one single technology, covering several different ways of storing data that don't use the table-with-fixed-columns model this course is built around.
| NoSQL application | Data model | Known for |
|---|---|---|
| MongoDB | Document | The most popular document database, stores JSON-like records |
| Redis | Key-value | In-memory, extremely fast, often used for caching and sessions |
| Cassandra | Wide-column | Built to scale across many servers with no single point of failure |
| DynamoDB | Key-value / document | Amazon's managed NoSQL database, used heavily on AWS |
| Firebase Firestore | Document | Google's managed database, popular for mobile and small web apps |
| Neo4j | Graph | Built specifically for data that's mostly about relationships, social networks, recommendations |
- Data lives in tables with a fixed set of columns
- Every row in a table has the same structure
- Relationships between tables are explicit (foreign keys)
- Best fit when data is structured and relationships matter, orders, accounts, inventory
- Several different models: documents, key-value pairs, wide columns, graphs
- Structure can vary from one record to the next
- Built to scale across many servers easily
- Best fit for very large, fast-changing, or loosely-structured data, logs, caching, real-time feeds
This course focuses entirely on SQL and relational databases, by far the most common choice for a typical application's main data. NoSQL databases are worth knowing exist, and are often used alongside a SQL database for a specific job (Redis for caching, for example), rather than as a full replacement for it.
Try It Yourself
A products table has columns id, name, price, and category. Without writing any SQL yet, just in plain English: what question would "find every product under $20" become once it's expressed as a request to a relational database?
-- In plain English: "Give me the name and price of every row -- in the products table where price is less than 20." -- As SQL (covered in full over the next few lessons): SELECT name, price FROM products WHERE price < 20;
Frequently Asked Questions
Is SQL a programming language?
Not in the same sense as Python or JavaScript. SQL is a declarative language: you describe the result you want ("rows where age > 18"), not the step-by-step logic to get it. The database engine figures out how to actually fetch it.
What's the difference between SQL and MySQL?
SQL is the language. MySQL is one specific database system that uses SQL. It's the same relationship as HTML (the language) and a web browser like Chrome (software that reads it).
Is SQL case-sensitive?
SQL keywords (SELECT, WHERE, FROM) aren't case-sensitive, SELECT and select work the same. By convention this course writes keywords in uppercase to make queries easier to read, covered in full in the next lesson.
What's the difference between SQL and NoSQL, and when would you choose each?
SQL (relational) databases enforce a fixed table structure and make relationships between tables explicit, a good fit when data is structured and consistent, orders, accounts, inventory. NoSQL databases cover several looser models (document, key-value, graph) that scale more easily and tolerate records with varying shapes, a better fit for logs, caching, or very large, fast-changing data.
Common Beginner Mistakes
Saying "I'm learning MySQL" when you mean SQL in general
This quietly narrows every tutorial, job listing, and search you'll do. Say "SQL" for the language and skill, and name the specific system only when a feature or quirk is actually specific to it.
Assuming a feature that works on one database works everywhere
Core SQL (SELECT, WHERE, JOIN, basic aggregates) is shared, but plenty of real features aren't, covered throughout this course whenever a genuine difference exists.
Treating NoSQL as "the same thing, just newer"
NoSQL isn't a newer version of SQL, it's a different data model entirely (documents, key-value, graphs) that solves a different set of problems. Neither one replaces the other, they're suited to different kinds of data.
Best Practices
- Say "SQL" when talking about the language or skill, and name the specific database system only when a difference actually matters.
- Write queries in standard SQL first, and reach for a database-specific extension only once you actually need it.
- Start learning on SQLite, it needs no server, just a free tool, and the SQL you learn transfers directly to MySQL, PostgreSQL, and SQL Server later.
- Default to a relational database for a new project unless you have a specific, identified reason to reach for NoSQL.
Interview Questions
What actually makes a database "relational"?
Data is organized into tables with a fixed set of typed columns, where every row shares the same structure, and where tables can be explicitly connected to each other through foreign keys rather than nesting or duplicating data inside one record.
Is SQL a standard, and who maintains it?
Yes, SQL is standardized by ISO and ANSI. Database vendors implement that core standard and then add their own extensions on top, which is why two databases can both be "correct SQL" and still differ in places.
Name three SQL database systems and one thing that differentiates each.
MySQL: the most widely deployed, especially in web hosting and WordPress-style stacks. PostgreSQL: stronger standards compliance and more advanced features, popular for new production apps. SQLite: no server at all, a database is a single file, used for learning and embedded apps.
Summary
This lesson covered how a relational database organizes data into tables of rows and columns, where SQL sits between your application and the database engine, why SQL (the language) is a separate thing from MySQL, PostgreSQL, and the other systems that implement it, and how SQL databases differ from the NoSQL databases that solve a different kind of data problem.
What's Next?
The next lesson covers SQL syntax, the actual rules for writing a statement, before the lesson after that writes your first real query to actually answer your manager's question.
Ready to Practice SQL?
Write and run real SQL queries online, right in your browser, no install or signup required. Pick a playground based on which database you want to practice on.
Both open a third-party SQL playground in a new tab. External site terms and privacy policy apply.