MySQL

DELETE VS TRUNCATE VS DROP

Aspect DELETE TRUNCATE DROP What it does Removes selected rows Removes all rows (empties table) Removes the table object itself (schema + data) WHERE clause ✅ Yes ❌ No ❌...

DELETE VS TRUNCATE VS DROP

Aspect DELETE TRUNCATE DROP What it does Removes selected rows Removes all rows (empties table) Removes the table object itself (schema + data) WHERE clause ✅ Yes ❌ No ❌...

SQL Cursor?

A cursor lets you iterate row-by-row over a query result and run procedural logic per row. Useful when set-based SQL can’t express the logic or when you must call side-effects per...

SQL Cursor?

A cursor lets you iterate row-by-row over a query result and run procedural logic per row. Useful when set-based SQL can’t express the logic or when you must call side-effects per...

SQL constraints

Rules the database enforces to keep your data valid and consistent. Core types NOT NULL – column must have a value. CHECK – boolean rule must be true.MySQL: enforced from 8.0.16+...

SQL constraints

Rules the database enforces to keep your data valid and consistent. Core types NOT NULL – column must have a value. CHECK – boolean rule must be true.MySQL: enforced from 8.0.16+...

TRUNCATE in MySQL

1. Definition TRUNCATE is a DDL (Data Definition Language) command used to remove all rows from a table. Unlike DELETE, it is faster and uses less system resources, because: It doesn’t...

TRUNCATE in MySQL

1. Definition TRUNCATE is a DDL (Data Definition Language) command used to remove all rows from a table. Unlike DELETE, it is faster and uses less system resources, because: It doesn’t...

MySQL Data Types

MySQL data types are grouped into 3 main categories: 🔹 1. Numeric Data Types (A) Integer Types Type Storage Range (Signed) Example TINYINT 1 byte -128 to 127 Age, flags SMALLINT...

MySQL Data Types

MySQL data types are grouped into 3 main categories: 🔹 1. Numeric Data Types (A) Integer Types Type Storage Range (Signed) Example TINYINT 1 byte -128 to 127 Age, flags SMALLINT...

MySQL Operators and Clauses

🔹 1. Operators in MySQL (A) Arithmetic Operators Used for calculations. SELECT 10 + 5; -- 15 SELECT 10 - 5; -- 5 SELECT 10 * 5; -- 50 SELECT 10...

MySQL Operators and Clauses

🔹 1. Operators in MySQL (A) Arithmetic Operators Used for calculations. SELECT 10 + 5; -- 15 SELECT 10 - 5; -- 5 SELECT 10 * 5; -- 50 SELECT 10...