MySQL & InnoDB (50 Qs)•Part 1: Basic & Foundational Concepts (Junior / Entry-Level)
What are the common MySQL numeric and string data types (INT vs BIGINT, VARCHAR vs CHAR)?
junior LevelDatabases & SQLMySQL
In Simple Words:
CHAR(N): Fixed length (allocates space for $N$ characters). Padded with spaces. Fast for fixed-size strings (e.g. UUID, country codeUS, MD5 hash).VARCHAR(N): Variable length (allocates only actual characters + 1 or 2 bytes for length prefix). Saves disk space; best for variable text like names or addresses.INT: 4 bytes ($-2.14$ billion to $+2.14$ billion).BIGINT: 8 bytes ($-9.22 \times 10^{18}$ to $+9.22 \times 10^{18}$). Always use for primary keys in high-volume tables to avoid ID exhaustion.