solved it

primary sql query is:
SELECT docid FROM Frequency GROUP BY docid HAVING sum(count)>300
solved two_words

primary sql query:
SELECT * FROM Frequency f, Frequency g WHERE f.term='transactions' and g.term='world' and f.docid=g.docid