Creating a Database

One of the cool things about XAMPP is that it allows users to not only have an Apache server instance on their box, but it also has other applications built in. You can also download new applications as well, if you wish. XAMPP allows you to utilize MySQL to create your own data warehouse, which is exactly what we're going to do.

Step 1 - Start XAMPP

This step, is pretty straightforward. Open your XAMPP Control Panel (normally located Start > All Programs > XAMPP) and start both Apache and MySQL. They should light up green.

Step 2 - Access your MySQL Data Warehouse

Starting an Apache server on your box means that you have your own localhost. To access your MySQL data warehouse within your server, open your browser (Chrome preferably) and type in localhost/phpmyadmin/ It should look something like this when loaded:

Step 3 - Create Your Database

For the purposes of this tutorial, I'm going to assume that everyone reading knows the simple architecture of databases (tables, columns, rows), and how to write Structured Query Language code, or SQL for short. If you're unfamiliar, I recommend going to Khan Academy to learn how to write SQL. If it makes it easier, think of a database like a bunch of virtual Excel sheets. You can piece them together and manipulate them to extract data you want.

To create a database, you'll click 'New' on the top left side of the page. From there, it should load a 'Databases' screen and you can create a new database. We're going to create one called 'dashboarding':

Step 4 - Creating Tables & Importing Data

Now that we have our database created, there are two things that could happen:

  1. Load in sample data and have Tableau connect to produce visualizations
  2. Use some sort of coding -- Python, R, PHP, to scrape the web and grab data, load it in our database, and then have Tableau connect for the data to produce visualizations.
For this tutorial, since Python, R, or PHP isn't required, we're just going to create a table inside of it, called 'Games'. We're going to populate it with some sample data from the 2016 NBA Season for Tableau to connect to for our visualizations. That test set can be downloaded here.

Ideally, your organization has data set up already and is streaming to tables, updated at some time interval - maybe hourly, daily, or weekly. If you want to know how to scrape a website for your own personal project and populate tables on a daily update, check Link to Python web scraping to the database

Loading data can be a little tricky into your MySQL database. You'll have to pay attention to a few of the options. To load data to your database, enter it and then click 'Import'. It should look like this:

You'll notice the red rectangle -- we needed to specify that the first row of our CSV file has the names of the columns. After uploading, you should be able to navigate to 'Table 1'. To change the name, you can click 'Operations' on the top ribbon, and then in the second box (Move table to database.table) you should be able to change the name to 'Games'.

You should now be able to view your data! Just click on your table name.

Step 5 - Visualizing Data in Tableau

Click through to see how...