🆕 Free Interactive Selenium, Playwright & API tools — no signup — Start Free Automation Roadmap →
📁
All Topics › SQL for Testers

SQL for Testers

SQL tutorials for testers: SELECT, joins, DDL and DML, subqueries, transactions and test data checks.

24 Articles
14 Beginner
5 Intermediate
5 Advanced
Intermediate 📅 Oct 5, 2026 👁 38 views

SQL Window Functions: ROW_NUMBER, RANK, LAG/LEAD, NTILE and Frame Clauses

SQL window functions with examples: ROW_NUMBER, RANK, DENSE_RANK, LAG, LEAD, NTILE, PERCENT_RANK, FIRST/LAST_VALUE and ROWS vs RANGE frames.

Intermediate 📅 Oct 5, 2026 👁 30 views

SQL CTEs and Recursive CTEs: WITH Clause Explained with Examples

Common Table Expressions in SQL: WITH syntax, chaining CTEs, CTE vs subquery vs temp table, and recursive CTEs for hierarchies and date series.

Beginner 📅 Oct 5, 2026 👁 24 views

SQL String Functions: CONCAT, SUBSTRING, REPLACE, TRIM and String Problems

SQL string functions with examples, plus common string problems: validating emails, extracting domains, cleaning phone numbers, parsing and formatting names.

Intermediate 📅 Oct 5, 2026 👁 24 views

SQL Date Functions and Date Edge Cases: Working Days, Month-End, Fiscal Year, Time Zones

SQL date functions with examples, plus the edge cases interviewers ask: working days, last day of month, fiscal years, and time zones (TIMESTAMP vs DATETIME).

Beginner 📅 Oct 5, 2026 👁 34 views

SQL NULL Handling: COALESCE, IFNULL, NULLIF, NOT IN Traps and COUNT(*)

How SQL handles NULL: IS NULL, COALESCE, IFNULL, NULLIF, numeric functions, and the traps behind wrong results: NOT IN with NULLs, COUNT(*) vs COUNT(col).

Beginner 📅 Oct 5, 2026 👁 32 views

SQL CASE WHEN, UNION vs UNION ALL and Pivot Queries

SQL CASE WHEN with examples (categories, conditional counts), UNION vs UNION ALL, and pivoting rows into columns with CASE inside aggregate functions.

Intermediate 📅 Oct 5, 2026 👁 31 views

Semi-Joins and Anti-Joins in SQL: EXISTS, NOT EXISTS, IN, ANY and ALL

Semi-joins and anti-joins in SQL: EXISTS vs IN vs JOIN, NOT EXISTS vs NOT IN vs LEFT JOIN IS NULL, ANY and ALL, and a decision tree for choosing.

Advanced 📅 Oct 5, 2026 👁 30 views

SQL Query Anti-Patterns: Non-Sargable Queries, N+1, Cartesian Joins and SELECT *

SQL anti-patterns that slow queries or break results: non-sargable predicates, the N+1 problem, Cartesian explosions, SELECT * and reading EXPLAIN plans.

Advanced 📅 Oct 5, 2026 👁 33 views

SQL UPSERT, MERGE, LATERAL Joins and Materialized Views

UPSERT in MySQL and PostgreSQL, MERGE in SQL Server and Oracle, LATERAL joins and CROSS APPLY for top-N per row, and materialized views with refresh strategies.

Advanced 📅 Oct 5, 2026 👁 20 views

SQL for Data Warehousing: SCD Types 1, 2, 3, Star vs Snowflake Schema, ROLLUP and CUBE

Data warehouse SQL: slowly changing dimensions (SCD Type 1, 2, 3), OLTP vs OLAP, star vs snowflake schema, and ROLLUP, CUBE and GROUPING SETS.

Advanced 📅 Oct 5, 2026 👁 38 views

SQL for Data Analytics: KPI, Retention, Cohort and Funnel Queries

Analytics SQL with examples: KPI queries, day-1 and day-7 retention, cohort analysis, conversion funnels, and monthly active users (MAU).

Advanced 📅 Oct 5, 2026 👁 28 views

SQL Gaps and Islands: Consecutive Days, Streaks and Missing Values

Solve SQL gaps and islands problems: consecutive login streaks with the ROW_NUMBER trick, missing IDs and dates in a sequence, and longest winning streaks.

Intermediate 📅 Oct 5, 2026 👁 29 views

SQL Practice Projects: E-Commerce, Banking and Social Media Databases with Queries

Three SQL practice projects with schemas and real queries: an e-commerce store, a banking system and a social media app, for portfolio and interview practice.

Beginner 📅 Oct 4, 2026 👁 33 views

DDL Commands in SQL: CREATE, ALTER, DROP, TRUNCATE and RENAME (with Examples)

DDL commands in SQL with examples: CREATE, ALTER, DROP, TRUNCATE and RENAME, DDL vs DML vs DCL vs TCL, and why TRUNCATE can't be rolled back.

Beginner 📅 Jul 9, 2026 👁 158 views

Scenario-Based SQL Questions for Testers (With Sample Answers)

Real-world SQL scenarios for QA — verifying inserts, UI vs DB validation, user-wise bug counts, foreign key checks, and manual database testing, with answers.

Beginner 📅 Jul 9, 2026 👁 165 views

SQL Performance & Optimization: Query Tuning and Indexing

Learn SQL performance tuning — SQL query optimization, how indexing helps, analyzing slow queries with EXPLAIN, and database testing tools — for QA and SDET.

Beginner 📅 Jul 9, 2026 👁 83 views

Common SQL Queries for Testers (Bug Counts, Test Cases & More)

Practical SQL queries for QA — count bugs in the last 7 days, find users who didn't log in, fetch test cases by module, and count bugs per developer.

Beginner 📅 Jul 9, 2026 👁 111 views

Advanced SQL Concepts: Views, Indexes, Normalization, Procedures

Advanced SQL for testers: views vs tables, indexes, normalization (1NF–3NF), stored procedures, triggers and functions — with examples run on MariaDB.

Beginner 📅 Jul 9, 2026 👁 114 views

SQL INSERT, UPDATE, DELETE, Transactions & ACID Explained

Learn SQL data modification — INSERT, UPDATE, DELETE with WHERE, transactions, COMMIT and ROLLBACK, and ACID properties — with clear examples.

Beginner 📅 Jul 9, 2026 👁 105 views

SQL Subqueries Explained: Correlated, Nth-Highest Salary & More

Learn SQL subqueries — correlated vs non-correlated, finding the second/nth highest salary, above-average queries, and ORDER BY in subqueries.

View all 24 SQL for Testers articles on one page →