<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def update_ngram(self, ngram, count):
 """ Updates a given ngram in the database. The ngram has to be in the database, otherwise this method will stop with an error. Parameters ngram : iterable of str A list, set or tuple of strings. count : int The count for the given n-gram. """

        query = "UPDATE _{0}_gram SET count = {1}".format(len(ngram), count)
        query += self._build_where_clause(ngram)
        query += ";"
        self.execute_sql(query)