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- What is a database? ro‘yxatsiz sinab ko‘ring Video Practice 3 questions 15 min
- SELECT and FROM: choosing columns ro‘yxatdan o‘tgach Video Practice 3 questions 15 min
- WHERE: filtering rows ro‘yxatdan o‘tgach Video Practice 3 questions 20 min
- ORDER BY: sorting ro‘yxatdan o‘tgach Video Practice 3 questions 15 min
- LIMIT: limiting results ro‘yxatdan o‘tgach Video Practice 3 questions 15 min
Chapter 2. Filtering in depth
5 lessons- IN and BETWEEN: lists and ranges ro‘yxatdan o‘tgach Practice 4 questions 15 min
- LIKE: searching by text pattern ro‘yxatdan o‘tgach Practice 4 questions 20 min
- NULL: the unknown value ro‘yxatdan o‘tgach Practice 4 questions 20 min
- NOT, AND, OR and brackets ro‘yxatdan o‘tgach Practice 4 questions 20 min
- CASE: conditional columns ro‘yxatdan o‘tgach Practice 4 questions 20 min
Chapter 3. Aggregates and grouping
5 lessons- COUNT: how many rows? ro‘yxatdan o‘tgach Practice 4 questions 15 min
- SUM, AVG, MIN, MAX and ROUND ro‘yxatdan o‘tgach Practice 4 questions 20 min
- GROUP BY: totals per group ro‘yxatdan o‘tgach Practice 4 questions 20 min
- HAVING: filtering groups ro‘yxatdan o‘tgach Practice 4 questions 20 min
- 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- Why several tables? Keys ro‘yxatdan o‘tgach Practice 4 questions 20 min
- INNER JOIN: joining matching rows ro‘yxatdan o‘tgach Practice 4 questions 20 min
- LEFT JOIN: nobody gets left out ro‘yxatdan o‘tgach Practice 4 questions 20 min
- Joining three or more tables ro‘yxatdan o‘tgach Practice 4 questions 20 min
- JOIN + GROUP BY: real reports ro‘yxatdan o‘tgach Practice 4 questions 25 min
Chapter 5. Subqueries
5 lessons- A query inside a query ro‘yxatdan o‘tgach Practice 4 questions 20 min
- IN, NOT IN and the NULL trap ro‘yxatdan o‘tgach Practice 4 questions 20 min
- EXISTS and correlated subqueries ro‘yxatdan o‘tgach Practice 4 questions 20 min
- Subqueries in FROM and SELECT ro‘yxatdan o‘tgach Practice 4 questions 20 min
- UNION, INTERSECT, EXCEPT: combining results ro‘yxatdan o‘tgach Practice 4 questions 20 min
Chapter 6. Changing data
5 lessons- INSERT: adding new rows ro‘yxatdan o‘tgach Practice 4 questions 20 min
- UPDATE: changing existing data ro‘yxatdan o‘tgach Practice 4 questions 20 min
- DELETE: removing rows ro‘yxatdan o‘tgach Practice 4 questions 20 min
- Changing data based on another table ro‘yxatdan o‘tgach Practice 4 questions 20 min
- UPDATE with CASE and safe habits ro‘yxatdan o‘tgach Practice 4 questions 20 min
Chapter 7. Creating tables and constraints
5 lessons- CREATE TABLE and data types ro‘yxatdan o‘tgach Practice 4 questions 20 min
- Constraints: NOT NULL, DEFAULT, UNIQUE, CHECK ro‘yxatdan o‘tgach Practice 4 questions 20 min
- PRIMARY KEY, FOREIGN KEY and ON DELETE ro‘yxatdan o‘tgach Practice 4 questions 25 min
- ALTER TABLE and DROP TABLE ro‘yxatdan o‘tgach Practice 4 questions 20 min
- 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- CTE: named queries with WITH ro‘yxatdan o‘tgach Practice 4 questions 20 min
- Recursive CTE: sequences and hierarchies ro‘yxatdan o‘tgach Practice 4 questions 25 min
- Window functions: OVER and PARTITION BY ro‘yxatdan o‘tgach Practice 4 questions 20 min
- ROW_NUMBER, RANK, DENSE_RANK: rankings ro‘yxatdan o‘tgach Practice 4 questions 20 min
- LAG, LEAD and running totals ro‘yxatdan o‘tgach Practice 4 questions 20 min
Chapter 9. Indexes and EXPLAIN
5 lessons- What an index is and EXPLAIN QUERY PLAN ro‘yxatdan o‘tgach Practice 4 questions 20 min
- Composite indexes and column order ro‘yxatdan o‘tgach Practice 4 questions 20 min
- When an index isn't used ro‘yxatdan o‘tgach Practice 4 questions 20 min
- The cost of an index: when to add one ro‘yxatdan o‘tgach Practice 4 questions 20 min
- Habits for optimising queries ro‘yxatdan o‘tgach Practice 4 questions 20 min
Chapter 10. Transactions and database design
5 lessons- Transactions: all or nothing ro‘yxatdan o‘tgach Practice 4 questions 20 min
- ACID and concurrency ro‘yxatdan o‘tgach Practice 4 questions 20 min
- Normalisation: designing without repetition ro‘yxatdan o‘tgach Practice 4 questions 25 min
- Relationship types: 1:1, 1:N, N:M ro‘yxatdan o‘tgach Practice 4 questions 20 min
- Final project: an online shop report ro‘yxatdan o‘tgach Practice 4 questions 30 min
Chapter 11. Practical SQL for analysts
5 lessons- Checking data quality with SQL ro‘yxatdan o‘tgach Practice 4 questions 20 min
- Top N per group ro‘yxatdan o‘tgach Practice 4 questions 20 min
- Funnels: where are we losing people? ro‘yxatdan o‘tgach Practice 4 questions 20 min
- Cohorts and retention in SQL ro‘yxatdan o‘tgach Practice 4 questions 25 min
- Segmentation and pivots in SQL ro‘yxatdan o‘tgach Practice 4 questions 20 min