<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def insert_metric_changes(db, metrics, metric_mapping, commit):
 """Insert into the metric_changes tables. :param metrics: `list` of `Metric` objects :param dict metric_mapping: Maps metric names to ids :param Commit commit: """

    values = [
        [commit.sha, metric_mapping[metric.name], metric.value]
        for metric in metrics
        if metric.value != 0
    ]
    db.executemany(
        'INSERT INTO metric_changes (sha, metric_id, value) VALUES (?, ?, ?)',
        values,
    )