Data Cleaning in SQL: A Step-by-Step Guide (With Real Examples)
Learn data cleaning in SQL step by step: trim spaces, turn blanks into NULL, fix text numbers and mixed date formats, and remove duplicates, with SQL Server and MySQL examples.
Learn data cleaning in SQL step by step: trim spaces, turn blanks into NULL, fix text numbers and mixed date formats, and remove duplicates, with SQL Server and MySQL examples.
How SQL DISTINCT removes duplicate rows (and why it applies to every selected column), how it treats NULL, COUNT(DISTINCT), and how to use column and table aliases, including why an alias works in ORDER BY but not in WHERE.
Search text with LIKE, match a list with IN and filter ranges with BETWEEN, with simple examples, the NOT IN NULL trap and the date BETWEEN mistake that hides rows.
The SQL string functions you’ll use most in SQL Server and MySQL: CONCAT, LEN, TRIM, SUBSTRING, CHARINDEX, REPLACE and STRING_AGG, plus the NULL trap that blanks whole results.
The date functions you’ll use most in SQL Server and MySQL: current date, DATEADD, DATEDIFF, month end and formatting, plus the BETWEEN mistake that makes monthly totals wrong.
Understand how SQL injection happens and how to prevent it with parameterised queries in PHP, Laravel, Delphi and C#, plus extra defences.
How database backups work: full, differential and log backups, point-in-time restore, the 3-2-1 rule, and commands for SQL Server, MySQL and PostgreSQL.
Learn what SQL triggers are, how to write them in SQL Server, MySQL and PostgreSQL, and when they help or hurt, with a price history example.
A practical guide to SQL data types: numbers, text, dates and more, with differences between SQL Server, MySQL and PostgreSQL.
Learn what stored procedures are, how to create and run them in SQL Server, MySQL and PostgreSQL, and when they are worth using.