List of useful SQL queries to fetch data directly from Jira's database. Most of the queries will be in MySQL, I will try to include queries for othere databases but hopefully it will give you a good idea.