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

Python practice articles

1,137 articles · page 1 of 95 · Clear filters
Python practice

Python SQLite Programs with Solutions

20 Python sqlite3 programs with solutions: create tables, insert, select, update, delete, joins, group by, transactions and CSV export, each explained.

2 min readRead →
Python practice

Query into pandas

Write a Python program to load a query result into a pandas DataFrame. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Why parameters prevent SQL injection

Write a Python program that shows how an f-string query is unsafe and a parameter is safe. Step-by-step explanation, colour-coded code and real output.

2 min readRead →
Python practice

Export a table to CSV

Write a Python program to export a table to a CSV file. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Top N rows

Write a Python program to get the top 3 scores. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Search with LIKE

Write a Python program to find products whose name contains a word. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Column names of a query

Write a Python program to print the column names of a query result. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Use a database file

Write a Python program that saves data to a .db file and reads it back with a new connection. Step-by-step explanation, colour-coded code and real output.

2 min readRead →
Python practice

Transaction with rollback

Write a Python program that transfers money between accounts and rolls back on error. Step-by-step explanation, colour-coded code and real output.

2 min readRead →
Python practice

Customers without orders

Write a Python program to find customers who have not placed any order. Step-by-step explanation, colour-coded code and real output.

2 min readRead →
Python practice

Join two tables

Write a Python program to list each order with the customer's name. Step-by-step explanation, colour-coded code and real output.

2 min readRead →
Python practice

Group by

Write a Python program to count employees and average salary per department. Step-by-step explanation, colour-coded code and real output.

1 min readRead →

Preparing for a QA interview?

Take free timed mock tests with answers and explanations.