<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def ngram_count(self, ngram):
 """ Gets the count for a given ngram from the database. Parameters ngram : iterable of str A list, set or tuple of strings. Returns ------- count : int The count of the ngram. """

        query = "SELECT count FROM _{0}_gram".format(len(ngram))
        query += self._build_where_clause(ngram)
        query += ";"

        result = self.execute_sql(query)

        return self._extract_first_integer(result)