Entity relationship approach to the generation of sentences for database queries