Completed FoxDB query functionality.