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

START TRANSACTION;



--
-- Database: `store`
--
CREATE DATABASE IF NOT EXISTS `store` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
USE `store`;

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

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

CREATE TABLE `products` (
  `productID` int(10) UNSIGNED NOT NULL,
  `productCode` char(3) NOT NULL DEFAULT '',
  `name` varchar(30) NOT NULL DEFAULT '',
  `quantity` int(10) UNSIGNED NOT NULL DEFAULT 0,
  `price` decimal(7,2) NOT NULL DEFAULT 99999.99
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

INSERT INTO `products` (`productID`, `productCode`, `name`, `quantity`, `price`) VALUES
(1, 'MBL', 'Apple iPhone XS', 650, '799.00'),
(2, 'MBL', 'Google Pixel 4', 600, '799.00'),
(3, 'CON', 'Nintendo Switch', 200, '199.00'),
(4, 'CON', 'Xbox One S', 600, '299.00'),
(5, 'CPT', 'ChromeBook 200', 500, '350.00'),
(6, 'CPT', 'Mackbook Pro', 250, '1500.00');

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

--
-- Table structure for table `users`
--

CREATE TABLE `users` (
  `id` int(11) NOT NULL,
  `username` varchar(30) NOT NULL,
  `passwordHash` varchar(32) NOT NULL,
  `last-login` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `users`
--

INSERT INTO `users` (`id`, `username`, `passwordHash`, `last-login`) VALUES
(1, 'admin', '06c219e5bc8378f3a8a3f83b4b7e4649', '2019-11-09 17:32:37'),
(2, 'paul761', '5ebe2294ecd0e0f08eab7690d2a6ee69', '2019-11-09 17:32:08'),
(3, 'jennygem', 'dc563957c3dd9861f3ce854d3bafeb46', '2019-11-09 17:36:25'),
(4, 'rorobear', 'd46b02f95dde5677b815b75fd9e22850', '2019-11-09 17:37:56');

--
-- Indexes for dumped tables
--

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

--
-- Indexes for table `users`
--
ALTER TABLE `users`
  ADD PRIMARY KEY (`id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `products`
--
ALTER TABLE `products`
  MODIFY `productID` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
COMMIT;

