Tutorial: Create a Chatbot to serve Soccer Stats in 3 mins

The AskData platform lets users access data in the simplest way possible: natural language queries.

Since at Askdata we are sports fans, today we will explain to you how to create a chatbot to provide real-time sports stats.

We need a dataset, an AskData account and 5 minutes of your time.

5 minutes, the whole setup time

A. Create Dataset (if you don’t already own one)

Choose a dataset containing sports data stats. For instance, you could create a MySQL table.

CREATE TABLE `SOCCER_STATS` (`ID` INT NOT NULL,`PLAYER` VARCHAR(45) NULL,`TEAM` VARCHAR(45) NULL,`GOALS` INT NULL,PRIMARY KEY (`ID`));

Let’s push some records into the table:

/* LET'S POPULATE OUR TABLE */INSERT INTO SOCCER_STATS  (ID, PLAYER, TEAM, GOALS) VALUES (1,'Mohamed Salah','Liverpool',16);
INSERT INTO SOCCER_STATS  (ID, PLAYER, TEAM, GOALS) VALUES (2,'Roberto Firmino','Liverpool',9);
INSERT INTO SOCCER_STATS  (ID, PLAYER, TEAM, GOALS) VALUES (3,'Sadio Mané','Liverpool',9);
INSERT INTO SOCCER_STATS  (ID, PLAYER, TEAM, GOALS) VALUES (4,'Xherdan Shaqiri','Liverpool',6);
INSERT INTO SOCCER_STATS  (ID, PLAYER, TEAM, GOALS) VALUES (5,'James Milner','Liverpool',3);
INSERT INTO SOCCER_STATS  (ID, PLAYER, TEAM, GOALS) VALUES (6,'Daniel Sturridge','Liverpool',2);
INSERT INTO SOCCER_STATS  (ID, PLAYER, TEAM, GOALS) VALUES (7,'Trent Alexander-Arnold','Liverpool',1);
INSERT INTO SOCCER_STATS  (ID, PLAYER, TEAM, GOALS) VALUES (8,'Dejan Lovren','Liverpool',1);
INSERT INTO SOCCER_STATS  (ID, PLAYER, TEAM, GOALS) VALUES (9,'Joel Matip','Liverpool',1);
INSERT INTO SOCCER_STATS  (ID, PLAYER, TEAM, GOALS) VALUES (10,'Divock Origi','Liverpool',1);
INSERT INTO SOCCER_STATS  (ID, PLAYER, TEAM, GOALS) VALUES (11,'Fabinho','Liverpool',1);
INSERT INTO SOCCER_STATS  (ID, PLAYER, TEAM, GOALS) VALUES (12,'Virgil van Dijk','Liverpool',1);
INSERT INTO SOCCER_STATS  (ID, PLAYER, TEAM, GOALS) VALUES (13,'Georginio Wijnaldum','Liverpool',1);

You can check if the records have been inserted with this SQL statement

SELECT SUM(GOALS) TOTAL_GOALS FROM SOCCER_STATS;

If the answer is 48 then the dataset has been properly created and populated 💪!

B. The Askdata platform

AskData is the platform that empowers users interact with data with no effort, it will take other 3 minutes 🕒

1) Create an Agent

An agent is the data broker.

You can click on the “Create Agent” card inside your Workspace to open a new process modal.

You have just to provide the agent name to complete the creation process.

3) Add a dataset

To add a dataset you have to click on the [+] button in the “Datasets” section

To complete the dataset creation you have to select the type of dataset to connect to Askdata, according to the selected type you will be prompted to a modal window requesting the connection parameters

Once you complete everything you can save the dataset.

4) Test the agent

To test the agent you can simply use the right section of the agent after the dataset creation. Click on the “Baloon” icon to test the interactive conversational capability of the agent.

C. Done! 🎉

You can interact with the agent through AskData web UI or App

10x more value from your data
Free demo and great support from the Askdata team
BOOK YOUR DEMO