Before you use your SQL Data Insights (SQL DI) application, verify that it is properly installed and configured. You can check if the application operates normally by using the web UI to complete a short sequence of tasks.
Procedure
- Customize and run the
DSNTIJAV sample job in the Db2 SDSNSAMP data set. The JCL job creates the sample DSNAIDB.CHURN table.
- Sign in your SQL DI web UI with a valid RACF® user ID at the following address:
https://<SQLDI-IPAddress>:<SQLDI-PortNumber>
SQL DI uses a login group to identify and authorize users. The default group name is SQLDIGRP. Make sure that the user ID that you specify is defined in your SQL DI login group.
- If needed, adjust the SQL DI server settings by customizing the CPU threads based on your actual workload and the
LOAD control statement based on your Db2 settings as described in Managing your SQL DI settings.
- Create a connection to the Db2 system where the
DSNAIDB.CHURN table is stored, as described in Creating, modifying, or removing a connection from SQL DI to Db2 with web UI.
- Create an AI object named
CHURN from the DSNAIDB.CHURN table and then enable it for AI query as described in Enabling or disabling AI query with SQL DI web UI.
- For column configuration, assign SQL DI
key data type to the CustomerID and retain the pre-assigned SQL DI data types for all other columns. You don't need to set column filter values.
- Click Enable AI query to start the enablement process.
When the AI query enabling process completes successfully, the status of object CHURN is changed to Enabled.
- Run AI query on object
CHURN as described in Running an AI query with SQL DI web UI.
- Enter the following statement in the SQL editor:
SELECT AI_SIMILARITY(X.customerID, '3668-QPYBK') AS SimilarityScore, X.*
FROM DSNAIDB.CHURN X
WHERE X.customerID<>'3668-QPYBK'
ORDER BY SimilarityScore DESC
FETCH FIRST 10 ROWS ONLY
The purpose of this SQL statement is to identify top 10 customers who share similar characteristics with customer with ID 3668-QPYBK at a banking service. Customer 3668-QPYBK closed all accounts and left the service. The CHURN object and this sample query are intended to identify other customers who might also churn so that the service can act on this insight to mitigate the risk and try to retain those potential churners.
- Click Run to start the query.
As specified, the query displays 10 rows of the result set in the Results section.