Please, step away from the database. It is NOT designed for reporting in any shape, and there is almost certainly a much better way to do what you want.
Could you explain why you are looking at it? And who gave you the terrible idea of using SQL to do it?
(If you must, then start with changegroup - it has an issue column which is the id of the jiraissue, and then the id column in changegroup is used to identify the changeitems in that group)
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
We're bringing product updates and pro tips on teamwork to ten cities around the world.Save your spot