This code contains queries such as selecting data, joining tables, sorting, filtering etc, that are typically used for extracting information from relational databases.
Sample retail store data (divided into 5 csv files) for the code is in the accompanying zip file. A schema needs to be created and data has to be loaded manaually into MySQL Wokrbench for this exercise.
File names and description:
- cust_dimen - Information about the customers of the store
- orders_dimen - Details of all the orders
- prod_dimen - contains all the details about all the products available in the store
- shipping_dimen - contains shipping details
- market_fact - the biggest file containing the market facts for all products, customers and orders
Steps to import data into MySQL Workbench:
- Create a database/schema and name it as "superstoresdb"
- Using the "Navigator" pane at the left-hand side, locate your database i.e. "superstoresdb"
- Expand it to get the tables list
- Right-click on the table name to get the menu
- Select "Table Data Import Wizard" from this menu
- Follow the steps of the wizard and the data will be imported in respective tables
- Repeat this process for all the tables