def METHOD_NAME(
        source_table,
        target_table,
        columns_to_move,
        source_table_reference_column,
):
    SPLIT_ID = f"{constants.MATHESAR_PREFIX}_move_column_alias"
    moved_column_names = [col.name for col in columns_to_move]
    moved_columns = [
        source_table.c[moved_column_name]
        for moved_column_name in moved_column_names
    ]
    # New rank is computed using Existing ranking column + set of columns being moved
    ranking_columns = [source_table.c[source_table_reference_column.name]] + moved_columns
    target_table_existing_data_column_names = [
        column.name
        for column in target_table.columns
        if column.name != constants.ID and column.name not in moved_column_names
    ]
    ranked_target_table_columns = [
        target_table.c[column_name]
        for column_name in target_table_existing_data_column_names
    ]
    ranked_columns = [source_table.c[constants.ID]] + moved_columns + ranked_target_table_columns
    # Compute new rank to be used as the new foreign key value
    rank_cte = select(
        [
            *ranked_columns,
            func.dense_rank().over(order_by=ranking_columns).label(SPLIT_ID)
        ]
    ).join(target_table).cte()
    new_target_table_data_columns = target_table_existing_data_column_names + moved_column_names
    cte_extraction_columns = (
        [rank_cte.columns[SPLIT_ID]] + [rank_cte.columns[n] for n in new_target_table_data_columns]
    )
    extract_sel = select(
        cte_extraction_columns,
        distinct=True
    )
    extract_ins_stmt = (
        insert(target_table)
        .from_select([constants.ID] + new_target_table_data_columns, extract_sel)
        .returning(literal(1))
    )
    extract_ins_cte = extract_ins_stmt.on_conflict_do_update(
        index_elements=[target_table.c[constants.ID]],
        set_={
            name: extract_ins_stmt.excluded[name]
            for name in new_target_table_data_columns}
    ).cte()
    fk_update_dict = {source_table_reference_column.name: rank_cte.c[SPLIT_ID]}
    split_ins = (
        source_table
        .update().values(**fk_update_dict).
        where(
            source_table.c[constants.ID] == rank_cte.c[constants.ID],
            exists(extract_ins_cte.select())
        )
    )
    return split_ins