# How to use SQL to query discourse database

**URL:** https://meta.discourse.org/t/how-to-use-sql-to-query-discourse-database/30874
**Category:** Support
**Created:** [July 7, 2015, 10:52pm UTC](https://meta.discourse.org/t/how-to-use-sql-to-query-discourse-database/30874 "2015-07-07T22:52:57Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Stackfish](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stackfish/32/38440_2.png) [@Stackfish](https://meta.discourse.org/u/Stackfish)
#### Post date: [July 7, 2015, 10:52pm UTC](https://meta.discourse.org/t/how-to-use-sql-to-query-discourse-database/30874/1 "2015-07-07T22:52:57Z")

</div>

This is a follow on question to one I had about finding who took part in a poll. I was told that I could get this with SQL query, but I’m not clear on how or where I can run this query.

Is there an adhoc query screen in discourse? If not, can someone point me in right direction as to where I can run SQL again discourses database.

Thanks

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [May 31, 2019, 1:29am UTC](https://meta.discourse.org/t/how-to-use-sql-to-query-discourse-database/30874/12 "2019-05-31T01:29:08Z")

</div>

You can now use the [Discourse Data Explorer](https://meta.discourse.org/t/data-explorer-plugin/32566) to write SQL queries to your forum’s database.

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [May 31, 2019, 1:29am UTC](https://meta.discourse.org/t/how-to-use-sql-to-query-discourse-database/30874/13 "2019-05-31T01:29:13Z")

</div>


