How can I query the database to see what content is using Macros?

I’ve already solved this, but for historical purposes I have logged it here: