Исправь ошибки : package com.example.myapp_2.USERSDB;

import android.content.ContentValues;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

import com.example.myapp_2.List_1.Product;
import com.example.myapp_2.User;

import java.util.List;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

import java.util.ArrayList;
import java.util.List;

public class DBHelper extends SQLiteOpenHelper {
    private static final int DATABASE_VERSION = 1;
    private static final String DATABASE_NAME = "myapp.db";
    private static final String TABLE_USERS = "users";
    private static final String TABLE_PRODUCTS = "products";

    // Добавляем поле KEY_PRICE и определяем его константу
    private static final String KEY_PRICE = "price";

    private static final String COLUMN_ID = "id";
    private static final String COLUMN_NAME = "name";
    private static final String COLUMN_EMAIL = "email";

    private static final String CREATE_USERS_TABLE = "CREATE TABLE " + TABLE_USERS + " ( " +
    COLUMN_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +
    COLUMN_NAME + " TEXT, " +
    COLUMN_EMAIL + " TEXT )";

    // Добавляем запрос на создание таблицы продуктов
    private static final String CREATE_PRODUCTS_TABLE = "CREATE TABLE " + TABLE_PRODUCTS + " ( " +
            COLUMN_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +
            COLUMN_NAME + " TEXT, " +
            "description TEXT, " +
"image INTEGER, " +
    KEY_PRICE + " REAL )";

    private static final String DROP_USERS_TABLE = "DROP TABLE IF EXISTS " + TABLE_USERS;
    private static final String DROP_PRODUCTS_TABLE = "DROP TABLE IF EXISTS " + TABLE_PRODUCTS;

    public DBHelper(Context context) {
        super(context, DATABASE_NAME, null, DATABASE_VERSION);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL(CREATE_USERS_TABLE);
        db.execSQL(CREATE_PRODUCTS_TABLE); // создаем таблицу продуктов в БД
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        db.execSQL(DROP_USERS_TABLE);
        db.execSQL(DROP_PRODUCTS_TABLE); // удаляем таблицу продуктов из БД
        onCreate(db);
    }

    // Добавляем метод updateProductPrice
    public void updateProductPrice(Product product) {
        SQLiteDatabase db = this.getWritableDatabase();
        ContentValues values = new ContentValues();
        values.put(KEY_PRICE, product.getPrice());
        db.update(TABLE_PRODUCTS, values, COLUMN_NAME + " = ?", new String[] { product.getName() });
                db.close();
    }

    public void addUser(User user) {
        SQLiteDatabase db = this.getWritableDatabase();

        ContentValues values = new ContentValues();
        values.put(COLUMN_NAME, user.getName());
        values.put(COLUMN_EMAIL, user.getEmail());

        db.insert(TABLE_USERS, null, values);
        db.close();
    }

    public List<User> getAllUsers(Context context) {
        List<User> userList = new ArrayList<>();

        DBHelper dbHelper = new DBHelper(context);
        SQLiteDatabase db = dbHelper.getReadableDatabase();
        Cursor cursor = db.rawQuery("SELECT * FROM " + DBHelper.TABLE_USERS, null);

        if (cursor.moveToFirst()) {
            do {
                String name = cursor.getString(cursor.getColumnIndex(DBHelper.COLUMN_NAME));
                String email = cursor.getString(cursor.getColumnIndex(DBHelper.COLUMN_EMAIL));
                User user = new User(name, email);
                userList.add(user);
            } while (cursor.moveToNext());
        }
        cursor.close();
        db.close();

        return userList;
    }
}