def measurement_exists(cur, project_key, id):
    """
    Check whether the measurement exists in the database in the given project.
    """
    measurement = cur.execute(
        "SELECT * FROM measurements WHERE id=? AND projects_key=?", (id, project_key)
    ).fetchone()

    if not measurement:
        return False

    return True