· 6 years ago · Oct 03, 2019, 09:28 AM
1-- MySQL dump 10.13 Distrib 5.7.21, for Linux (x86_64)
2--
3-- Host: localhost Database: friend
4-- ------------------------------------------------------
5-- Server version 5.7.21-1ubuntu1
6
7/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
8/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
9/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
10/*!40101 SET NAMES utf8 */;
11/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
12/*!40103 SET TIME_ZONE='+00:00' */;
13/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
14/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
15/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
16/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
17
18--
19-- Table structure for table `Customers`
20--
21
22DROP TABLE IF EXISTS `Customers`;
23/*!40101 SET @saved_cs_client = @@character_set_client */;
24/*!40101 SET character_set_client = utf8 */;
25CREATE TABLE `Customers` (
26 `usr_id` int(11) NOT NULL AUTO_INCREMENT,
27 `usr_fname` varchar(30) DEFAULT NULL,
28 `usr_lnamne` varchar(30) DEFAULT NULL,
29 `usr_address` varchar(100) DEFAULT NULL,
30 `usr_dob` datetime DEFAULT NULL,
31 `usr_email` varchar(50) DEFAULT NULL,
32 `usr_number` varchar(15) DEFAULT NULL,
33 PRIMARY KEY (`usr_id`)
34) ENGINE=InnoDB DEFAULT CHARSET=latin1;
35/*!40101 SET character_set_client = @saved_cs_client */;
36
37--
38-- Dumping data for table `Customers`
39--
40
41LOCK TABLES `Customers` WRITE;
42/*!40000 ALTER TABLE `Customers` DISABLE KEYS */;
43/*!40000 ALTER TABLE `Customers` ENABLE KEYS */;
44UNLOCK TABLES;
45
46--
47-- Table structure for table `OrderProduct`
48--
49
50DROP TABLE IF EXISTS `OrderProduct`;
51/*!40101 SET @saved_cs_client = @@character_set_client */;
52/*!40101 SET character_set_client = utf8 */;
53CREATE TABLE `OrderProduct` (
54 `odr_id` int(11) NOT NULL,
55 `pd_id` int(11) NOT NULL,
56 PRIMARY KEY (`odr_id`,`pd_id`)
57) ENGINE=InnoDB DEFAULT CHARSET=latin1;
58/*!40101 SET character_set_client = @saved_cs_client */;
59
60--
61-- Dumping data for table `OrderProduct`
62--
63
64LOCK TABLES `OrderProduct` WRITE;
65/*!40000 ALTER TABLE `OrderProduct` DISABLE KEYS */;
66/*!40000 ALTER TABLE `OrderProduct` ENABLE KEYS */;
67UNLOCK TABLES;
68
69--
70-- Table structure for table `Orders`
71--
72
73DROP TABLE IF EXISTS `Orders`;
74/*!40101 SET @saved_cs_client = @@character_set_client */;
75/*!40101 SET character_set_client = utf8 */;
76CREATE TABLE `Orders` (
77 `odr_id` int(11) NOT NULL AUTO_INCREMENT,
78 `odr_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
79 `fk_usr_id` int(11) NOT NULL,
80 PRIMARY KEY (`odr_id`),
81 KEY `fk_usr_id` (`fk_usr_id`),
82 CONSTRAINT `Orders_ibfk_1` FOREIGN KEY (`fk_usr_id`) REFERENCES `Customers` (`usr_id`)
83) ENGINE=InnoDB DEFAULT CHARSET=latin1;
84/*!40101 SET character_set_client = @saved_cs_client */;
85
86--
87-- Dumping data for table `Orders`
88--
89
90LOCK TABLES `Orders` WRITE;
91/*!40000 ALTER TABLE `Orders` DISABLE KEYS */;
92/*!40000 ALTER TABLE `Orders` ENABLE KEYS */;
93UNLOCK TABLES;
94
95--
96-- Table structure for table `Products`
97--
98
99DROP TABLE IF EXISTS `Products`;
100/*!40101 SET @saved_cs_client = @@character_set_client */;
101/*!40101 SET character_set_client = utf8 */;
102CREATE TABLE `Products` (
103 `pd_id` int(11) NOT NULL AUTO_INCREMENT,
104 `pd_name` varchar(200) DEFAULT NULL,
105 `pd_desc` varchar(1000) DEFAULT NULL,
106 `pd_price` decimal(10,2) DEFAULT NULL,
107 `pd_quantity` int(11) DEFAULT NULL,
108 PRIMARY KEY (`pd_id`)
109) ENGINE=InnoDB DEFAULT CHARSET=latin1;
110/*!40101 SET character_set_client = @saved_cs_client */;
111
112--
113-- Dumping data for table `Products`
114--
115
116LOCK TABLES `Products` WRITE;
117/*!40000 ALTER TABLE `Products` DISABLE KEYS */;
118/*!40000 ALTER TABLE `Products` ENABLE KEYS */;
119UNLOCK TABLES;
120/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
121
122/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
123/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
124/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
125/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
126/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
127/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
128/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
129
130-- Dump completed on 2019-09-27 11:30:01