o‘zing o‘rgan
All courses
Filbek · Data specialist

SQL Basics

Learn to query databases: SELECT, WHERE, ORDER BY, LIKE, NULL, CASE, COUNT/SUM/AVG, GROUP BY, JOIN, subqueries, INSERT/UPDATE/DELETE, creating tables, CTEs, window functions, indexes, transactions and database design — on real tables.

55 lessons ~18 h Born in 1974

Chapter 1. First queries

5 lessons
  1. What is a database? ro‘yxatsiz sinab ko‘ring Video Practice 3 questions 15 min
  2. SELECT and FROM: choosing columns ro‘yxatdan o‘tgach Video Practice 3 questions 15 min
  3. WHERE: filtering rows ro‘yxatdan o‘tgach Video Practice 3 questions 20 min
  4. ORDER BY: sorting ro‘yxatdan o‘tgach Video Practice 3 questions 15 min
  5. LIMIT: limiting results ro‘yxatdan o‘tgach Video Practice 3 questions 15 min

Chapter 2. Filtering in depth

5 lessons
  1. IN and BETWEEN: lists and ranges ro‘yxatdan o‘tgach Practice 4 questions 15 min
  2. LIKE: searching by text pattern ro‘yxatdan o‘tgach Practice 4 questions 20 min
  3. NULL: the unknown value ro‘yxatdan o‘tgach Practice 4 questions 20 min
  4. NOT, AND, OR and brackets ro‘yxatdan o‘tgach Practice 4 questions 20 min
  5. CASE: conditional columns ro‘yxatdan o‘tgach Practice 4 questions 20 min

Chapter 3. Aggregates and grouping

5 lessons
  1. COUNT: how many rows? ro‘yxatdan o‘tgach Practice 4 questions 15 min
  2. SUM, AVG, MIN, MAX and ROUND ro‘yxatdan o‘tgach Practice 4 questions 20 min
  3. GROUP BY: totals per group ro‘yxatdan o‘tgach Practice 4 questions 20 min
  4. HAVING: filtering groups ro‘yxatdan o‘tgach Practice 4 questions 20 min
  5. The full query: written order vs execution order ro‘yxatdan o‘tgach Practice 4 questions 20 min

Intermediate level

Ro‘yxatdan o‘tib, oldingi darajani tugatgach — kirish imtihoni bilan ochiladi.

Chapter 4. Joining tables: JOIN

5 lessons
  1. Why several tables? Keys ro‘yxatdan o‘tgach Practice 4 questions 20 min
  2. INNER JOIN: joining matching rows ro‘yxatdan o‘tgach Practice 4 questions 20 min
  3. LEFT JOIN: nobody gets left out ro‘yxatdan o‘tgach Practice 4 questions 20 min
  4. Joining three or more tables ro‘yxatdan o‘tgach Practice 4 questions 20 min
  5. JOIN + GROUP BY: real reports ro‘yxatdan o‘tgach Practice 4 questions 25 min

Chapter 5. Subqueries

5 lessons
  1. A query inside a query ro‘yxatdan o‘tgach Practice 4 questions 20 min
  2. IN, NOT IN and the NULL trap ro‘yxatdan o‘tgach Practice 4 questions 20 min
  3. EXISTS and correlated subqueries ro‘yxatdan o‘tgach Practice 4 questions 20 min
  4. Subqueries in FROM and SELECT ro‘yxatdan o‘tgach Practice 4 questions 20 min
  5. UNION, INTERSECT, EXCEPT: combining results ro‘yxatdan o‘tgach Practice 4 questions 20 min

Chapter 6. Changing data

5 lessons
  1. INSERT: adding new rows ro‘yxatdan o‘tgach Practice 4 questions 20 min
  2. UPDATE: changing existing data ro‘yxatdan o‘tgach Practice 4 questions 20 min
  3. DELETE: removing rows ro‘yxatdan o‘tgach Practice 4 questions 20 min
  4. Changing data based on another table ro‘yxatdan o‘tgach Practice 4 questions 20 min
  5. UPDATE with CASE and safe habits ro‘yxatdan o‘tgach Practice 4 questions 20 min

Chapter 7. Creating tables and constraints

5 lessons
  1. CREATE TABLE and data types ro‘yxatdan o‘tgach Practice 4 questions 20 min
  2. Constraints: NOT NULL, DEFAULT, UNIQUE, CHECK ro‘yxatdan o‘tgach Practice 4 questions 20 min
  3. PRIMARY KEY, FOREIGN KEY and ON DELETE ro‘yxatdan o‘tgach Practice 4 questions 25 min
  4. ALTER TABLE and DROP TABLE ro‘yxatdan o‘tgach Practice 4 questions 20 min
  5. ON CONFLICT: insert or update (UPSERT) ro‘yxatdan o‘tgach Practice 4 questions 20 min

Advanced level

Ro‘yxatdan o‘tib, oldingi darajani tugatgach — kirish imtihoni bilan ochiladi.

Chapter 8. CTEs and window functions

5 lessons
  1. CTE: named queries with WITH ro‘yxatdan o‘tgach Practice 4 questions 20 min
  2. Recursive CTE: sequences and hierarchies ro‘yxatdan o‘tgach Practice 4 questions 25 min
  3. Window functions: OVER and PARTITION BY ro‘yxatdan o‘tgach Practice 4 questions 20 min
  4. ROW_NUMBER, RANK, DENSE_RANK: rankings ro‘yxatdan o‘tgach Practice 4 questions 20 min
  5. LAG, LEAD and running totals ro‘yxatdan o‘tgach Practice 4 questions 20 min

Chapter 9. Indexes and EXPLAIN

5 lessons
  1. What an index is and EXPLAIN QUERY PLAN ro‘yxatdan o‘tgach Practice 4 questions 20 min
  2. Composite indexes and column order ro‘yxatdan o‘tgach Practice 4 questions 20 min
  3. When an index isn't used ro‘yxatdan o‘tgach Practice 4 questions 20 min
  4. The cost of an index: when to add one ro‘yxatdan o‘tgach Practice 4 questions 20 min
  5. Habits for optimising queries ro‘yxatdan o‘tgach Practice 4 questions 20 min

Chapter 10. Transactions and database design

5 lessons
  1. Transactions: all or nothing ro‘yxatdan o‘tgach Practice 4 questions 20 min
  2. ACID and concurrency ro‘yxatdan o‘tgach Practice 4 questions 20 min
  3. Normalisation: designing without repetition ro‘yxatdan o‘tgach Practice 4 questions 25 min
  4. Relationship types: 1:1, 1:N, N:M ro‘yxatdan o‘tgach Practice 4 questions 20 min
  5. Final project: an online shop report ro‘yxatdan o‘tgach Practice 4 questions 30 min

Chapter 11. Practical SQL for analysts

5 lessons
  1. Checking data quality with SQL ro‘yxatdan o‘tgach Practice 4 questions 20 min
  2. Top N per group ro‘yxatdan o‘tgach Practice 4 questions 20 min
  3. Funnels: where are we losing people? ro‘yxatdan o‘tgach Practice 4 questions 20 min
  4. Cohorts and retention in SQL ro‘yxatdan o‘tgach Practice 4 questions 25 min
  5. Segmentation and pivots in SQL ro‘yxatdan o‘tgach Practice 4 questions 20 min