PrepZone Logo
PrepZone
Back to Database

Database · Medium

How do you choose column data types? CHAR vs VARCHAR vs TEXT, NUMERIC vs FLOAT, INT sizing.

DatabaseSchema DesignSenior

Answer preview

Pick the narrowest type that can represent every valid value and reject invalid ones — the type is your first and cheapest constraint. Narrow types mean more rows per page, so less I/O, smaller indexes, and better cache hit rates; wrong types mean silent corruption such as roundi…