Database with support for 3 types of queries