Styled App Bar - Copy this React, Mui Component to your project
Tạo cơ sở dữ liệu CREATE DATABASE IF NOT EXISTS fashion_shop; USE fashion_shop; Bảng users CREATE TABLE users ( user_id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(100) NOT NULL, email VARCHAR(100) UNIQUE NOT NULL, password VARCHAR(255) NOT NULL, role ENUM('customer', 'admin') DEFAULT 'customer', created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ); Bảng categories CREATE TABLE categories ( category_id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(100) NOT NULL, description TEXT ); Bảng products CREATE TABLE products ( product_id INT AUTO_INCREMENT PRIMARY KEY, category_id INT, name VARCHAR(100) NOT NULL, price DECIMAL(10, 2) NOT NULL, description TEXT, image VARCHAR(255), stock INT DEFAULT 0, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, FOREIGN KEY (category_id) REFERENCES categories(category_id) ON DELETE SET NULL ); Bảng orders CREATE TABLE orders ( order_id INT AUTO_INCREMENT PRIMARY KEY, user_id INT NOT NULL, order_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP, status ENUM('pending', 'processing', 'shipped', 'delivered', 'canceled') DEFAULT 'pending', total_amount DECIMAL(10, 2) NOT NULL, FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE CASCADE ); Bảng order_items CREATE TABLE order_items ( order_item_id INT AUTO_INCREMENT PRIMARY KEY, order_id INT NOT NULL, product_id INT NOT NULL, quantity INT NOT NULL, price DECIMAL(10, 2) NOT NULL, FOREIGN KEY (order_id) REFERENCES orders(order_id) ON DELETE CASCADE, FOREIGN KEY (product_id) REFERENCES products(product_id) ON DELETE CASCADE ); Bảng vouchers CREATE TABLE vouchers ( voucher_id INT AUTO_INCREMENT PRIMARY KEY, code VARCHAR(50) UNIQUE NOT NULL, discount DECIMAL(5, 2) NOT NULL, valid_from DATE NOT NULL, valid_until DATE NOT NULL, conditions TEXT ); Bảng cart CREATE TABLE cart ( cart_id INT AUTO_INCREMENT PRIMARY KEY, user_id INT NOT NULL, product_id INT NOT NULL, quantity INT NOT NULL, added_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE CASCADE, FOREIGN KEY (product_id) REFERENCES products(product_id) ON DELETE CASCADE ); creat web fashion shop
