SQL column data types and sizes
A column's data type and size set in CREATE TABLE. VARCHAR(50) holds text up to 50 characters. Other types: INT, DECIMAL(8,2), DATE, BOOLEAN. They control what a column stores.
Understanding SQL column data types and sizes in VCE Data Analytics U3O1
What it does: INT holds whole numbers with no decimal part, so it suits counts, ages and scores. The DATE type is used for calendar dates, so the database can sort and compare them correctly. VARCHAR(n) stores text up to n characters. INT only stores whole numbers, so it cannot hold names. In DECIMAL(p,s), p is the total number of digits and s is the number of digits after the decimal point. It is ideal for prices like 4.50. INT would drop the cents. DECIMAL(8,2) keeps two decimal places. VARCHAR needs a size in brackets, such as VARCHAR(10), so the database knows the maximum number of characters.
Common mistakes: VARCHAR must have a size in brackets to say the maximum number of characters. It should be VARCHAR(50). DECIMAL takes two numbers separated by a comma: precision and scale. It should be DECIMAL(6,2), not DECIMAL(6.2).
Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.
This module's key terms are also in a printable crossword (Modules 17–49) and word search (Modules 17–91).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
VARCHAR(50)Fill in the Blanks
Spot the Error
Student with a class code? Join your class →