In addition to the documentation the @developernotes linked, a GUI tool called DB Browser for SQLite – which is compatible with SQLCipher databases – can be very handy for what you’re attempting to accomplish.
You might have a look at my response here: Save query results as csv which shows an example of how to export a table as a CSV using DB Browser for SQLite. The steps for what you’d like to accomplish should be very similar, but once you go to export the table generated by the query, you’ll want to use File → Export → Table(s) as JSON