-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrestaurant.sql
141 lines (122 loc) · 5.57 KB
/
restaurant.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
-- MySQL dump 10.13 Distrib 8.0.21, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: restaurant
-- ------------------------------------------------------
-- Server version 8.0.21
/*!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 */;
/*!50503 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `customer`
--
DROP TABLE IF EXISTS `customer`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `customer` (
`customer_id` int NOT NULL AUTO_INCREMENT,
`fullName` varchar(45) NOT NULL,
`username` varchar(45) NOT NULL,
`password` varchar(45) NOT NULL,
`address` varchar(255) NOT NULL,
`phone` varchar(45) NOT NULL,
PRIMARY KEY (`customer_id`)
) ENGINE=InnoDB AUTO_INCREMENT=48 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `customer`
--
LOCK TABLES `customer` WRITE;
/*!40000 ALTER TABLE `customer` DISABLE KEYS */;
INSERT INTO `customer` VALUES (46,'admin','admin','admin','iran','98324324'),(47,'zahra safari','zs','zs','iran,tehran','98324324');
/*!40000 ALTER TABLE `customer` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `food`
--
DROP TABLE IF EXISTS `food`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `food` (
`food_id` int NOT NULL AUTO_INCREMENT,
`foodName` varchar(45) NOT NULL,
`foodPrice` double NOT NULL,
`isAvaluable` int NOT NULL,
`foodPicPath` varchar(255) DEFAULT NULL,
`type` varchar(45) NOT NULL,
PRIMARY KEY (`food_id`)
) ENGINE=InnoDB AUTO_INCREMENT=80 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `food`
--
LOCK TABLES `food` WRITE;
/*!40000 ALTER TABLE `food` DISABLE KEYS */;
INSERT INTO `food` VALUES (65,'Pizza',23,1,'/img/Pizza20210417025513.jpg','food'),(66,'pasta',33,1,'/img/pasta20210417025626.jpg','food'),(67,'Neapolitan',32,1,'/img/Neapolitan20210417030218.jpg','food'),(68,'Sicilian Pizza',32,1,'/img/Sicilian Pizza20210417030255.jpg','food'),(69,'Greek Pizza',43,1,'/img/Greek Pizza20210417030325.jpg','food'),(71,'black coffee',3,1,'/img/black coffee20210417031044.jpg','drink'),(72,'coca cola',5,1,'/img/coca cola20210417031123.jpg','drink'),(73,'tea',3,1,'/img/tea20210417031146.jpg','drink'),(74,'mohito',7,0,'/img/mohito20210417031324.jpg','drink'),(75,'catchup',25,1,'/img/catchup20210417031514.jpg','sas'),(76,'Front Street Heat',33,1,'/img/Front Street Heat20210417032355.jpg','sas'),(77,'Clean Mango Hot ',43,1,'/img/Clean Mango Hot 20210417032450.jpg','sas'),(78,'Habanero Pepper',32,1,'/img/Habanero Pepper20210417032912.jpg','sas'),(79,'Yellowbird, Habanero ',32,1,'/img/Yellowbird, Habanero 20210417032957.jpg','sas');
/*!40000 ALTER TABLE `food` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `order`
--
DROP TABLE IF EXISTS `order`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `order` (
`order_id` int NOT NULL AUTO_INCREMENT,
`orderTime` datetime NOT NULL,
`status` varchar(45) NOT NULL,
`customer_id` int NOT NULL,
`total_price` double DEFAULT NULL,
`deliverTime` datetime DEFAULT NULL,
PRIMARY KEY (`order_id`),
KEY `fk_Order_Customer` (`customer_id`),
CONSTRAINT `fk_Order_Customer` FOREIGN KEY (`customer_id`) REFERENCES `customer` (`customer_id`)
) ENGINE=InnoDB AUTO_INCREMENT=44 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `order`
--
LOCK TABLES `order` WRITE;
/*!40000 ALTER TABLE `order` DISABLE KEYS */;
/*!40000 ALTER TABLE `order` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `order_detail`
--
DROP TABLE IF EXISTS `order_detail`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `order_detail` (
`order_detail_id` int NOT NULL AUTO_INCREMENT,
`order_id` int NOT NULL,
`food_id` int NOT NULL,
`count` int NOT NULL,
PRIMARY KEY (`order_detail_id`),
KEY `fk_OrderDetail_Order` (`order_id`),
KEY `fk_OrderDetail_Food` (`food_id`),
CONSTRAINT `fk_OrderDetail_Food` FOREIGN KEY (`food_id`) REFERENCES `food` (`food_id`),
CONSTRAINT `fk_OrderDetail_Order` FOREIGN KEY (`order_id`) REFERENCES `order` (`order_id`)
) ENGINE=InnoDB AUTO_INCREMENT=136 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `order_detail`
--
LOCK TABLES `order_detail` WRITE;
/*!40000 ALTER TABLE `order_detail` DISABLE KEYS */;
/*!40000 ALTER TABLE `order_detail` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!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 */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2021-04-17 3:44:59