Where does Confluence store comments in the database?
Confluence store comments, like contents of a page, in the BODYCONTENT table.
It's referred to the CONTENT table which stores the metadata of each comment (such as creator, the page where it belongs, etc)
For example, the following SQL query is to retrieve all comments in Confluence:
SELECT * FROM BODYCONTENT WHERE CONTENTID IN ( SELECT CONTENTID FROM CONTENT WHERE CONTENTTYPE = 'COMMENT' );