There is a Postgres database that contains the following related tables with the following fields:
therms(withintegertypeid(primary key) andtexttypevaluefields (contains words from indexed files))fs_entries(with fieldsidtypeintegerandvaluetypetext, wherevaluecontains the names of the files to be indexed)therms_occurs(withintegerandintegertypefile_idfields, wheretherm_idforeign key and is associated with theidfield of thethermstable, andfile_idforeign key and is associated with theidfield of thefs_entriestable).
Help make a query (because I'm new to SQL), issuing all the words, sorted by file name, and the file names themselves.