You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### 2. Create IBM Db2 (Db2 Warehouse on Cloud or Db2 Docker Image)
29
29
30
-
Create the Db2 Warehouse on Cloud service and make sure to note the credentials using the following link:
31
-
32
-
*[**IBM Db2 Warehouse on Cloud**](https://cloud.ibm.com/catalog/services/db2-warehouse)
30
+
Once we have cloned our repository, the next thing we have to do is create our database that will hold our house sales data. There are two ways we can create our database. One way is creating IBM Db2 Warehouse on Cloud. This database will be hosted on the cloud. However, if you perfer to have your database on premise or locally, we can all use the Db2 Docker Image.
31
+
32
+
Choose which type of database you would like and follow the corresponding instructions:
33
33
34
-
### 2b. Create Schema and Tables for IBM Db2 Warehouse on Cloud
34
+
1. Create IBM Db2 Warehouse on Cloud
35
+
2. Create an IBM Db2 Docker Image (ON-Premise Database)
35
36
36
-
In the Db2 warehouse resource page, click on `Manage` and go to DB2 console by clicking the button `Open Console`. In the console do the following to load your data.
37
+
#### 2a. Create IBM Db2 Warehouse on Cloud
37
38
38
-
* Click `Load` from the hamburger menu.
39
-
* Click `Browse files` or you can drag files, select the [data/home-sales-training-data.csv](data/home-sales-training-data.csv) and click `Next`
40
-
* Choose existing schema or create a new one named `DB2WML` by clicking `+ New Schema`
41
-
* Create a new table named `HOME_SALES` by clicking `+ New Table` on the schema you created and click `Next`
42
-
* Make sure the column names and data types displayed are correct, then click `Next`
43
-
* Click `Begin Load` to load the data
39
+
Create the Db2 Warehouse on Cloud service and make sure to note the credentials using the following link:
44
40
45
-
Once this is done it will create a table `HOME_SALES` under schema `DB2WML` which will be used by the Node.js application.
41
+
*[**IBM Db2 Warehouse on Cloud**](https://cloud.ibm.com/catalog/services/db2-warehouse)
46
42
47
-
###3a. Create an IBM Db2 ON-Premise Database
43
+
#### 2b. Create an IBM Db2 ON-Premise Database
48
44
49
45
Instead of creating the Db2 Warehouse on Cloud service, we can also have our database instantiated locally by using the free IBM Db2 Docker Image.
50
46
@@ -63,7 +59,7 @@ Steps to get your db2 running locally:
@@ -72,11 +68,35 @@ Once this is done, it will create a db2 docker container with the follow customi
72
68
73
69
* IP Address/Domain: `localhost`
74
70
* Port: `50000`
75
-
* Database name: `testdb`
71
+
* Database name: `homesalesdb`
76
72
* Username: `db2inst1`
77
73
* Password: `hackathon`
78
74
79
-
### 3b. Create Schema and Tables for IBM Db2 Docker Image
75
+
76
+
### 3. Create Schema and Tables
77
+
Now that we have created our databases, we need to import the data from the csv file into our database. We will be creating a schema called `DB2WML`. The two tables we will create are `HOME_SALES` and `HOME_ADDRESS`. `HOME_SALES` will store the data we retrieve from our csv file. `HOME_ADDRESS` is going to be the addresses associated with each home.
78
+
79
+
Depending on which type you have (Cloud or On-Premise), the steps will be a little different. Please follow the corresponding steps:
80
+
81
+
1. Create Schema and Tables for IBM Db2 Warehouse on Cloud
82
+
2. Create Schema and Tables for IBM Db2 Docker Image
83
+
84
+
85
+
#### 3a Create Schema and Tables for IBM Db2 Warehouse on Cloud
86
+
87
+
In the Db2 warehouse resource page, click on `Manage` and go to DB2 console by clicking the button `Open Console`. In the console do the following to load your data.
88
+
89
+
* Click `Load` from the hamburger menu.
90
+
* Click `Browse files` or you can drag files, select the [data/home-sales-training-data.csv](data/home-sales-training-data.csv) and click `Next`
91
+
* Choose existing schema or create a new one named `DB2WML` by clicking `+ New Schema`
92
+
* Create a new table named `HOME_SALES` by clicking `+ New Table` on the schema you created and click `Next`
93
+
* Make sure the column names and data types displayed are correct, then click `Next`
94
+
* Click `Begin Load` to load the data
95
+
96
+
Once this is done it will create a table `HOME_SALES` under schema `DB2WML` which will be used by the Node.js application.
97
+
98
+
99
+
#### 3b. Create Schema and Tables for IBM Db2 Docker Image
80
100
81
101
Exit out of the container shell by CONTROL-C. Load the sample data into the onprem Db2 database:
* Connect to the database `testdb` NOTE: This command may not work for sometime, since the container takes some time to create the database. If this command doesn work, please wait a couple minutes and then try again.
116
+
* Connect to the database `homesalesdb` NOTE: This command may not work for sometime, since the container takes some time to create the database. If this command doesn work, please wait a couple minutes and then try again.
0 commit comments