· 7 years ago · Nov 12, 2018, 12:42 PM
1-- MySQL dump 10.16 Distrib 10.1.36-MariaDB, for Win32 (AMD64)
2--
3-- Host: localhost Database: EmployeeTable
4-- ------------------------------------------------------
5-- Server version 10.1.36-MariaDB
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 `departments`
20--
21
22DROP TABLE IF EXISTS `departments`;
23/*!40101 SET @saved_cs_client = @@character_set_client */;
24/*!40101 SET character_set_client = utf8 */;
25CREATE TABLE `departments` (
26 `dept_no` char(4) NOT NULL,
27 `dept_name` varchar(40) NOT NULL,
28 PRIMARY KEY (`dept_no`)
29) ENGINE=InnoDB DEFAULT CHARSET=latin1;
30/*!40101 SET character_set_client = @saved_cs_client */;
31
32--
33-- Dumping data for table `departments`
34--
35
36LOCK TABLES `departments` WRITE;
37/*!40000 ALTER TABLE `departments` DISABLE KEYS */;
38/*!40000 ALTER TABLE `departments` ENABLE KEYS */;
39UNLOCK TABLES;
40
41--
42-- Table structure for table `dept_emp`
43--
44
45DROP TABLE IF EXISTS `dept_emp`;
46/*!40101 SET @saved_cs_client = @@character_set_client */;
47/*!40101 SET character_set_client = utf8 */;
48CREATE TABLE `dept_emp` (
49 `emp_no` int(11) NOT NULL AUTO_INCREMENT,
50 `dept_no` char(4) NOT NULL,
51 `from_date` date NOT NULL,
52 `to_date` date NOT NULL,
53 KEY `emp_no` (`emp_no`),
54 KEY `dept_no` (`dept_no`),
55 CONSTRAINT `dept_emp_ibfk_1` FOREIGN KEY (`emp_no`) REFERENCES `employees` (`emp_no`),
56 CONSTRAINT `dept_emp_ibfk_2` FOREIGN KEY (`dept_no`) REFERENCES `departments` (`dept_no`)
57) ENGINE=InnoDB DEFAULT CHARSET=latin1;
58/*!40101 SET character_set_client = @saved_cs_client */;
59
60--
61-- Dumping data for table `dept_emp`
62--
63
64LOCK TABLES `dept_emp` WRITE;
65/*!40000 ALTER TABLE `dept_emp` DISABLE KEYS */;
66/*!40000 ALTER TABLE `dept_emp` ENABLE KEYS */;
67UNLOCK TABLES;
68
69--
70-- Table structure for table `dept_manager`
71--
72
73DROP TABLE IF EXISTS `dept_manager`;
74/*!40101 SET @saved_cs_client = @@character_set_client */;
75/*!40101 SET character_set_client = utf8 */;
76CREATE TABLE `dept_manager` (
77 `dept_no` char(4) NOT NULL,
78 `emp_no` int(11) NOT NULL AUTO_INCREMENT,
79 `from_date` date NOT NULL,
80 `to_date` date NOT NULL,
81 KEY `dept_no` (`dept_no`),
82 KEY `emp_no` (`emp_no`),
83 CONSTRAINT `dept_manager_ibfk_1` FOREIGN KEY (`dept_no`) REFERENCES `departments` (`dept_no`),
84 CONSTRAINT `dept_manager_ibfk_2` FOREIGN KEY (`emp_no`) REFERENCES `employees` (`emp_no`)
85) ENGINE=InnoDB DEFAULT CHARSET=latin1;
86/*!40101 SET character_set_client = @saved_cs_client */;
87
88--
89-- Dumping data for table `dept_manager`
90--
91
92LOCK TABLES `dept_manager` WRITE;
93/*!40000 ALTER TABLE `dept_manager` DISABLE KEYS */;
94/*!40000 ALTER TABLE `dept_manager` ENABLE KEYS */;
95UNLOCK TABLES;
96
97--
98-- Table structure for table `employees`
99--
100
101DROP TABLE IF EXISTS `employees`;
102/*!40101 SET @saved_cs_client = @@character_set_client */;
103/*!40101 SET character_set_client = utf8 */;
104CREATE TABLE `employees` (
105 `emp_no` int(11) NOT NULL AUTO_INCREMENT,
106 `birth_date` date NOT NULL,
107 `first_name` varchar(14) NOT NULL,
108 `last_name` varchar(16) NOT NULL,
109 `gender` enum('M','F') NOT NULL,
110 `hire_date` date NOT NULL,
111 PRIMARY KEY (`emp_no`)
112) ENGINE=InnoDB DEFAULT CHARSET=latin1;
113/*!40101 SET character_set_client = @saved_cs_client */;
114
115--
116-- Dumping data for table `employees`
117--
118
119LOCK TABLES `employees` WRITE;
120/*!40000 ALTER TABLE `employees` DISABLE KEYS */;
121/*!40000 ALTER TABLE `employees` ENABLE KEYS */;
122UNLOCK TABLES;
123
124--
125-- Table structure for table `salaries`
126--
127
128DROP TABLE IF EXISTS `salaries`;
129/*!40101 SET @saved_cs_client = @@character_set_client */;
130/*!40101 SET character_set_client = utf8 */;
131CREATE TABLE `salaries` (
132 `emp_no` int(11) NOT NULL AUTO_INCREMENT,
133 `salary` int(11) NOT NULL,
134 `from_date` date NOT NULL,
135 `to_date` date NOT NULL,
136 PRIMARY KEY (`from_date`),
137 KEY `emp_no` (`emp_no`),
138 CONSTRAINT `salaries_ibfk_1` FOREIGN KEY (`emp_no`) REFERENCES `employees` (`emp_no`)
139) ENGINE=InnoDB DEFAULT CHARSET=latin1;
140/*!40101 SET character_set_client = @saved_cs_client */;
141
142--
143-- Dumping data for table `salaries`
144--
145
146LOCK TABLES `salaries` WRITE;
147/*!40000 ALTER TABLE `salaries` DISABLE KEYS */;
148/*!40000 ALTER TABLE `salaries` ENABLE KEYS */;
149UNLOCK TABLES;
150
151--
152-- Table structure for table `titles`
153--
154
155DROP TABLE IF EXISTS `titles`;
156/*!40101 SET @saved_cs_client = @@character_set_client */;
157/*!40101 SET character_set_client = utf8 */;
158CREATE TABLE `titles` (
159 `emp_no` int(11) NOT NULL AUTO_INCREMENT,
160 `title` varchar(50) NOT NULL,
161 `from_date` date NOT NULL,
162 `to_date` date NOT NULL,
163 PRIMARY KEY (`title`,`from_date`),
164 KEY `emp_no` (`emp_no`),
165 CONSTRAINT `titles_ibfk_1` FOREIGN KEY (`emp_no`) REFERENCES `employees` (`emp_no`)
166) ENGINE=InnoDB DEFAULT CHARSET=latin1;
167/*!40101 SET character_set_client = @saved_cs_client */;
168
169--
170-- Dumping data for table `titles`
171--
172
173LOCK TABLES `titles` WRITE;
174/*!40000 ALTER TABLE `titles` DISABLE KEYS */;
175/*!40000 ALTER TABLE `titles` ENABLE KEYS */;
176UNLOCK TABLES;
177/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
178
179/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
180/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
181/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
182/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
183/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
184/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
185/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
186
187-- Dump completed on 2018-11-12 5:35:58