As you might know all data in Jira is stored in numerous tables. So to be able to create complicated tables or execute any data from Jira in table format you gonna need to connect different Tables, columns and registers (fields) one with another. To find out what tables does you Jira instance has and what columns contain each table you will need these two queries:
Show all tables
show tables
2. Show columns of selected table
show columns from ISSUE
Insert a query selecting a name of a table that you are interested in