Org Mode is well-known for its tables, and if you’re familiar with SQL, you can use your tables as a SQL database. The best part is that you don’t have to manually create the database. This post explains how to run an SQL query on your Org table without any hassle. To do this, you need to convert the Org table to a SQLite table using Org Babel SQLite integration, generate the SQL CREATE TABLE statement, store the table in an in-memory database, and finally, run the SQL query and render the result as an Org table. This method allows for flexibility and easy manipulation of your Org table.
http://yummymelon.com/devnull/running-sql-queries-on-org-tables.html