-- https://www.phpmyadmin.net/
--

START TRANSACTION;



--
-- Database: `qismyirz_darbaremir`
--

-- --------------------------------------------------------

--
-- Table structure for table `orders`
--

CREATE TABLE `orders` (
  `id` int(11) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `phone` varchar(50) DEFAULT NULL,
  `total_amount` decimal(10,2) NOT NULL,
  `payment_method` varchar(50) DEFAULT NULL,
  `order_status` varchar(50) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `user_id` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `orders`
--

INSERT INTO `orders` (`id`, `name`, `email`, `phone`, `total_amount`, `payment_method`, `order_status`, `created_at`, `user_id`) VALUES
(1, 'Abdullah Basar', 'araf@gmail.com', '455-45-454', 90.46, 'Cash on Delivery', 'pending', '2025-03-22 18:21:11', NULL),
(2, 'Abdullah ', 'smd437410@gmail.com', '(189) 277-6231', 46.47, 'Cash on Delivery', 'pending', '2025-03-23 05:00:33', NULL);

-- --------------------------------------------------------

--
-- Table structure for table `order_items`
--

CREATE TABLE `order_items` (
  `id` int(11) NOT NULL,
  `order_id` int(11) NOT NULL,
  `product_id` int(11) NOT NULL,
  `product_name` varchar(255) DEFAULT NULL,
  `quantity` int(11) NOT NULL,
  `product_price` decimal(10,2) NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `order_items`
--

INSERT INTO `order_items` (`id`, `order_id`, `product_id`, `product_name`, `quantity`, `product_price`, `created_at`) VALUES
(1, 1, 10, 'Product 10', 3, 24.99, '2025-03-22 18:21:11'),
(2, 1, 2, 'Product 2', 1, 15.49, '2025-03-22 18:21:11'),
(3, 2, 2, 'Product 2', 3, 15.49, '2025-03-23 05:00:33');

-- --------------------------------------------------------

--
-- Table structure for table `products`
--

CREATE TABLE `products` (
  `product_id` int(11) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `price` decimal(10,2) NOT NULL,
  `stock` int(11) DEFAULT 0,
  `category` varchar(255) DEFAULT NULL,
  `image_url` varchar(255) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `products`
--

INSERT INTO `products` (`product_id`, `name`, `description`, `price`, `stock`, `category`, `image_url`, `created_at`) VALUES
(1, 'Product 1', 'Description for product 1', 10.99, 50, 'Category A', 'images/product-1.jpeg', '2025-03-22 18:06:33'),
(2, 'Product 2', 'Description for product 2', 15.49, 40, 'Category B', 'images/product-2.jpeg', '2025-03-22 18:06:33'),
(3, 'Product 3', 'Description for product 3', 8.99, 60, 'Category A', 'images/product-3.jpeg', '2025-03-22 18:06:33'),
(4, 'Product 4', 'Description for product 4', 12.99, 30, 'Category C', 'images/product-4.jpeg', '2025-03-22 18:06:33'),
(5, 'Product 5', 'Description for product 5', 18.99, 25, 'Category B', 'images/product-5.jpeg', '2025-03-22 18:06:33'),
(6, 'Product 6', 'Description for product 6', 22.99, 20, 'Category A', 'images/product-6.jpeg', '2025-03-22 18:06:33'),
(7, 'Product 7', 'Description for product 7', 9.99, 55, 'Category C', 'images/product-7.jpeg', '2025-03-22 18:06:33'),
(8, 'Product 8', 'Description for product 8', 14.99, 35, 'Category B', 'images/product-8.jpeg', '2025-03-22 18:06:33'),
(9, 'Product 9', 'Description for product 9', 19.99, 15, 'Category A', 'images/product-9.jpeg', '2025-03-22 18:06:33'),
(10, 'Product 10', 'Description for product 10', 24.99, 10, 'Category C', 'images/product-10.jpeg', '2025-03-22 18:06:33');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `orders`
--
ALTER TABLE `orders`
  ADD PRIMARY KEY (`id`),
  ADD KEY `user_id` (`user_id`);

--
-- Indexes for table `order_items`
--
ALTER TABLE `order_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `order_id` (`order_id`);

--
-- Indexes for table `products`
--
ALTER TABLE `products`
  ADD PRIMARY KEY (`product_id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `orders`
--
ALTER TABLE `orders`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `order_items`
--
ALTER TABLE `order_items`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `products`
--
ALTER TABLE `products`
  MODIFY `product_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
COMMIT;

