text: -- phpMyAdmin SQL Dump
  -- version 5.1.1
  -- https://www.phpmyadmin.net/
  --
  -- Host: localhost
  -- Generation Time: Dec 18, 2021 at 12:38 PM
  -- Server version: 10.6.5-MariaDB
  -- PHP Version: 8.0.12
  
  SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
  START TRANSACTION;
  SET time_zone = "+00:00";
  
  
  /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
  /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
  /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
  /*!40101 SET NAMES utf8mb4 */;
  
  --
  -- Database: `coding_test_entertechbd`
  --
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `orders`
  --
  
  CREATE TABLE `orders` (
    `id` int(11) NOT NULL,
    `user_id` int(11) NOT NULL,
    `product_id` int(11) NOT NULL,
    `quantity` int(11) NOT NULL,
    `amount` int(11) NOT NULL,
    `status` set('Submitted','In transit','Delivered') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Submitted',
    `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
    `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  --
  -- Dumping data for table `orders`
  --
  
  INSERT INTO `orders` (`id`, `user_id`, `product_id`, `quantity`, `amount`, `status`, `created_at`, `updated_at`) VALUES
  (1, 1, 1, 5, 18750, 'Submitted', '2021-12-18 06:37:50', '2021-12-18 06:37:50'),
  (2, 1, 2, 3, 24000, 'Submitted', '2021-12-18 06:37:55', '2021-12-18 06:37:55'),
  (3, 1, 3, 8, 48000, 'Submitted', '2021-12-18 06:38:01', '2021-12-18 06:38:01'),
  (4, 1, 1, 3, 11250, 'Delivered', '2021-12-18 06:38:08', '2021-12-18 06:38:30');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `products`
  --
  
  CREATE TABLE `products` (
    `id` int(11) NOT NULL,
    `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
    `unit_price` int(11) NOT NULL,
    `location` set('Dhaka','Rajshahi','Chittagong') COLLATE utf8mb4_unicode_ci NOT NULL,
    `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
    `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  --
  -- Dumping data for table `products`
  --
  
  INSERT INTO `products` (`id`, `name`, `unit_price`, `location`, `created_at`, `updated_at`) VALUES
  (1, 'Product 1', 5000, 'Dhaka', '2021-12-18 06:18:22', '2021-12-18 06:18:22'),
  (2, 'Product 2', 8000, 'Rajshahi', '2021-12-18 06:18:41', '2021-12-18 06:18:41'),
  (3, 'Product 3', 6000, 'Chittagong', '2021-12-18 06:18:57', '2021-12-18 06:18:57');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `users`
  --
  
  CREATE TABLE `users` (
    `id` int(11) NOT NULL,
    `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
    `email` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
    `location` set('Dhaka','Rajshahi','Chittagong','Others') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Dhaka',
    `password` varchar(60) COLLATE utf8mb4_unicode_ci NOT NULL,
    `role` tinyint(1) NOT NULL DEFAULT 2,
    `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
    `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  --
  -- Dumping data for table `users`
  --
  
  INSERT INTO `users` (`id`, `name`, `email`, `location`, `password`, `role`, `created_at`, `updated_at`) VALUES
  (1, 'Admin', 'admin@admin.com', 'Dhaka', '21232f297a57a5a743894a0e4a801fc3', 1, '2021-12-18 06:16:53', '2021-12-18 06:17:15');
  
  --
  -- Indexes for dumped tables
  --
  
  --
  -- Indexes for table `orders`
  --
  ALTER TABLE `orders`
    ADD PRIMARY KEY (`id`),
    ADD KEY `user_id` (`user_id`),
    ADD KEY `product_id` (`product_id`);
  
  --
  -- Indexes for table `products`
  --
  ALTER TABLE `products`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indexes for table `users`
  --
  ALTER TABLE `users`
    ADD PRIMARY KEY (`id`);
  
  --
  -- AUTO_INCREMENT for dumped tables
  --
  
  --
  -- AUTO_INCREMENT for table `orders`
  --
  ALTER TABLE `orders`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
  
  --
  -- AUTO_INCREMENT for table `products`
  --
  ALTER TABLE `products`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
  
  --
  -- AUTO_INCREMENT for table `users`
  --
  ALTER TABLE `users`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
  
  --
  -- Constraints for dumped tables
  --
  
  --
  -- Constraints for table `orders`
  --
  ALTER TABLE `orders`
    ADD CONSTRAINT `orders_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
    ADD CONSTRAINT `orders_ibfk_2` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`);
  COMMIT;
  
  /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
  /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
  /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
  