The stores_demo Database Map

Some of the tables in the stores_demo database have relationships between them.

The following illustration displays the joins in the stores_demo database between customers, catalog orders, and customer calls. The shading that connects a column in one table to a column with the same name in another table indicates the relationships, or joins, between tables.

Figure 1: Joins between customers and catalog orders

begin figure description -- This figure shows join columns among the nine tables in the stores_demo database. The call_type table is joined to the cust_calls table by the call_code column in both tables. The cust_calls table is also joined to both the customer table and to the orders table by the customer_num column in all three tables. The customer table is also joined to the state table by the state column of the customer table, which joins to the code column of the state table. The orders table is also joined to the items table by the order_num column in both tables. The items table is also joined to both the stock table and to the catalog table by the stock_num column and by the manu_code column in all three tables, which also join the stock table to the catalog table. The manufact table is joined to the items table, to the stock table, and to the catalog table by the manu_code column in all four tables. -- end figure description

The following illustration displays the joins in the stores_demo database between customers, electricity meter data, and location. The Customer_ts_data, ts_data, and ts_data_location tables contain time series data. You can prevent the creation of these time series tables when you create the demonstration database.

The stores_demo database also contains tables that hold electricity meter data fro customers. The Customer_ts_data and ts_data tables contain time series data. The customer table and the Customer_ts_data table are joined by the customer_num column. The Customer_ts_data table is joined to the ts_data table by the loc_esi_id, measure_unit, and direction columns. You can prevent the creation of these time series tables when you create the demonstration database.

Figure 2: Joins between customers, electricity usage data, and location

This figure shows the join between the customer table and the customer_ts_data table by the customer_num column. The customer_ts_data table is joined to the ts_data table by the loc_esi_id, measure_unit, and direction columns. The ts_data and ts_data_location tables are joined by the loc_esi_id column.