Importing a CSV file into a database table
Fills a new database table from a CSV file. The first row becomes the field names, and you choose a data type for each field, such as text or number, and check them after the import.
Understanding Importing a CSV file into a database table in VCE Spreadsheets, SQL & Visualisation
What it does: The first line (id,name,year_level) is the header row, so those three words become the field names. The row below is a record. A phone number starts with 0 and is not used in maths. Setting it to Text keeps the leading 0, so you check types after the import. Numbers stored as a number type can be added, averaged and sorted properly. Text would sort 100 before 20. Without that setting, the heading words are treated as a normal record, which can also cause the wrong data types. Importing a CSV file into a database creates a new table and fills it with the records from the file.
Common mistakes: A pet's name is made of letters, so the field type should be Text, not Number. In a CSV file the values on a row are separated by commas. The heading row should be Name,Age,Year.
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 45–54) and word search (Modules 35–54).
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
Import CSVFill in the Blanks
Spot the Error
Student with a class code? Join your class →