Add command to query database