You enter "12345678901234" in a phone field. The UI accepts it. But the database column is INT (max ~2 billion). The value gets silently truncated or causes an overflow error. This is why data types matter. Every column has a type, and that type defines what it can hold. As a tester, knowing data types helps you find boundary bugs.
| Type | What It Stores | Max Value / Size | QA Test Ideas |
|---|---|---|---|
| INT | Whole numbers | ~2.1 billion | Try values > 2147483647 |
| BIGINT | Large whole numbers | ~9.2 quintillion | For IDs that grow fast |
| DECIMAL(10,2) | Exact numbers | 99999999.99 | Test financial amounts |
| VARCHAR(n) | Text up to n chars | Defined by n | Enter n+1 characters |
| TEXT | Long text (no limit) | ~65K to 4GB | Paste a huge paragraph |
| DATE | Date only | 9999-12-31 | Try Feb 29, year 0000 |
| DATETIME | Date + time | 9999-12-31 23:59:59 | Test timezone edge cases |
| BOOLEAN | True/False | true or false | What happens with NULL? |
| JSON/JSONB | Structured data | Varies | Malformed JSON, nested depth |
-- Check the data types of all columns in a table (MySQL)
DESCRIBE users;
-- Check data types (PostgreSQL)
SELECT column_name, data_type, character_maximum_length,
is_nullable, column_default
FROM information_schema.columns
WHERE table_name = 'users'
ORDER BY ordinal_position;
-- Find columns that might have wrong types
-- (e.g., phone stored as INT instead of VARCHAR)
SELECT column_name, data_type
FROM information_schema.columns
WHERE table_name = 'users'
AND column_name IN ('phone', 'zip_code', 'account_number')
AND data_type IN ('int', 'integer', 'bigint');Phone numbers, zip codes, and account numbers should always be VARCHAR, never INT. Leading zeros get stripped from integers — zip code "07001" becomes 7001. This is a common bug worth checking.
Q: What is the difference between CHAR, VARCHAR, and TEXT?
A: CHAR(10) always uses 10 bytes, even if you store "Hi" — it pads with spaces. VARCHAR(10) uses only what is needed — "Hi" uses 2 bytes. TEXT has no defined limit and is for long content. Use CHAR for fixed-length codes (country codes, state codes). Use VARCHAR for names, emails. Use TEXT for descriptions, comments. As a tester, test that VARCHAR limits are enforced and that CHAR padding does not cause comparison bugs.
Key Point: Every column has a data type that limits what it can store. Testing boundaries of those types finds truncation, overflow, and format bugs.