Tutorial: 000 - Example Database Setup

000 - Example Database Setup

The examples provided in these tutorials use a fictitious bike_shop database. If you would like to run the example code, which is contained in the example directory, then you'll need to create the bike_shop database in a local MySQL database. The example/bike_shop.sql script can be used to create this database by logging in to your MySQL server and running:

source example/bike_shop.sql

The database contains a series of bike shops. Each bike shop has staff, and staff can get bonuses. Each bike shop sells bikes. When you source bike_shop.sql, two queries are run to show what data have been added. The first shows all the bike shops, the staff for each, and each staff member's bonuses. (Most staff members have not received any bonuses.) The second query shows all the bike shops with all the bikes sold by each shop. Note that some of the bikes are sold by multiple shops.

The bike_shop.sql script creates a user "example" with a password of "secret." If you change the credentials then you will need to update the bikeShopConOpts.json file accordingly.