Skip to main content

SQL Classes Online

Video lessons by Dan Rodney, Instructor at Noble Desktop

Start the free course

Learn to query databases with SQL in about two hours. Each lesson pairs a short video with notes and a quiz or practice queries you run right on this page, against a real database of an online store. There's nothing to install and no account to create.

Difficulty
Beginner
Cost
Free
Format
Self-paced, online
Time Commitment
About 2 hours
Prerequisites
None

What you'll learn

  • What SQL is, and why it shows up in more data job postings than any other skill
  • How databases, tables, rows and columns fit together
  • How to pull exactly the columns you need with SELECT
  • How to filter rows with WHERE, using text and number conditions
  • How to sort and trim results with ORDER BY, DESC and LIMIT
  • How to total data with SUM and summarize it with GROUP BY

Skills you'll gain

  • SQL queries
  • SELECT
  • WHERE filters
  • ORDER BY and LIMIT
  • SUM
  • GROUP BY
  • Relational databases
  • Data analysis
  • PostgreSQL basics
  • DBeaver
Lessons 12 lessons

Lesson 1 of 12: Why SQL

What is SQL?

0:00–3:48 of Intro to SQL, Noble Desktop

SQL stands for Structured Query Language. It is the language people use to manage data in a relational database, and most of the time that means querying it, or asking the database a question and getting back the matching information.

SQL can also insert new records, update ones that change, delete old ones, back data up and export it for tools like Excel. This course focuses on querying, because that is what analysts, marketers and engineers do with SQL every day.

A database is a collection of tables, and each table stores one kind of thing in rows and columns. The store in this course has a users table, an orders table, a line_items table for every product in an order, and a products table.

In short

  • SQL is short for Structured Query Language.
  • To query a database is to ask it a question and retrieve the answer.
  • A database holds many tables. A table holds rows and columns.
  • A database lives on a server, and one server can hold many databases.

Quiz

What does SQL stand for?
What does it mean to query a database?

Lesson 2 of 12: Why SQL

Databases vs. Excel

3:48–7:31 of Intro to SQL, Noble Desktop

If you know Excel, you already know the shape of a database. A whole workbook is like a database, each worksheet tab is like a table, and the columns and rows work the same way. Every price goes in the price column, and every product gets its own row.

SQL comes in a few flavors, one for each database management system (DBMS). PostgreSQL, MySQL, Microsoft SQL Server and Oracle are the most popular. The core language is the same everywhere, so a query you write for one usually runs on the others.

Differences are small and well documented. For example, PostgreSQL and MySQL use LIMIT 10 to return ten rows, while SQL Server uses TOP 10. If a query errors on a new system, the error message and a quick search usually point to the fix.

-- PostgreSQL, MySQL and SQLite
SELECT * FROM products LIMIT 10;

-- Microsoft SQL Server
SELECT TOP 10 * FROM products;

In short

  • Database ≈ Excel workbook. Table ≈ worksheet tab.
  • Columns group like information. Each row is one record.
  • PostgreSQL, MySQL, SQL Server and Oracle all speak SQL with minor differences.
  • The practice editor on this page runs SQLite, which uses LIMIT like PostgreSQL.

Quiz

In the Excel analogy, a single database table is most like what?
Which database system uses TOP instead of LIMIT to cap the number of rows returned?

Lesson 4 of 12: Why SQL

Why learn SQL

11:53–16:22 of Intro to SQL, Noble Desktop

SQL is one of the most requested skills in tech job postings, and it sits at the top of the list for data roles. Ask working data analysts which tool to learn first and the answer is almost always SQL.

SQL and Python are the two core languages for data analysts and data scientists. Even outside data teams, people in marketing, operations and product benefit from running their own queries instead of waiting on a report.

Because SQL has stayed stable for decades, it is a skill that lasts. You are not betting on a tool that will be gone next year.

In short

  • SQL appears in more data job postings than any other skill.
  • Data analysts and data scientists pair SQL with Python.
  • SQL helps non-engineers answer their own questions with data.

Quiz

Which two languages matter most for data analyst and data scientist jobs?

Lesson 5 of 12: Why SQL

How SQL is used in business

16:22–23:43 of Intro to SQL, Noble Desktop

Websites run on databases. WordPress, which powers more than 40% of websites, stores every post, page and comment in a MySQL database, and SQL reads and writes all of it behind the scenes.

Businesses keep customers, sales and operations data in databases. Uber, Netflix and Airbnb run on SQL, and even Google, Amazon and Facebook, which build their own database systems, have data teams that query them with SQL.

The payoff is answering business questions with data instead of guessing. Find every client who has spent more than $5,000 in the past decade so you can reach out again. Count purchases by month and department to spot trends. Total up returns to find a problem product. Most dashboards and reports you use are SQL queries under the hood.

To start writing queries you need a database client. DBeaver is a popular free one, and Mode offers a free public dataset in the browser. The editor on this page works too, with nothing to install.

In short

  • Most websites and apps store their data in a SQL database.
  • SQL turns stored data into answers to business questions.
  • Reports and dashboards are usually SQL queries behind the scenes.
  • DBeaver (free Community Edition) and Mode are common places to practice.

Quiz

Which database does WordPress use to store website content?
A manager asks which clients have spent more than $5,000 with the company. What's the best way to answer?

Lesson 6 of 12: Getting set up

Connecting to a database and exploring tables

23:43–31:51 of Intro to SQL, Noble Desktop

A database client like DBeaver connects to a database server. You enter the host, port, database name, username and password, and the client shows every table in a navigator panel. The client does not supply data. It is the tool you query it with.

Before writing queries, browse the tables. Learn the table and column names and look at what each one stores, because you will need those exact names in your queries.

Most tables have an id column, a unique number for each row that never changes. Other tables point to it. Each order stores the user_id of the person who placed it, and each line item stores the order_id and product_id it belongs to. These references are how tables relate.

Try it here. The Tables panel next to the editor lists every table and column in the practice database.

In short

  • A client like DBeaver connects to a database. It doesn't contain the data.
  • Explore table and column names before you write queries.
  • An id uniquely identifies each row. Other tables reference it, like orders.user_id.

Try it

Ctrl+Enter also runs it
Tables in the practice database
Loading…

Lesson 7 of 12: Getting set up

Writing and running queries

31:51–37:09 of Intro to SQL, Noble Desktop

Open a new SQL script, make sure it is connected to the right database, and write your first statement. SELECT says what you want, the * asterisk means every column, FROM names the table, and a semicolon ends the statement.

The rows a query returns are called the result set. Querying never changes the table. It only chooses what to show you.

A script can hold many queries. The editor runs the statement your cursor is in, so click into a query and press Ctrl+Enter (Ctrl+Return on a Mac). If you highlight part of a statement, only the highlighted part runs.

SELECT * FROM users;

SELECT * FROM orders;

In short

  • SELECT * FROM table; returns every column and row.
  • The output of a query is called the result set.
  • Ctrl+Enter runs the statement your cursor is in.
  • Highlighting part of a query runs only that part.

Try it

Ctrl+Enter also runs it
Tables in the practice database
Loading…

Lesson 8 of 12: Writing queries

Choosing columns

37:09–37:53 of Intro to SQL, Noble Desktop

Most of the time you don't need every column. List the columns you want after SELECT, separated by commas.

Spell each column exactly as it appears in the database. Asking for emails when the column is email returns an error, which is why exploring the tables first helps.

SELECT name, email FROM users;

In short

  • List columns after SELECT, separated by commas.
  • Column names must match the database exactly.

Try it

Ctrl+Enter also runs it
Tables in the practice database
Loading…

Lesson 9 of 12: Writing queries

Filtering rows with WHERE

37:53–43:56 of Intro to SQL, Noble Desktop

WHERE keeps only the rows that match a condition. The database checks every row and includes the ones where the condition is true.

Data types matter. Text values, called strings, go inside single quotes, as in tags = 'cyan'. Numbers don't need quotes, and you can compare them with >, <, >= and <=.

A long statement can span several lines. The semicolon marks where it ends. Be careful with selections, though. Highlight only SELECT * FROM products and the WHERE clause is skipped, so you get every product again.

SELECT * FROM products
WHERE tags = 'cyan';

SELECT * FROM products
WHERE price > 80;

In short

  • WHERE filters rows. SELECT chooses columns.
  • Put text values in single quotes. Leave numbers bare.
  • Compare numbers with >, <, >= and <=.

Try it

Ctrl+Enter also runs it
Tables in the practice database
Loading…
Ctrl+Enter also runs it
Tables in the practice database
Loading…

Lesson 10 of 12: Writing queries

Sorting with ORDER BY and LIMIT

43:56–46:47 of Intro to SQL, Noble Desktop

ORDER BY sorts the result set by a column. Sorting is ascending (smallest first) by default. Add DESC to sort descending.

LIMIT caps how many rows come back. Sort by price descending and limit to one row and you have the most expensive product.

Clause order matters, which is the structure in Structured Query Language. LIMIT always goes last. Put it right after SELECT and you get an error.

SELECT * FROM products
ORDER BY price DESC
LIMIT 1;

In short

  • ORDER BY sorts ascending by default. DESC reverses it.
  • LIMIT goes at the very end of a query.
  • Clauses must be written in a fixed order.

Try it

Ctrl+Enter also runs it
Tables in the practice database
Loading…
Ctrl+Enter also runs it
Tables in the practice database
Loading…

Lesson 11 of 12: Writing queries

Adding things up with SUM

46:47–49:48 of Intro to SQL, Noble Desktop

An aggregate function combines many rows into one value. SUM(quantity) adds up the quantity column across every row, much like SUM in Excel.

Think about what the numbers mean. Each line item's price is the price of one unit. To get revenue you multiply by the quantity first, SUM(price * quantity), or you undercount every order that bought more than one.

SELECT SUM(quantity) FROM line_items;

SELECT SUM(price * quantity) FROM line_items;

In short

  • SUM adds a column across all rows into one value.
  • You can do math inside an aggregate, like SUM(price * quantity).
  • Check that a calculation matches what the columns actually mean.

Try it

Ctrl+Enter also runs it
Tables in the practice database
Loading…
Ctrl+Enter also runs it
Tables in the practice database
Loading…

Lesson 12 of 12: Writing queries

Grouping results with GROUP BY

49:48–56:00 of Intro to SQL, Noble Desktop

If you don't have a database, Mode offers a free public dataset in the browser. Its city_populations table lists cities with their state and population, and this course's practice database has a copy of it.

GROUP BY collapses rows that share a value into one row per group, and an aggregate like SUM runs once per group. Group city populations by state and SUM(population_estimate) gives each state's total.

The clause order is SELECT, FROM, JOIN, WHERE, GROUP BY, HAVING, ORDER BY, LIMIT. GROUP BY must come before ORDER BY. The instructor puts them the other way around in the video and gets an error, which is a common mistake.

SELECT state, SUM(population_estimate)
FROM city_populations
GROUP BY state
ORDER BY state;

In short

  • GROUP BY makes one row per distinct value.
  • Aggregates like SUM run once per group.
  • Order: SELECT, FROM, JOIN, WHERE, GROUP BY, HAVING, ORDER BY, LIMIT.

Try it

Ctrl+Enter also runs it
Tables in the practice database
Loading…
Ctrl+Enter also runs it
Tables in the practice database
Loading…

About this course

The course is for beginners: marketers, analysts, product managers, career changers and anyone who wants to answer their own questions with data. It follows Dan Rodney's hour-long Intro to SQL class. Dan has taught at Noble Desktop for more than 20 years.

The practice editor runs SQLite in your browser with a small online store's data: users, orders, line_items and products, plus a city_populations table. Every query starts from a fresh copy of the data, so you can't break anything. Your progress is saved on this device.

What you learn works the same way in PostgreSQL, MySQL and SQLite, and nearly the same in Microsoft SQL Server. When you finish you'll be able to explore an unfamiliar database, pull the rows and columns you need, and total and group results to answer business questions.

Keep learning SQL

See all SQL courses

Next come joins, subqueries and window functions. These SQL classes from our course directory go further, with reviews from students.

4.62

Nucamp's Back End, SQL, and DevOps with Python Bootcamp is a 16-week, online program designed to prepare students for entry-level positions as Back End Python developers. The curriculum includes Python programming fundamentals, SQL database management, and DevOps practices essential for modern software engineering. Students gain practical experience through a portfolio project and are supported with lessons and practice exams to pursue industry-recognized certifications. Graduates receive a Certificate of Completion from Nucamp, enhancing their career prospects in tech. Before You Learn / Who This Course Is For Open to all with basic computer literacy Ideal for aspiring Back End developers No prerequisites beyond Nucamp's admission requirements What to Expect 16-week online bootcamp with flexible learning Hands-on portfolio project development Preparation for industry-recognized certifications What You'll Achieve Nucamp's Certificate of Completion Proficiency in Python, SQL, and DevOps Enhanced career opportunities in tech

via Nucamp
16 weeks 22 hrs/week
$2,124

No reviews yet

EnkiCamp's SQL Foundations course is a 4-week online program designed to teach the essentials of SQL. Through interactive exercises, participants learn how to query, relate, and analyze data effectively. The course culminates in a practical project where students apply their newfound skills to real-world scenarios, providing hands-on experience and a comprehensive understanding of SQL fundamentals. Before You Learn / Who This Course Is For Ideal for beginners and data enthusiasts No prerequisites required Suitable for aspiring data analysts What to Expect Self-paced online format with interactive exercises Focus on querying, relating, and analyzing data Final project to apply SQL skills What You'll Achieve Practical SQL data analysis skills Ability to handle real-world data tasks

via EnkiCamp
4 weeks 1 hr/week
$500

No reviews yet

Arkansas Coding Academy offers a rigorous web development program designed for career changers and tech enthusiasts. The course provides 6 to 9 hours of expert-led virtual instruction weekly, with optional in-person sessions on Saturdays. Participants gain hands-on experience in web development, suitable for beginners and advanced learners alike, and can engage in a comprehensive career development program. Before You Learn / Who This Course Is For Open to all education levels, GED to Master's holders Ideal for career changers and tech enthusiasts No prior programming experience required What to Expect 6-9 hours of virtual instruction weekly Hands-on web development practice and projects Optional in-person sessions on Saturdays What You'll Achieve Access to ArCA’s Career Development program Skills for entry-level web development roles

via Arkansas Coding Academy
24 weeks 6 hrs/week
$5,250

No reviews yet

This intensive Master SQL Server Developer bootcamp offers a comprehensive, five-course program on relational database management. Delivered through a blend of on-demand streaming and personal facilitation, the course includes hands-on exercises in SQL programming, Reporting Services, and ASP.NET Web forms. Students receive high-speed access to dedicated lab machines, ensuring a 50% lecture and 50% practical experience. With expert guidance, learners gain proficiency in SQL syntax, data warehouse design, and business analytics, preparing them for IT workplace challenges. Before You Learn / Who This Course Is For Ideal for aspiring SQL developers and IT professionals No prerequisites required; foundational IT knowledge beneficial Suitable for individuals seeking hands-on database experience What to Expect On-demand streaming with guided facilitation 50% lecture, 50% hands-on lab exercises High-speed access to dedicated lab machines What You'll Achieve Proficiency in SQL programming and database management Ability to create reports and Web forms using ASP.NET Skills in deploying and managing SQL Server environments

via Developer Bootcamp
1 week 1 hr/week
$6,000

No reviews yet

Coderhouse's SQL course offers live instruction on querying and managing relational databases. Participants will engage with real datasets and practical challenges to develop essential SQL skills. The course includes interactive sessions and a final project, providing a hands-on learning experience. Before You Learn / Who This Course Is For Beginners and professionals working with databases Ideal for those needing SQL data extraction skills No prior SQL experience required What to Expect Live instructor-led sessions Hands-on query exercises Final project with real database application What You'll Achieve Ability to write effective SQL queries Skills to join and aggregate database data Proficiency in managing relational databases

via Coderhouse
11 weeks 2 hrs/week
$1

No reviews yet

The SQL Bootcamp at Arkansas Coding Academy is a fast-paced, immersive program designed for beginners and those looking to enhance their SQL skills. Delivered online, the course covers basic to advanced SQL techniques through hands-on practice with real-world scenarios. Led by an experienced SQL professional, participants will gain expertise in data manipulation and database optimization, preparing them for success in data-driven roles. Before You Learn / Who This Course Is For Ideal for beginners and those enhancing SQL skills No prerequisites required Suited for aspiring database developers What to Expect Fast-paced, fully immersive online format Hands-on practice with real-world scenarios Instruction by seasoned SQL professional What You'll Achieve Proficiency in SQL for data-driven roles Skills in data manipulation and database optimization

via Arkansas Coding Academy
4 weeks 9 hrs/week
$1,050

Frequently asked questions

Is this SQL course really free?

Yes. Every lesson, quiz and practice exercise is free, and you don't need to create an account. Your progress is saved in your browser.

Do I need to know anything before learning SQL?

No. This course assumes no coding experience. If you've used a spreadsheet like Excel, you already understand rows and columns, which is most of what you need to get started.

Do I need to install anything?

No. The practice editor runs a real SQL database in your browser, so you can write and run queries right on this page. When you're ready for your own setup, DBeaver Community Edition is a good free SQL client.

Which SQL dialect does this course teach?

The video demonstrates PostgreSQL, and the practice editor runs SQLite. Everything in this course, including SELECT, WHERE, ORDER BY, LIMIT, SUM and GROUP BY, works the same way in PostgreSQL, MySQL and SQLite. Microsoft SQL Server uses TOP instead of LIMIT.

How long does it take to learn SQL?

This intro takes about an hour of video plus practice. Most people can write useful queries within a few weeks of regular practice, because SQL is a small language compared with Python or JavaScript. Joins, subqueries and window functions take longer to master.

Is SQL hard to learn for beginners?

SQL is one of the most beginner-friendly programming languages. Queries read like plain English, as in SELECT name FROM users WHERE state = 'NY', and there is far less to learn than in a general-purpose language.

What jobs use SQL?

SQL is required for data analysts, data scientists, data engineers, business intelligence analysts and backend developers, and it's increasingly expected of product managers, marketers and operations staff who work with data. It appears in more data job postings than any other skill.

What should I learn after this SQL course?

Next, learn joins to combine tables, then HAVING, subqueries and window functions. A live SQL bootcamp or a data analytics program adds Python, Excel and Tableau for analysis and visualization. Noble Desktop's SQL Bootcamp picks up where this course leaves off.

Find the path that fits your
career goals

Sign up for bootcamp advice

Enter your email to join our newsletter community.

By submitting this form, you agree to receive email marketing from Course Report.