There is a Postgres database that contains the following related tables with the following fields:
therms
(withinteger
typeid
(primary key) andtext
typevalue
fields (contains words from indexed files))fs_entries
(with fieldsid
typeinteger
andvalue
typetext
, wherevalue
contains the names of the files to be indexed)therms_occurs
(withinteger
andinteger
typefile_id
fields, wheretherm_id
foreign key and is associated with theid
field of thetherms
table, andfile_id
foreign key and is associated with theid
field of thefs_entries
table).
Help make a query (because I'm new to SQL), issuing all the words, sorted by file name, and the file names themselves.