To load our somewhat cleaner data file into MySQL, we will need to revisit the CSV-to-SQL techniques from the Importing spreadsheet data into MySQL section in Chapter 3, Workhorses of Clean Data – Spreadsheets and Text Editors:
From the command line, navigate to the directory where you have saved the file you created in step two. This is the file we are going to import into MySQL.
Then, launch your MySQL client, and connect to your database server:
user@machine:~/sentiment140$ mysql -hlocalhost -umsquire -p Enter password:
Enter your password, and after you are logged in, create a database within MySQL to hold the table, as follows:
mysql> CREATE DATABASE sentiment140; mysql> USE sentiment140;
Next, we need to create a table to hold the data. The data type and lengths for each column should represent our best attempt to match the data we have. Some of the columns will be varchars, and each of them will need a length. As we might not...