This tutorial explains how to run SQL queries in Excel. To demonstrate this, I will use a free software, QueryStorm which acts as an Excel addin and adds support for SQL. It lets you manipulate the spreadsheets using different SQL commands. It assumes the Excel spreadsheets as database tables and lets you perform different database operation on them. You can easily run SQL command like SELECT, UPDATE, ALTER, and see the real-time changes in the spreadsheet. Also, the SQL feature that QueryStorm adds, supports suggestions and query auto complete so that you will be able to manage data efficiently.
In Excel, you can’t really use SQL commands to manipulate data as Excel is built on whole different concept. But if you really want to use SQL commands to handle and manipulate data in Excel sheets directly, then this tutorial will help you. The software that I have listed below is very powerful. And if you have your hands good at SQL then you will find it very simple to install and use this.
How to Run SQL Queries in Excel?
QueryStorm is a free software for you to use but it is only free for non commercial use. Also, in the free version, it can run only on one machine at a time. Apart from just adding support for SQL, this adds other features too. It lets you use C# code directly in Excel. So, if you are good in programming then you can write code to manage data in Excel itself.
Here are the steps to run SQL queries in Excel.
Step 1: After installing the software by downloading it from the link at the end, open Excel. You will find a new tab there, named “Query Storm”.
Step 2: Open any workbook and then click the “Connect SQLite” button from the top. After that, you can opt to connect SQL to current sheet or to all the sheets in the workbook. After connecting to the spreadsheet, different windows will open up.
Step 3: You can start writing the SQL commands in the SQL editor which is in the middle. In the left side, it shows the Excel sheets as tables. And on the right side it will show you the log of SQL operations. You can start entering the SQL commands and execute them using the ‘play’ button. You can execute multiple SQL statements at a time and it will handle them all pretty efficiently.
Above, you can see QueryStorm in action. Also, you can see that the SQL editor of the tool has functionality of code highlighting, query auto complete, and suggestions. You can easily write SQL queries and execute them without any fuss. And not only that, you can even import and export SQL commands from a “.sql” file to handle the database operations.
QueryStorm is a very nice software that adds the SQL support in Excel. You can use the SQL operation to manipulate Excel sheets in the same way you manage tables in a database. It makes the rapid changes in the spreadsheet of the workbook you are using it on.