We can do the same than we just did but with python scripts. It will allow you to create even more complex reports very easily thanks to python. You might first want to take a look at the python introduction.
As we did with SQL query, you can write your python script, then click on update to see the result of it:
kw={ 'portal_type': 'Person', 'owner':'%', }
return context.portal_catalog(**kw)
Result: each person whos owner is everyone (*)
kw={'portal_type': 'Person', 'owner':'%', 'src__':1,}
return context.portal_catalog(**kw)
Result: gives the SQL method associated with the python script.
kw={'portal_type': 'Person','role_title':'Internal','src__':1,}
return context.portal_catalog(**kw)
Result: every person which role is 'Internal'