Search query for node content join taxonomy term I am creating a form that searches the FAQ with the search term typed and the taxonommy term selected, i.e., the form will contain a search field and a select list of taxonomy terms associated with the FAQ. So I needed a sql query to achieve this.
I need some modifications on this  db_query("SELECT question, nid
  FROM {faq_questions}
  WHERE question LIKE :term
  ORDER BY question asc", array(':term' => '%%' . $term . '%%'));  so that taxonomy term associated with question is also searched. The above code just searches FAQ with keyword only, not combined with taxonomy term selected
Finally I managed to get results by using this code 
db_query("SELECT faq_questions.question, faq_questions.nid,taxonomy_index.tid
FROM faq_questions
JOIN taxonomy_index ON faq_questions.nid = taxonomy_index.nid
JOIN taxonomy_term_data ON taxonomy_index.tid =taxonomy_term_data.tid
WHERE question LIKE '%$keys%' AND taxonomy_term_data.tid='$tid'");