Tutorial: Create a Dashboard of SQL Datasets
Tags: sql, tutorial, dashboard, beginners
Published: 2020-04-20 13:35:31

##Introduction
*Here's our latest tutorial from our blog. Thanks so much to the DEV Community for your interest in our free rapid development platform. Let us know what you think of this data visualization tutorial!*

Stunning visualizations have never been easier. With WayScript, we can pull data from several different data storages, combine and process them on the same platform, and then display them into beautiful charts. Let's se how we can create online dashboards, coming from multiple sql databases.

##Prerequisites
No prerequisites but some content you might find helpful:
[Working with Databases] (https://docs.wayscript.com/library/modules/sql)
[Working with Data Visualizations](https://docs.wayscript.com/library/modules/chart)
[Working with Dashboards](https://docs.wayscript.com/library/modules/dashboard-response)

##Pulling Data from our Database
Using SQL databases on WayScripts is very easy to do. Several SQL based database types are supported. If the specific database that you're needing to use isn't supported, please contact us.

After creating a script, to start using SQL in our workflow, it is very straight forward. We begin by pulling in the module from the selections to the left, and placing it into our desired workflow.

![Add SQL](https://cdn.wayscript.com/blog_img/77/1.png)

If you've never used that module before, you'll be asked to authenticate WayScript or to connect your database. If you get stuck in setting up your database, this video tutorial may be of use. After connecting your database, we can use the built in editor to write SQL commands against our database. Here, we're able to query our database, write to it, and anything else you'd be able to do locally on your own machine.

![Query database](https://cdn.wayscript.com/blog_img/77/2.png)

Our SQL can be whatever we need to meet our requirements. We can query and write from this editing screen. Let's write something simple:
<pre>
SELECT SUM(quantity)
FROM order_summary
WHERE product='A';
</pre>

We're able to import the values that we need for our dashboard by clicking on the import button to the left. This creates variables within our script that we can use between modules.

![Variables](https://cdn.wayscript.com/blog_img/77/3.png)

Next, we're able to process this data, or simply pass it to a dashboard.

##Working with Data Visualizations
Using the built in data visualizations tools WayScript provides, we can create line and pie charts. If you need more in depth data visualizations tools, we would be happy to develop them for you! Just contact our team. Let's drag in a chart module to build this visualization.

![Chart Module](https://cdn.wayscript.com/blog_img/81/1.png)

With data visualizations, we can input our list type data to build our graphs. Here's an example of a simple one:

![data visualization](https://cdn.wayscript.com/blog_img/81/2.png)

This graph becomes an object that we can pass throughout our script. That means we can pass this on to our dashboard response.

##Working with Dashboards
To pass that chart object to a dashboard, we use the dashboard module. To use this, we'll need an active HTTP trigger at the top of our script.

![http trigger](https://cdn.wayscript.com/blog_img/81/3.png)

Passing the chart to the dashboard response:

![passing chart](https://cdn.wayscript.com/blog_img/81/4.png)

##Example of a Completed Dashboard
If you'd like to view a completed dashboard, you can find one [here](https://13679.wayscript.io/). Each time someone visits the url, data is pulled, processed, visualized, and passed to the dashboard response. If you'd like to see the full script, it is [here](https://wayscript.com/shared/Go62IAEy).