· 8 years ago · Mar 11, 2018, 10:58 AM
1CREATE DATABASE IF NOT EXISTS `kruti` /*!40100 DEFAULT CHARACTER SET latin1 */;
2USE `kruti`;
3-- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64)
4--
5-- Host: localhost Database: kruti
6-- ------------------------------------------------------
7-- Server version 5.6.20
8
9/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
10/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
11/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
12/*!40101 SET NAMES utf8 */;
13/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
14/*!40103 SET TIME_ZONE='+00:00' */;
15/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
16/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
17/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
18/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
19
20--
21-- Table structure for table `address`
22--
23
24DROP TABLE IF EXISTS `address`;
25/*!40101 SET @saved_cs_client = @@character_set_client */;
26/*!40101 SET character_set_client = utf8 */;
27CREATE TABLE `address` (
28 `id` int(11) NOT NULL AUTO_INCREMENT,
29 `place` varchar(45) DEFAULT NULL,
30 PRIMARY KEY (`id`)
31) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;
32/*!40101 SET character_set_client = @saved_cs_client */;
33
34--
35-- Dumping data for table `address`
36--
37
38LOCK TABLES `address` WRITE;
39/*!40000 ALTER TABLE `address` DISABLE KEYS */;
40INSERT INTO `address` VALUES (1,'ecity'),(2,'btm'),(3,'marathalli'),(4,'puri');
41/*!40000 ALTER TABLE `address` ENABLE KEYS */;
42UNLOCK TABLES;
43
44--
45-- Table structure for table `department`
46--
47
48DROP TABLE IF EXISTS `department`;
49/*!40101 SET @saved_cs_client = @@character_set_client */;
50/*!40101 SET character_set_client = utf8 */;
51CREATE TABLE `department` (
52 `id` int(11) NOT NULL AUTO_INCREMENT,
53 `dept_name` varchar(45) DEFAULT NULL,
54 PRIMARY KEY (`id`)
55) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;
56/*!40101 SET character_set_client = @saved_cs_client */;
57
58--
59-- Dumping data for table `department`
60--
61
62LOCK TABLES `department` WRITE;
63/*!40000 ALTER TABLE `department` DISABLE KEYS */;
64INSERT INTO `department` VALUES (1,'ECE'),(2,'EEE'),(3,'CSE'),(4,'CIVIL'),(5,'MECH');
65/*!40000 ALTER TABLE `department` ENABLE KEYS */;
66UNLOCK TABLES;
67
68--
69-- Table structure for table `employee`
70--
71
72DROP TABLE IF EXISTS `employee`;
73/*!40101 SET @saved_cs_client = @@character_set_client */;
74/*!40101 SET character_set_client = utf8 */;
75CREATE TABLE `employee` (
76 `id` int(11) NOT NULL AUTO_INCREMENT,
77 `first_name` varchar(45) NOT NULL,
78 `last_name` varchar(45) NOT NULL,
79 `address_id` int(11) NOT NULL,
80 `dept_id` int(11) NOT NULL,
81 `manager_id` int(11) NOT NULL,
82 PRIMARY KEY (`id`),
83 KEY `fk_addr_idx` (`address_id`),
84 KEY `fk_dep_id_idx` (`dept_id`),
85 CONSTRAINT `fk_adress_id` FOREIGN KEY (`address_id`) REFERENCES `address` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
86 CONSTRAINT `fk_dep_id` FOREIGN KEY (`dept_id`) REFERENCES `department` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
87) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=latin1;
88/*!40101 SET character_set_client = @saved_cs_client */;
89
90--
91-- Dumping data for table `employee`
92--
93
94LOCK TABLES `employee` WRITE;
95/*!40000 ALTER TABLE `employee` DISABLE KEYS */;
96INSERT INTO `employee` VALUES (1,'pratyush','dalai',1,1,6),(2,'kruti','pradhan',2,1,1),(3,'ritesh','apat',3,1,3),(4,'shubham','swain',3,1,1),(5,'asish','pradhan',2,2,2),(7,'pratyush','ranjan',1,2,3),(8,'pratyush','ranjan',2,3,6),(9,'asish','pradhan',1,1,6),(10,'asish','pradhan',1,1,6),(11,'pratyush','ranjan',1,2,3);
97/*!40000 ALTER TABLE `employee` ENABLE KEYS */;
98UNLOCK TABLES;
99
100--
101-- Dumping events for database 'kruti'
102--
103/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
104
105/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
106/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
107/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
108/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
109/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
110/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
111/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
112
113-- Dump completed on 2018-03-11 16:22:09