Advertisement
Guest User

Untitled

a guest
Nov 20th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 2.96 KB | None | 0 0
  1. -- phpMyAdmin SQL Dump
  2. -- version 4.7.3
  3. -- https://www.phpmyadmin.net/
  4. --
  5. -- Host: localhost
  6. -- Generation Time: Nov 20, 2017 at 01:08 PM
  7. -- Server version: 5.6.35
  8. -- PHP Version: 7.1.8
  9.  
  10. SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
  11. SET time_zone = "+00:00";
  12.  
  13. --
  14. -- Database: `restaurant`
  15. --
  16.  
  17. -- --------------------------------------------------------
  18.  
  19. --
  20. -- Table structure for table `employee`
  21. --
  22.  
  23. CREATE TABLE `employee` (
  24.   `emp_id` int(11) NOT NULL,
  25.   `emp_name` varchar(255) NOT NULL,
  26.   `emp_password` varchar(255) NOT NULL,
  27.   `emp_desc` varchar(255) DEFAULT NULL
  28. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  29.  
  30. -- --------------------------------------------------------
  31.  
  32. --
  33. -- Table structure for table `item`
  34. --
  35.  
  36. CREATE TABLE `item` (
  37.   `item_id` int(11) NOT NULL,
  38.   `item_cn_name` varchar(255) NOT NULL,
  39.   `item_en_name` varchar(255) DEFAULT NULL,
  40.   `item_desc` varchar(255) DEFAULT NULL,
  41.   `item_price` decimal(6,2) NOT NULL,
  42.   `img_url` varchar(255) NOT NULL,
  43.   `user_id` varchar(30) DEFAULT NULL
  44. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  45.  
  46. -- --------------------------------------------------------
  47.  
  48. --
  49. -- Table structure for table `order`
  50. --
  51.  
  52. CREATE TABLE `order` (
  53.   `order_id` int(11) NOT NULL,
  54.   `order_datetime` datetime DEFAULT NULL,
  55.   `order_type` varchar(255) DEFAULT NULL,
  56.   `order_sum` decimal(6,2) DEFAULT NULL,
  57.   `actual_sum` decimal(6,2) DEFAULT NULL,
  58.   `payment_type` varchar(255) DEFAULT NULL,
  59.   `order_status` varchar(255) DEFAULT NULL,
  60.   `emp_id` int(11) NOT NULL,
  61.   `table_id` int(11) DEFAULT NULL
  62. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  63.  
  64. -- --------------------------------------------------------
  65.  
  66. --
  67. -- Table structure for table `order_has_items`
  68. --
  69.  
  70. CREATE TABLE `order_has_items` (
  71.   `order_id` int(11) NOT NULL,
  72.   `item_id` int(11) NOT NULL,
  73.   `item_qty` int(10) NOT NULL,
  74.   `item_desc` varchar(255) DEFAULT NULL,
  75.   `item_status` varchar(255) DEFAULT NULL
  76. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  77.  
  78. -- --------------------------------------------------------
  79.  
  80. --
  81. -- Table structure for table `table`
  82. --
  83.  
  84. CREATE TABLE `table` (
  85.   `table_id` int(11) NOT NULL,
  86.   `table_name` varchar(255) NOT NULL,
  87.   `table_desc` varchar(255) DEFAULT NULL
  88. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  89.  
  90. --
  91. -- Indexes for dumped tables
  92. --
  93.  
  94. --
  95. -- Indexes for table `employee`
  96. --
  97. ALTER TABLE `employee`
  98.   ADD PRIMARY KEY (`emp_id`);
  99.  
  100. --
  101. -- Indexes for table `item`
  102. --
  103. ALTER TABLE `item`
  104.   ADD PRIMARY KEY (`item_id`);
  105.  
  106. --
  107. -- Indexes for table `order`
  108. --
  109. ALTER TABLE `order`
  110.   ADD PRIMARY KEY (`order_id`);
  111.  
  112. --
  113. -- Indexes for table `order_has_items`
  114. --
  115. ALTER TABLE `order_has_items`
  116.   ADD PRIMARY KEY (`order_id`);
  117.  
  118. --
  119. -- Indexes for table `table`
  120. --
  121. ALTER TABLE `table`
  122.   ADD PRIMARY KEY (`table_id`);
  123.  
  124. --
  125. -- Constraints for dumped tables
  126. --
  127.  
  128. --
  129. -- Constraints for table `order_has_items`
  130. --
  131. ALTER TABLE `order_has_items`
  132.   ADD CONSTRAINT `order_id_fk` FOREIGN KEY (`order_id`) REFERENCES `order` (`order_id`);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement