SQLab
LearnPracticeProblemsArenaLeaderboard
© 2026 SQLab · Tashkent
SQLab

Learn SQL right in the browser — nothing to install.

Platform

  • Learn
  • Practice
  • Problems
  • Arena
  • Leaderboard

Who it is for

  • Students
  • Teachers
  • Universities
© 2026 SQLab. All rights reserved.Made in Uzbekistan, for students.
LearnPracticeProblemsArenaLeaderboard
0/26

Basics

  • What is a database?
  • Your first SELECT
  • WHERE: picking the rows you need
  • IN, BETWEEN, LIKE and NULL
  • Sorting, LIMIT and DISTINCT

Calculations

  • Expressions, functions and CASE
  • Working with dates
  • COUNT, SUM, AVG, MIN, MAX
  • GROUP BY and HAVING

Joining tables

  • Keys and relations
  • INNER JOIN
  • LEFT JOIN and rows without a match
  • Several tables and the self join

Advanced queries

  • Subqueries
  • UNION, INTERSECT, EXCEPT
  • WITH: named queries
  • Window functions

Creating and changing tables

  • CREATE TABLE: types and constraints
  • INSERT, UPDATE, DELETE
  • ALTER, DROP, TRUNCATE
  • Designing a database well

Going professional

  • Indexes and EXPLAIN
  • Transactions and ACID
  • Views: saved queries
  • Functions, procedures and triggers
  • Users, privileges and backups
Learn/Basics

What is a database?

016 min

You use databases every day without noticing. The contacts on your phone, your bank account, your grades at university, your rides in a taxi app — all of it lives in a database somewhere.

A database is organised data

Imagine the dean’s office keeps its list of students in a notebook. A hundred students — manageable. But ten thousand, each with grades, a group and a scholarship… Finding one person, or answering “how many students study on a grant?”, would take hours.

A database is a program that stores information so that you can find, count and change what you need in an instant.

Tables, rows, columns

The most common databases are relational. They keep data in tables, much like a spreadsheet:

id first_name last_name course city
1 Aziz Karimov 2 Toshkent
2 Malika Yusupova 1 Samarqand
3 Bobur Aliyev 2 Buxoro
  • A table is a list of things of one kind: students, subjects, orders.
  • A row is one thing: one student.
  • A column is one property of that thing: name, year of study, city.

Every column has a type: course holds only numbers, first_name holds text, birth_date holds a date. The database refuses a value of the wrong type, so the data stays clean.

What is SQL?

You cannot ask a database a question in plain English — there is a special language for it: SQL (Structured Query Language, pronounced “ess-cue-ell” or “sequel”). It appeared in the 1970s and still works in almost every database.

An SQL query reads like a simple English sentence:

SELECT first_name, city FROM students WHERE course = 2;

“Select the first name and city of 2nd-year students from the students table.” That is it — the database works out how to search on its own.

PostgreSQL and MySQL

SQL is the language; PostgreSQL and MySQL are programs that understand it (they are called DBMS — database management systems).

  • PostgreSQL is the most advanced open-source database, chosen for complex calculations and large projects.
  • MySQL is the most widespread database; a large share of the web runs on it.

The core SQL is the same in both. Where they differ, we show it separately — switch the course with the button at the top of the page and the text adapts to that database.

Your first query

Below is a real university database. Press “Run”:

university· Try changing it
SELECT first_name, last_name, city FROM students LIMIT 5;

You get a small table. Now try changing the query: write 10 instead of 5, or remove city. You cannot break anything — this database is read-only.

1Exercise

Show the names (name) of all faculties in the faculties table.


Remember

  • A database is a program that keeps data organised.
  • Data lives in tables: a row is one thing, a column is one of its properties.
  • SQL is the language for asking questions; PostgreSQL and MySQL are systems that understand it.
Next lessonYour first SELECT

Contents

  • A database is organised data
  • Tables, rows, columns
  • What is SQL?
  • PostgreSQL and MySQL
  • Your first query
  • Remember
LearnPracticeProblemsArenaLeaderboard

SQLab