How to perform a SQL query in Alteryx
- How-Tos FAQs
- July 25, 2021

In the following article, we will look at how to perform an SQL query in Alteryx. SQL is the standard language to execute queries on a relational database that are not stored locally but have been uploaded on a server. Alteryx allows users not only to connect to a server to get data, but we can choose to work within the SQL database or to extract the database and work locally.
We will see both the alternatives:
- Connect in DB tool will be used to connect to an online server and modify the original database
- Input Data tool will be the user to connect to an online server but work locally on its data
Alteryx: Connect in DB
Connect in DB tool is the only choice you have if you want to connect to an online SQL server and perform actions or changes directly to the database.
1. Start your workflow with a Connection in-DB tool to connect to the SQL database.
2. In the configuration panel of the Connection in-DB tool, click on the down-directed arrow button on the ‘Connect name’ section.
3. Select ‘Manage connection’ and provide all the information required to connect to the database
4. In the configuration panel, type the query you want to perform to get data from the database.
Alteryx: Input Data tool
Input Data tool is the best choice you have if you want to work on an offline copy of an SQL database.
1. Start your workflow with an Input Data tool .
2. In the configuration panel of the Input Data tool, click on the down-directed arrow button in the ‘Connect to a file or database’ section.
3. Choose ‘Data source’ from the Data connection pop-up and select the database you want to connect with
4. Establish the connection by providing the required information
5. Type the SQL query you need
We have seen two different ways to establish a connection to a SQL database in order to process data within the database or to an offline copy of the required database.
Connection in-DB tool if we need to perform actions directly to the database (for most of the following ETL steps, you have to use in-DB tools.
Input Data tool if you want to make an offline copy of the SQL database and work just offline on data.
Conclusion
This is how to perform an SQL query in Alteryx. With data warehouses like Snowflake and modeling tools like Datameer, you can clean, prepare and analyze your data effortlessly.
Request a free trial today to experience Datameer in action and learn more about how it can transform your organization’s approach to data.