You need to join your TF
and DF
tables and then insert into the destination TFIDF
table.
Try this:
insert into TFIDF (documentID, terms, tf_idf)
select abstractID, df.term, (log(10, 132225)-log(10, doccount)+1)*(tf.freq)
from tf, df
where tf.term = df.term;