Update DATABASE.md

added query for allowed contacts and applications
Merge pull request #1671 from an0n981/patch-3

Update DATABASE.md