Importing CSV files into a MySQL table

Importing a CSV file into an SQL table

CSV stands for Comma-Separated Values, and CSV files are text files that look something like this:


johndoe,,"71 Pickering Street, Singapore, Singapore",+65-91234567
janedoe,,"24 Raffles Lane, Singapore, Singapore",+65-81234567
marysmith,,"83 Riveting Road, Singapore, Singapore",+65-97654321
bobsmith,,"84 Riveting Road, Singapore, Singapore",+65-87654321

Essentially, the CSV file format is meant to represent tabular data. The above CSV file represents the following table:

johndoejohn@example.com71 Pickering Street, Singapore, Singapore+65-91234567
janedoejane@website.com24 Raffles Lane, Singapore, Singapore+65-81234567
marysmith 83 Riveting Road, Singapore, Singapore +65-97654321
bobsmith 84 Riveting Road, Singapore, Singapore +65-87654321

Due to their tabular nature, data in a CSV file can very easily be imported into and stored in an SQL table. The commands to do that, however, are not very well-documented online.

If a CSV file does not open as a text file on your computer, that’s because your computer is opening the file with a spreadsheet program such as Microsoft Excel. In such a case, to see the file as text, you will want to open these files on a text editing software such as Notepad.

Continue reading
Creating a Farming RPG in Unity - Part 4: Item Management

Creating a Farming RPG (like Harvest Moon) in Unity — Part 4: Item Management

Ever wanted to create a game like Harvest Moon in Unity? Check out Part 4 of our guide here, where we go through how to create an item management system. You can also find Part 3 of our guide here, where we went through how to set up farmland elements that our player character will interact with.

Continue reading
Pretty Computer Chips
Image by Jonas Svidras at

Passing a variable by value vs. reference

In programming, a concept that usually creates a lot of confusion among those new to it is the concept of passing a variable by value, versus passing a variable by reference. The 2 examples below illustrate the difference between these two ways variables can be passed in Java:

Continue reading
A formula for rounding number

A formula for rounding numbers

Most programming languages come with native functions that help us round our numbers, either upwards (i.e. ceiling operation), downwards (i.e. floor operation), or to the nearest whole (i.e. round operation). While this is convenient, we sometimes need a bit more than that — what if — for example — we want to round our numbers to the nearest 0.5, or the nearest 3rd?

Continue reading