SQA Tools Blog

Learn testing and automation, one article at a time

Free tutorials, solved practice problems and interview prep for QA and automation engineers: Python, Playwright, Selenium, SQL, Git and more.

1,677Articles
1,141Solved Python problems
7Topics
100%Free

SQL articles

61 articles · page 2 of 6 · Clear filters
SQL

SQL Project: E-commerce Sales Analysis

A complete SQL portfolio project: analyse a year of online shop orders in MySQL. Revenue, monthly trend, top products, margins, repeat buyers, RFM, cohorts.

24 min readRead →
SQL

SQL Project: HR and Payroll Analytics

An HR analytics SQL project: headcount and attrition, current salaries from history, raises with LAG, top earners, org chart with a recursive CTE, tenure.

27 min readRead →
SQL

SQL Stored Procedures

Learn MySQL stored procedures step by step: CREATE PROCEDURE, DELIMITER, IN and OUT parameters, variables, IF and loops, error handling and transactions.

10 min readRead →
SQL

Database Normalization (1NF, 2NF, 3NF)

Database normalization step by step: anomalies, 1NF, 2NF, 3NF and BCNF, normalizing a messy orders table into related tables, and when to denormalize.

9 min readRead →
SQL

SQL INTERSECT and EXCEPT

Find rows common to two queries with INTERSECT and rows in one but not the other with EXCEPT, supported in MySQL 8.0.31+, plus the JOIN and EXISTS alternatives.

4 min readRead →
SQL

SQL Joins Explained

SQL joins explained visually and step by step: INNER, LEFT, RIGHT, FULL OUTER, CROSS and SELF JOIN on the same two tables, with real MySQL results.

8 min readRead →
SQL

SQL LAG and LEAD Functions

Compare a row with the previous or next row using SQL LAG and LEAD: month-over-month change, gaps between orders, defaults, offsets, FIRST_VALUE and LAST_VALUE.

9 min readRead →
SQL

SQL Injection and Prepared Statements

How SQL injection works, shown on a demo login table, and how to prevent it with prepared statements in MySQL and Python, plus a QA testing checklist.

7 min readRead →
SQL

SQL Indexes

Learn SQL indexes in MySQL: how a B-tree index speeds up queries, CREATE INDEX, composite indexes, the leftmost-prefix rule, and when an index is not used.

9 min readRead →
SQL

SQL EXISTS, ANY and ALL

Learn SQL EXISTS and NOT EXISTS for checking related rows, why NOT EXISTS beats NOT IN with NULLs, and how ANY and ALL compare a value with a…

7 min readRead →
SQL

SQL EXPLAIN and Query Optimization

Read MySQL EXPLAIN output column by column, use EXPLAIN ANALYZE and EXPLAIN FORMAT=TREE, and apply 10 practical SQL query optimization tips with real examples.

7 min readRead →
SQL

SQL User-Defined Functions

Create your own MySQL functions with CREATE FUNCTION: parameters, RETURNS, DETERMINISTIC, using functions in queries, and function vs stored procedure.

6 min readRead →

Preparing for a QA interview?

Take free timed mock tests with answers and explanations.