Here’s a quick cheat sheet for common data types and their storage sizes across popular relational databases (like MySQL, PostgreSQL, and SQL Server). Keep in mind that the sizes listed are typical, but some nuances or variations might apply based on specific DBMS configurations.
Data Type | Description | Storage Size (in bytes) |
---|---|---|
TINYINT | Integer between -128 and 127 (signed) | 1 |
SMALLINT | Integer between -32,768 and 32,767 (signed) | 2 |
MEDIUMINT | Integer between -8,388,608 and 8,388,607 | 3 |
INT/INTEGER | Integer between -2,147,483,648 and 2,147,483,647 | 4 |
BIGINT | Large integer between -9 quintillion to +9 quintillion | 8 |