
Already know some of this? A 2-minute test skips the lessons you know.
Take the placement testA free 175-lesson course built from Data with Baraa's 29h 48m of YouTube video. 18 days at 90 minutes a day, with study notes and a quiz in every lesson. A 2-minute placement test skips what you already know.
Taught by Data with Baraa on YouTube. Videos play in YouTube's own player, so the creator keeps every view.
Understand what SQL is, why it is essential for data careers, and how databases, DBMS, and servers work together to store and manage data.
Distinguish between relational and NoSQL database types, and explain the hierarchy of server, database, schema, table, columns, rows, primary keys, and data types in a relational database.
Classify SQL commands into Data Definition Language (CREATE, ALTER, DROP), Data Manipulation Language (INSERT, UPDATE, DELETE), and Data Query Language (SELECT).
Connect to the local SQL Express server using Windows Authentication, then create the 'my_database' and 'sales_db' databases by executing the provided SQL scripts.
Write basic SELECT * and SELECT column_list FROM table queries to retrieve all or specific columns from a table, understanding that SELECT defines the projection and FROM defines the source.
Apply the WHERE clause with comparison operators (=, !=) to filter rows based on numeric or string conditions, using single quotes for string literals.
Sort query results using ORDER BY with ASC/DESC on one or multiple columns to perform nested sorting for top-N or bottom-N analysis.
Aggregate column values per category using GROUP BY with aggregate functions like SUM, understanding how rows are combined and aggregated.
Apply the HAVING clause after GROUP BY to filter groups based on aggregate conditions, distinguishing it from WHERE which filters rows before aggregation.
Map the logical execution order (FROM → WHERE → GROUP BY → HAVING → SELECT/DISTINCT → ORDER BY → TOP) to the written SQL syntax order to build correct queries.
Run multiple queries separated by semicolons, select static values without a FROM clause, mix static and database columns, and execute only highlighted portions of a script.
Create tables with appropriate data types (INT, DECIMAL, CHAR/VARCHAR, DATE/TIME) and constraints (NOT NULL, PRIMARY KEY), alter tables to add/drop columns, and drop tables entirely.
Insert rows manually with VALUES (matching column order and handling nullable columns), and insert data from a source table using INSERT INTO ... SELECT to move data between tables.
Update existing rows using UPDATE ... SET ... WHERE, always test the WHERE condition with a SELECT first to target only intended rows, and update multiple columns in one statement.
Delete specific rows with DELETE ... WHERE after verifying with SELECT, and use TRUNCATE TABLE to remove all rows quickly without logging individual deletions.
Build conditions using comparison operators (=, !=, >, >=, <, <=), combine them with AND (all true), OR (at least one true), and reverse logic with NOT.
Use BETWEEN for inclusive range checks (or rewrite with comparison + AND), IN for membership in a value list, and LIKE with % and _ wildcards for pattern matching on strings.
Understand the difference between combining columns (joins) and rows (set operators), and learn to query two tables separately without joining them.
Write inner join queries to return only matching rows from two tables using a common key column.
Explain how SQL executes an inner join step by step and use it to recombine data or filter rows by existence checks.
Write left join queries to return all rows from the left table and matching rows from the right, using table aliases to avoid column ambiguity.
Trace how SQL processes a left join, preserving all left-table rows and filling non-matches with NULLs.
Write right join queries, understand table-order sensitivity, and rewrite them as left joins by swapping table positions.
Write full join queries to return all rows from both tables, with NULLs where no match exists, and verify order independence.
Combine left join with a WHERE clause (right key IS NULL) to return only unmatched rows from the left table.
Implement right anti-join (left key IS NULL) and full anti-join (OR condition on both keys) to find unmatched rows on either or both sides.
Use CROSS JOIN to generate all row combinations without a join condition, and recognize its performance implications.
Apply a decision framework to choose among inner, left, full, left anti, full anti, and cross joins based on matching, priority, and unmatched-data needs.
Replicate inner join results without using INNER JOIN by applying LEFT JOIN and filtering with WHERE right_key IS NOT NULL.
Combine query results vertically with UNION/UNION ALL/EXCEPT/INTERSECT, ensuring equal column counts, matching data types, and column order.
Control output column names and data types via the first query; avoid silent data corruption by mapping columns by position, not by name.
Use UNION to combine rows without duplicates and UNION ALL for faster performance when duplicates are acceptable or impossible.
Apply EXCEPT to find new records in incremental loads (delta detection) and to verify completeness when migrating data between databases.
Learner will be able to distinguish between date, time, and datetime/timestamp data types and identify their components in SQL Server.
Learner will be able to identify and use the three sources of date values: stored columns, hardcoded strings, and the GETDATE() function.
Learner will be able to extract year, month, and day as integers from a date or datetime column using YEAR(), MONTH(), and DAY().
Learner will be able to extract parts such as quarter, week, weekday, hour, and minute as integers using DATEPART with part abbreviations.
Learner will be able to retrieve month names and weekday names as strings using DATENAME for readable reporting.
Learner will be able to reset lower-level date/time components to their minimum values using DATETRUNC for grouping and aggregation at different granularities.
Learner will be able to return the last day of the month for any date using EOMONTH.
Learner will be able to customize date and number output as strings using FORMAT with specifiers and optional culture for reporting and standardization.
Learner will be able to customize date and number output as strings using FORMAT with specifiers and optional culture for reporting and standardization.
Learner will be able to customize date and number output as strings using FORMAT with specifiers and optional culture for reporting and standardization.
Learner will be able to change data types and optionally apply style formats using CONVERT for casting and formatting in one step.
Learner will be able to convert values from one data type to another using CAST for data preparation and type safety.
Understand the CASE WHEN THEN ELSE END syntax, how SQL evaluates conditions top-down, and why result data type matching data types of all result branches must match.
Create a new category column with CASE then aggregate sales per category using a subquery and ORDER BY to produce a ranked report.
Translate coded values such as gender flags or country names into human-readable text using CASE with explicit conditions or the shorthand CASE column WHEN value THEN result form.
Replace NULL scores with zero inside a window AVG to avoid skewed averages demonstrating CASE for data-quality cleanup before analytics.
Count orders per customer where sales exceed 30 by flagging rows with CASE then summing the flags with a window function.
Distinguish window functions from GROUP BY learn the OVER clause components partition order frame and the three function families aggregate ranking value.
Use PARTITION BY to split data into independent windows understand the default frame ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW when ORDER BY is present.
Define custom frame boundaries with PRECEDING FOLLOWING UNBOUNDED to create rolling totals moving averages and other sliding-window analytics.
Understand the two ranking approaches—integer-based (discrete ranks) and percentage-based (continuous 0–1 scale)—and when to use each for top-N or distribution analysis.
Use ROW_NUMBER to assign a unique sequential rank to each row, ignoring ties and leaving no gaps.
Apply RANK to give tied rows the same rank while skipping subsequent ranks (Olympic-style).
Apply ROW_NUMBER for top-N per group, generating unique row IDs, pagination, and identifying/removing duplicate rows.
Use NTILE to split rows into roughly equal buckets for customer segmentation or ETL load balancing.
Understand how CUME_DIST (inclusive) and PERCENT_RANK (exclusive) compute continuous 0–1 percentile ranks for distribution analysis.
Calculate cumulative distribution step by step, seeing how ties share the last position's percentage.
Compute percent rank using (position-1)/(N-1), compare inclusivity vs exclusivity, and choose the right function.
Master LEAD/LAG arguments: expression, optional offset (default 1), optional default value for NULLs.
Walk through a month-by-month sales example showing how LEAD fetches next month and LAG fetches previous month, handling ties.
Aggregate sales per month, use LAG to bring prior-month sales into the same row, compute absolute and percentage change.
Use LEAD to get each customer's next order date, compute days between orders with DATEDIFF, average per customer, and rank loyalty with RANK.
Use FIRST_VALUE (default frame works) and LAST_VALUE (requires ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) to get first/last row values per partition.
Partition by product, order by sales ascending, use FIRST_VALUE for minimum and LAST_VALUE with custom frame for maximum; compare with MIN/MAX aggregates.
Understand server-side components: engine, disk storage (slow, permanent), cache (fast, temporary), system catalog (metadata in INFORMATION_SCHEMA), and TempDB for temporary tables.
Explain how subqueries centralize logic, avoid repeated joins/calculations, and simplify maintenance across analysts, engineers, and scientists.
Contrast non-correlated subqueries (execute once, cache result, fast) with correlated subqueries (execute once per outer row, dynamic, slower).
Use a table subquery in FROM to create a derived table, join it with other tables, and aggregate per customer.
Place a scalar subquery in SELECT to add a repeated aggregate (e.g., total orders) alongside detail columns; error if subquery returns >1 value.
Join a base table with a subquery result (e.g., customer details + order counts) using LEFT JOIN to preserve all customers.
Filter main table by comparing a column to a scalar subquery result (e.g., price > average price) using =, <>, >, <, >=, <=
Use IN with a row subquery returning a list (e.g., customer IDs from Germany) for dynamic filtering; also show NOT IN.
Compare a value to ALL or ANY values from a subquery (e.g., female salary > ANY male salary vs > ALL male salaries).
Detail how correlated subqueries reference outer-query columns, execute per row, enable dynamic filters (e.g., count orders per customer), but cost more than non-correlated.
Use EXISTS with a correlated subquery (SELECT 1 FROM ... WHERE outer_id = inner_id) to keep rows where the subquery returns at least one row; contrast with IN/ANY.
Understand what a CTE is, how it creates a temporary virtual table, and why it improves readability, modularity, and reusability compared to subqueries.
Distinguish CTEs from subqueries by writing direction (top-down vs bottom-up) and the ability to reuse CTE results multiple times in the main query.
Write a standalone CTE using the WITH clause, reference it in the main query, and observe the execution flow where the CTE result is cached for fast reuse.
Define multiple independent CTEs separated by commas after the initial WITH, then combine their results in the main query.
Create a CTE that references the result of a previous CTE, forming a chain of dependent intermediate results before the main query.
Build a recursive CTE with an anchor query (executed once) and a recursive query (loops via UNION ALL and self-reference) to generate sequences or traverse hierarchies.
Limit recursive CTE iterations using OPTION (MAXRECURSION n) to prevent infinite loops and control performance.
Define a view as a persisted virtual table using CREATE VIEW, understand it stores logic not data, and compare performance, mutability, and maintenance against physical tables.
Choose views for logic reused across many queries (project-wide reusability) and CTEs for logic needed only within a single query (zero maintenance).
Aggregate orders by month using a CTE, then persist the logic as a view (sales.v_monthly_summary) so multiple analysts can query it without rewriting aggregations.
Aggregate orders by month using a CTE, then persist the logic as a view (sales.v_monthly_summary) so multiple analysts can query it without rewriting aggregations.
Aggregate orders by month using a CTE, then persist the logic as a view (sales.v_monthly_summary) so multiple analysts can query it without rewriting aggregations.
Aggregate orders by month using a CTE, then persist the logic as a view (sales.v_monthly_summary) so multiple analysts can query it without rewriting aggregations.
Aggregate orders by month using a CTE, then persist the logic as a view (sales.v_monthly_summary) so multiple analysts can query it without rewriting aggregations.
Compare subqueries, CTEs, temporary tables, views, and CTAS across storage, lifetime, scope, reusability, and data freshness to choose the right technique for a given scenario.
Explain what stored procedures are, how they differ from ad-hoc queries and Python scripts, and demonstrate the basic CREATE PROCEDURE syntax with BEGIN/END blocks.
Walk through turning a recurring SELECT query into a stored procedure, creating it in the database, and executing it with EXEC.
Replace static filter values with input parameters, define parameter data types, and use ALTER PROCEDURE to update the procedure definition.
Set default values for parameters so the procedure runs without explicit input, and understand how caller-supplied values override defaults.
Combine multiple SELECT statements in one procedure, use semicolons for readability, declare and assign variables with DECLARE and SELECT, and concatenate variable values into printable messages.
Implement conditional logic using IF EXISTS ... BEGIN ... END ELSE BEGIN ... END to avoid unnecessary updates and improve efficiency.
Wrap procedure code in TRY/CATCH blocks, customize error messages using ERROR_MESSAGE(), ERROR_NUMBER(), ERROR_LINE(), and ERROR_PROCEDURE(), and test with a divide-by-zero error.
Use indentation (tabs) and comment headers to structure procedure code into logical steps (data preparation, report generation, error handling) for readability and maintenance.
Define triggers as automatic responses to table events (INSERT, UPDATE, DELETE), distinguish AFTER vs INSTEAD OF triggers, and show the CREATE TRIGGER syntax with the virtual INSERTED table.
Create a log table and an AFTER INSERT trigger on the employees table that writes audit records using the INSERTED virtual table and CAST for string concatenation.
Explain heap structure, clustered index (B-tree with data at leaf level, physically sorts data, one per table), and nonclustered index (separate B-tree with pointers, many per table), and compare read/write performance and storage trade-offs.
Demonstrate CREATE CLUSTERED INDEX and CREATE NONCLUSTERED INDEX syntax, naming conventions, dropping indexes, and verifying index properties in Object Explorer.
Contrast rowstore vs columnstore organization, explain compression and storage savings, show CREATE CLUSTERED COLUMNSTORE INDEX syntax (no column list), and note the one-columnstore-index-per-table limit in SQL Server.
Create three copies of a fact table (heap, clustered rowstore, clustered columnstore), measure data and index space, and conclude columnstore uses the least storage due to compression.
Define unique indexes for data integrity and query optimization, explain the write-performance trade-off, show CREATE UNIQUE syntax, and demonstrate filtered indexes with WHERE clause to index only a subset of rows.
Learner will be able to read actual execution plans to identify performance bottlenecks like table scans, sorts, and key lookups.
Learner will be able to compare execution plans of heap and clustered index tables to see the impact of indexes on scans and sorting.
Learner will be able to create nonclustered indexes, recognize index seeks, and explain when key lookups occur in execution plans.
Learner will be able to interpret execution plans for queries with joins and aggregations, identifying the most costly operations.
Learner will be able to create and evaluate clustered columnstore indexes on large fact tables to dramatically reduce I/O and CPU cost.
Learner will be able to save and compare execution plans to quantitatively assess indexing and storage changes.
Learner will be able to use query hints (OPTION, FORCESEEK, USE INDEX) to override the optimizer, and understand the risks of using hints as permanent fixes.
Learner will be able to explain why overindexing hurts write performance and confuses the optimizer, and articulate a disciplined indexing strategy.
Learner will be able to apply a four-phase indexing strategy: initial design by workload type, usage-pattern analysis, scenario-based tuning, and ongoing monitoring.
Learner will be able to explain how horizontal partitioning by date improves query performance, index maintenance, and enables parallel processing.
Learner will be able to create partition functions with range boundaries, choose LEFT/RIGHT semantics, and map filegroups to physical .ndf files.
Learner will be able to attach a partition scheme to a table, insert test rows, and verify that rows land in the correct partitions.
Learner will be able to apply core query-writing tips: avoid SELECT *, unnecessary DISTINCT/ORDER BY, use TOP for exploration, and index WHERE columns.
Learner will be able to rewrite WHERE clauses to avoid functions on indexed columns and leading wildcards so that indexes remain usable.
Learner will be able to choose efficient join types, force join order with hints, index join keys, filter before joining large tables, and aggregate before joining.
Learner will be able to replace OR chains with IN, use UNION ALL over UNION for large sets, and eliminate redundant subqueries using CTEs or window functions.
Learner will be able to use columnstore indexes for large aggregations and pre-aggregate in CTEs before joining dimension tables.
Learner will be able to enforce naming conventions, optimal data types, constraints, primary/foreign keys, and schedule weekly stats updates and index reorganization.
Understand what a data warehouse is, its four key characteristics (subject-oriented, integrated, time-variant, non-volatile), and why companies need it to solve manual reporting problems.
Explain the automated ETL-based data warehouse architecture, the roles of data engineers and analysts, and how it enables fast, integrated, historical reporting from a single point of truth.
Define the three steps of ETL (Extract, Transform, Load), their purposes, and how partial ETL patterns (EL, TL, LT) are used across data architecture layers.
Identify extraction methods (pull/push, full/incremental), transformation types (cleansing, integration, normalization, enrichment, aggregation, business rules), and load strategies (batch/stream, full/incremental, SCD types 0-2).
Set up the project environment by downloading datasets, SQL Server, SSMS, Draw.io, and Notion; then create a project plan with epics, tasks, relations, and progress tracking.
Analyze project requirements to choose the medallion architecture (bronze/silver/gold) over Kimball, Inmon, or Data Vault, and design the three-layer architecture with source and consumer layers in Draw.io.
Define snake_case naming conventions for all project objects with layer-specific rules (source_entity for bronze/silver, category_entity for gold) and technical column prefixes (DWH_), then create a GitHub repository with MIT license and Notion-linked structure.
Create DDL scripts for six bronze tables (three per source system) with existence checks, then load CSV data using BULK INSERT with proper file paths, field terminators, and first-row skipping.
Convert bronze loading scripts into a stored procedure (bronze.load_bronze) with structured print messages, TRY/CATCH error handling, and per-table duration tracking using GETDATE().
Generate silver layer DDL by replacing bronze schema references, then add metadata columns (DWH_create_date with DEFAULT GETDATE()) to track record lineage and loading timestamps.
Detect and resolve primary key duplicates and nulls in bronze CRM customer info using ROW_NUMBER() partitioning, trim whitespace, normalize gender/marital status codes, and handle missing values with 'Not Available'.
Derive category_id and product_key from product_key string, normalize product_line abbreviations, fix overlapping start/end dates using LEAD() window function, and cast datetime to date.
Handle null/negative costs with ISNULL, normalize product_line codes, validate sales quantities and prices, and ensure referential integrity with product and customer keys.
Clean ERP customer IDs by removing 'NAS' prefix, handle future birth dates and inconsistent gender values (null, empty, M/F, male/female), and normalize country codes with trimming and case mapping.
Map ERP product category abbreviations (M, R, S, T) to full names, handle missing values, and clean location data by removing hyphens from customer IDs for cross-system joins.
Document table relationships in Draw.io using primary/foreign keys, identify join paths between CRM and ERP systems via customer keys, and visualize source-specific table groups.
Create silver.load_silver stored procedure with structured logging, error handling, and duration tracking; validate silver data quality; commit all scripts to Git repository with Notion task tracking.
Understand conceptual, logical, and physical data models and choose the star schema for the gold layer.
Integrate CRM and ERP customer data using left joins, resolve gender conflicts with a master-system rule, and validate uniqueness.
Generate surrogate keys with ROW_NUMBER, rename columns to snake_case, reorder for readability, and create the gold view.
Join fact sales with product and customer dimensions to replace business keys with surrogate keys, then create the fact view.
Run uniqueness and referential-integrity checks, save scripts to the gold folder, and commit to the Git repository.
Extend the lineage diagram to the gold layer, build a data catalog describing dimensions and facts, and finalize documentation.
Restore the analytics database, then classify every column as a dimension or measure by testing if it is numeric and aggregatable.
Query system tables to list tables, columns, and row counts; then split measures by dimensions (country, gender, category) to generate insights.
Rank top/bottom performers using TOP N and ROW_NUMBER/RANK window functions; combine multiple key metrics into a single overview query.
Aggregate sales by month/year, compute running totals with SUM() OVER (ORDER BY), partition by year for yearly resets, and calculate moving averages.
Compare current sales to average sales (AVG() OVER PARTITION BY) and to prior-year sales (LAG) to flag above/below average and year-over-year change.
Calculate each category's revenue as a percentage of total revenue using SUM() OVER () window aggregate to identify dominant categories.
Derive customer lifespan (months between first/last order) and total spending, then segment into VIP, Regular, New using CASE WHEN and aggregate counts.
Construct a modular report with CTEs: base query (fact + dimensions, filters, derived columns), aggregation CTE (lifespan, totals), and final CTE (segments, KPIs, age groups).
Review the three project types (Data Warehouse, EDA, Advanced Analytics), commit final scripts, and receive guidance on continuing the SQL journey.