AI OnAI Off
Rather than querying the database, I reckon your best bet would be to use the IContentSoftLinkRepository which keeps track of what content links to what other content. To get a list of content which references a given piece of content you can do it like this:
var softLinkRepo = ServiceLocator.Current.GetInstance<IContentSoftLinkRepository>();
var links = softLinkRepo.Load(myContentReference, true);
If you've got nested blocks, you may need to look at the soft links for the soft links returned using the same technique.
I need to occassionally pull all the pages a form is being used on. It's typically within nested blocks of course. But it's not so often that I want to write a report in our website. Is there a way to get this information from a SQL query?