Also, you can give ChatGPT the SQL schema of a few tables in your db and verbally describe the query you want written and it will write out the query for you ... at least it will give you a starter version.