Advertisement
fakhrycodepolitan

bookstore.sql

Jan 12th, 2025
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 5.74 KB | Source Code | 0 0
  1. -- phpMyAdmin SQL Dump
  2. -- version 5.2.1
  3. -- https://www.phpmyadmin.net/
  4. --
  5. -- Host: mariadb
  6. -- Generation Time: Jan 12, 2025 at 01:36 PM
  7. -- Server version: 11.6.2-MariaDB-ubu2404
  8. -- PHP Version: 8.2.27
  9.  
  10. SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
  11. START TRANSACTION;
  12. SET time_zone = "+00:00";
  13.  
  14.  
  15. /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
  16. /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
  17. /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
  18. /*!40101 SET NAMES utf8mb4 */;
  19.  
  20. --
  21. -- Database: `bookstore`
  22. --
  23.  
  24. -- --------------------------------------------------------
  25.  
  26. --
  27. -- Table structure for table `customers`
  28. --
  29.  
  30. CREATE TABLE `customers` (
  31.   `id` int(11) NOT NULL,
  32.   `name` text NOT NULL,
  33.   `email` text NOT NULL,
  34.   `created` timestamp NULL DEFAULT current_timestamp()
  35. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci;
  36.  
  37. --
  38. -- Dumping data for table `customers`
  39. --
  40.  
  41. INSERT INTO `customers` (`id`, `name`, `email`, `created`) VALUES
  42. (1, 'Jarid', 'jguerrieri0@samsung.com', '2024-01-12 00:00:00'),
  43. (2, 'Turner', 'tklesl1@blog.com', '2024-01-12 00:00:00'),
  44. (3, 'Adelheid', 'amackee2@blog.com', '2024-01-12 00:00:00'),
  45. (4, 'Leia', 'landriesse3@smugmug.com', '2024-01-12 00:00:00'),
  46. (5, 'Meryl', 'mschollick4@bbb.org', '2024-01-12 00:00:00'),
  47. (6, 'Sydney', 'spigne5@dagondesign.com', '2024-01-12 00:00:00'),
  48. (7, 'Danyelle', 'dpeasnone6@scribd.com', '2024-01-12 00:00:00'),
  49. (8, 'Rebekkah', 'rcastelot7@epa.gov', '2024-01-12 00:00:00'),
  50. (9, 'Gery', 'gcusick8@geocities.jp', '2024-01-12 00:00:00'),
  51. (10, 'Arron', 'aslavin9@eventbrite.com', '2024-01-12 00:00:00'),
  52. (11, 'Fakhry', 'fakhry@mail.com', '2025-01-12 13:22:00');
  53.  
  54. -- --------------------------------------------------------
  55.  
  56. --
  57. -- Table structure for table `orders`
  58. --
  59.  
  60. CREATE TABLE `orders` (
  61.   `id` int(11) NOT NULL,
  62.   `customer_id` int(11) DEFAULT NULL,
  63.   `product` text NOT NULL,
  64.   `quantity` int(11) NOT NULL,
  65.   `created` timestamp NULL DEFAULT current_timestamp(),
  66.   `category_id` int(11) DEFAULT NULL
  67. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci;
  68.  
  69. --
  70. -- Dumping data for table `orders`
  71. --
  72.  
  73. INSERT INTO `orders` (`id`, `customer_id`, `product`, `quantity`, `created`, `category_id`) VALUES
  74. (1, 9, 'Lazarus Project, The', 1, '2024-03-27 02:00:03', 1),
  75. (2, 10, 'High School', 5, '2024-07-11 15:44:32', 2),
  76. (3, 1, 'Bandits (Bandidos)', 5, '2024-11-08 23:16:49', 2),
  77. (4, 8, 'Ong-Bak: The Thai Warrior (Ong Bak)', 5, '2024-08-30 20:26:51', 1),
  78. (5, 5, 'All Night Long', 2, '2024-11-12 08:35:03', 2),
  79. (6, 5, 'A Chinese in a Coma', 5, '2024-12-19 08:17:08', 3),
  80. (7, 5, 'Girl in the Café, The', 4, '2024-09-25 04:40:27', 3),
  81. (8, 10, 'Catwoman', 2, '2024-11-16 13:59:32', 2),
  82. (9, 4, 'Bill Maher: Victory Begins at Home', 3, '2024-10-07 19:11:56', 2),
  83. (10, 6, 'Talaash', 3, '2024-11-29 12:32:41', 1),
  84. (11, 10, 'Miracles - Mr. Canton and Lady Rose', 1, '2024-10-10 04:39:02', 1),
  85. (12, 2, 'The Spectacular Now', 1, '2024-07-18 01:12:12', 3),
  86. (13, 1, 'Last of the Unjust, The (Dernier des injustes, Le)', 3, '2024-04-21 12:02:27', 3),
  87. (14, 6, 'Thieves, The (Dodookdeul)', 5, '2024-04-01 08:25:58', 3),
  88. (15, 7, 'Ashes, The (Popioly)', 4, '2024-08-17 18:10:22', 3),
  89. (16, 9, 'Terror is a Man', 2, '2024-12-11 23:40:38', 1),
  90. (17, 2, 'Peacock', 4, '2024-05-22 21:46:05', 2),
  91. (18, 7, 'Charley Varrick', 1, '2024-11-09 15:43:08', 3),
  92. (19, 9, 'Wonderful World', 4, '2024-11-15 18:56:34', 2),
  93. (20, 10, 'Kiss Me Kate', 5, '2024-08-20 17:13:49', 1),
  94. (21, 10, 'Dark Star', 1, '2024-06-22 17:26:49', 2),
  95. (22, 9, 'Ants in the Pants', 3, '2024-07-10 21:54:17', 2),
  96. (23, 7, 'Concert for George, The', 3, '2024-02-23 12:22:38', 1),
  97. (24, 3, 'The Loft', 5, '2024-03-14 12:16:34', 1),
  98. (25, 8, 'Sweet Home', 3, '2024-04-28 01:54:19', 3);
  99.  
  100. -- --------------------------------------------------------
  101.  
  102. --
  103. -- Table structure for table `product_categories`
  104. --
  105.  
  106. CREATE TABLE `product_categories` (
  107.   `id` int(11) NOT NULL,
  108.   `category` text NOT NULL,
  109.   `created` timestamp NULL DEFAULT current_timestamp()
  110. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci;
  111.  
  112. --
  113. -- Dumping data for table `product_categories`
  114. --
  115.  
  116. INSERT INTO `product_categories` (`id`, `category`, `created`) VALUES
  117. (1, 'History', '2025-01-12 09:43:53'),
  118. (2, 'Science', '2025-01-12 09:43:53'),
  119. (3, 'Fiction', '2025-01-12 09:43:53');
  120.  
  121. --
  122. -- Indexes for dumped tables
  123. --
  124.  
  125. --
  126. -- Indexes for table `customers`
  127. --
  128. ALTER TABLE `customers`
  129.   ADD PRIMARY KEY (`id`);
  130.  
  131. --
  132. -- Indexes for table `orders`
  133. --
  134. ALTER TABLE `orders`
  135.   ADD PRIMARY KEY (`id`),
  136.   ADD KEY `customer_id` (`customer_id`),
  137.   ADD KEY `category_id` (`category_id`);
  138.  
  139. --
  140. -- Indexes for table `product_categories`
  141. --
  142. ALTER TABLE `product_categories`
  143.   ADD PRIMARY KEY (`id`);
  144.  
  145. --
  146. -- AUTO_INCREMENT for dumped tables
  147. --
  148.  
  149. --
  150. -- AUTO_INCREMENT for table `customers`
  151. --
  152. ALTER TABLE `customers`
  153.   MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
  154.  
  155. --
  156. -- AUTO_INCREMENT for table `orders`
  157. --
  158. ALTER TABLE `orders`
  159.   MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=26;
  160.  
  161. --
  162. -- AUTO_INCREMENT for table `product_categories`
  163. --
  164. ALTER TABLE `product_categories`
  165.   MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
  166.  
  167. --
  168. -- Constraints for dumped tables
  169. --
  170.  
  171. --
  172. -- Constraints for table `orders`
  173. --
  174. ALTER TABLE `orders`
  175.   ADD CONSTRAINT `orders_ibfk_1` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`),
  176.   ADD CONSTRAINT `orders_ibfk_2` FOREIGN KEY (`category_id`) REFERENCES `product_categories` (`id`);
  177. COMMIT;
  178.  
  179. /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
  180. /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
  181. /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
  182.  
Tags: sql
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement