Data Types & Type Conversion: Overview
Module: SQL Fundamentals
Master the five SQL type families: numeric, string, date/time, boolean, and JSON
DECIMAL vs FLOAT: why binary float breaks financial calculations (0.1 + 0.2 ≠ 0.3)
Implicit conversion in WHERE: the silent index killer — 100× slowdown on 5M rows
Explicit conversion: CAST, CONVERT, TRY_CAST, PostgreSQL :: shorthand — when each is right
TIMESTAMPTZ vs DATETIME: storing UTC and converting to local time for global apps
JSON types across 4 engines: PostgreSQL JSONB (GIN indexed) vs SQL Server / MySQL / Oracle
Type sizing: INT vs BIGINT vs SMALLINT — bytes, ranges, and overflow risks
Choose types for performance: VARCHAR(50) vs TEXT, CHAR vs VARCHAR, INT vs BIGINT
Master the five SQL type families: numeric, string, date/time, boolean, and JSON
DECIMAL vs FLOAT: why binary float breaks financial calculations (0.1 + 0.2 ≠ 0.3)
Implicit conversion in WHERE: the silent index killer — 100× slowdown on 5M rows
Explicit conversion: CAST, CONVERT, TRY_CAST, PostgreSQL :: shorthand — when each is right
TIMESTAMPTZ vs DATETIME: storing UTC and converting to local time for global apps
JSON types across 4 engines: PostgreSQL JSONB (GIN indexed) vs SQL Server / MySQL / Oracle
Type sizing: INT vs BIGINT vs SMALLINT — bytes, ranges, and overflow risks
Choose types for performance: VARCHAR(50) vs TEXT, CHAR vs VARCHAR, INT vs BIGINT