CREATE DATABASE IF NOT EXISTS growix_store DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
USE growix_store;
CREATE TABLE categories (id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(120), slug VARCHAR(150), created_at TIMESTAMP NULL, updated_at TIMESTAMP NULL);
CREATE TABLE products (id INT AUTO_INCREMENT PRIMARY KEY, category_id INT NULL, title VARCHAR(255), image VARCHAR(255), old_price VARCHAR(50) NULL, price VARCHAR(80), views INT DEFAULT 0, created_at TIMESTAMP NULL, updated_at TIMESTAMP NULL);
CREATE TABLE orders (id INT AUTO_INCREMENT PRIMARY KEY, customer_name VARCHAR(120) NULL, phone VARCHAR(50) NULL, product_id INT, status VARCHAR(30) DEFAULT 'pending', created_at TIMESTAMP NULL, updated_at TIMESTAMP NULL);
INSERT INTO categories(name,slug) VALUES ('Best Deals','best-deals'),('Microsoft Windows','microsoft-windows'),('Microsoft Office','microsoft-office'),('Subscription','subscription'),('Software','software'),('Ebook','ebook');
INSERT INTO products(category_id,title,image,old_price,price,views) VALUES
(1,'Adobe Creative Cloud','adobe.jpg',NULL,'120৳ - 244৳',383),
(1,'Autodesk Official Subscription','autodesk.jpg','500৳','300৳',389),
(2,'Internet Download Manager (IDM)','idm.jpg',NULL,'120৳ - 244৳',429),
(2,'Windows 11 Pro License key Professional','win11.jpg',NULL,'120৳ - 600৳',321),
(2,'Windows 10 Pro License Key Pro / Home','win10.jpg',NULL,'300৳ - 350৳',253);
