Skip to content

About

Personal T-SQL learning notes and exercises based on Data With Baraa's SQL course, covering SQL fundamentals, advanced queries and optimization.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

66 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SQL Learning Notes

A personal SQL learning journal built while following the Data With Baraa SQL course.

This repository contains 35 SQL lesson files with queries, exercises, experiments, and explanations in Polish. It follows my progress from basic SELECT statements to window functions, indexing, execution plans, and partitioning.

The exercises and sample datasets come from Data With Baraa. My contribution is the personal notes, attempted solutions, and adaptations collected while learning.

What's inside

The lesson numbers follow the order in which I studied the topics:

  • 01–05: databases, querying, DDL, DML, and filtering
  • 06–09: joins and set operators
  • 10–17: text, numeric, date, NULL, and conditional expressions
  • 18–22: aggregation and window functions
  • 23–27: subqueries, CTEs, views, and intermediate tables
  • 28–35: indexes, execution plans, partitioning, and performance

The original filenames and Polish comments are kept as part of the learning journal.

Requirements

  • Microsoft SQL Server 2022 or newer — examples using DATETRUNC require SQL Server 2022+.
  • SQL Server Management Studio (SSMS) or another client that supports T-SQL and GO batch separators.
  • The course's MyDatabase and SalesDB sample databases.

Some performance exercises also use an AdventureWorks data warehouse sample. Microsoft's AdventureWorks installation guide provides the downloads and restore instructions. Check that the database name in USE matches your restored sample.

These notes use T-SQL, Microsoft SQL Server's SQL dialect.

Getting started

  1. Clone the repository:

    git clone https://github.com/Nicooo00/sql-learning-notes.git
    cd sql-learning-notes
  2. Open SSMS and connect to a local learning instance.

  3. Prepare the sample databases using the official course materials or the definitions in lesson 01.

  4. Open a lesson, read the task and comments, check the selected database, then execute the statements you want to explore.

Lesson 01 drops and recreates MyDatabase and SalesDB if they already exist. Run it only against disposable learning databases. Other lessons include data and schema changes, so review the selected statements before executing them.

The files contain independent examples rather than a single installation sequence. Some examples demonstrate errors or limitations intentionally; others preserve personal attempts alongside course solutions. Run individual tasks instead of executing every file together.

Lesson index

# Lesson
01 Creating and deleting databases
02 SELECT queries
03 DDL commands
04 DML commands
05 WHERE conditions
06 JOIN basics
07 Advanced JOIN patterns
08 Joining multiple tables
09 Set operators
10 String functions
11 Number functions
12 Date and time functions
13 Formatting and casting
14 Date calculations and validation
15 NULL functions
16 NULL, empty strings and blank spaces
17 CASE WHEN
18 Aggregate functions
19 Window function basics
20 Aggregate window functions
21 Ranking window functions
22 Value window functions
23 Subqueries
24 Common table expressions (CTEs)
25 Views
26 CTAS and SELECT INTO
27 Temporary tables
28 Indexes
29 Columnstore indexes
30 Unique and filtered indexes
31 Index maintenance
32 Execution plans
33 Indexing strategy
34 Table partitioning
35 SQL best practices

Working with the notes

The comments mix Polish explanations with the course's English task descriptions and SQL terminology. They are working study notes, including observations and experiments from the learning process.

For performance exercises, compare the query results as well as execution plans, logical reads, CPU time, and elapsed time. The small sample datasets are useful for understanding behavior; they do not establish performance gains for larger workloads.

Sources and attribution

The original course, exercises, and sample datasets are by Baraa Khatib Salkini / Data With Baraa:

This repository is an independent learning journal maintained by Nicooo00, not an official course release. Course-derived examples are credited to their original author.

License

LICENSE preserves the course repository's MIT copyright and permission notice for course-derived code and its adaptations:

Copyright (c) 2025 Baraa Khatib Salkini

No separate license is introduced for my original personal notes. Linked videos and other external resources remain subject to their own terms.

About

Personal T-SQL learning notes and exercises based on Data With Baraa's SQL course, covering SQL fundamentals, advanced queries and optimization.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages