-- MySQL dump 10.13 Distrib 8.0.19, for Win64 (x86_64) -- -- Host: 127.0.0.1 Database: company -- ------------------------------------------------------ -- Server version 8.0.19 /*!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 `department` -- DROP TABLE IF EXISTS `department`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `department` ( `id` int NOT NULL AUTO_INCREMENT, `name` varchar(50) DEFAULT NULL, `location` varchar(100) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `department` -- LOCK TABLES `department` WRITE; /*!40000 ALTER TABLE `department` DISABLE KEYS */; INSERT INTO `department` VALUES (1,'finance','New York'),(2,'PR','Paris'),(3,'marketing','Geneva'),(4,'development','Bucharest'); /*!40000 ALTER TABLE `department` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `employee` -- DROP TABLE IF EXISTS `employee`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `employee` ( `id` int NOT NULL AUTO_INCREMENT, `department_id` int DEFAULT NULL, `position_id` int DEFAULT NULL, `manager_id` int DEFAULT NULL, `name` varchar(50) DEFAULT NULL, `salary` decimal(10,2) DEFAULT NULL, `hire_date` datetime DEFAULT NULL, PRIMARY KEY (`id`), KEY `fk_employee_department_idx` (`department_id`), KEY `fk_employee_position_idx` (`position_id`), KEY `fk_employee_manager_idx` (`manager_id`), CONSTRAINT `fk_employee_department` FOREIGN KEY (`department_id`) REFERENCES `department` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_employee_manager` FOREIGN KEY (`manager_id`) REFERENCES `employee` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_employee_position` FOREIGN KEY (`position_id`) REFERENCES `position` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `employee` -- LOCK TABLES `employee` WRITE; /*!40000 ALTER TABLE `employee` DISABLE KEYS */; INSERT INTO `employee` VALUES (1,1,1,NULL,'Big Hoss',10000.00,'2018-10-18 00:00:00'),(2,1,1,1,'Marc Rich',8000.00,'2018-10-18 00:00:00'),(3,2,2,1,'Russell Hobbs',5000.00,'2018-11-17 00:00:00'),(4,3,2,1,'John Edsel',6000.00,'2018-11-21 00:00:00'),(5,4,2,1,'Larry Code',6500.00,'2018-10-19 00:00:00'),(6,1,3,2,'George Banking',4500.00,'2019-01-15 00:00:00'),(7,2,3,3,'Ricky Martini',3500.00,'2019-02-18 00:00:00'),(8,3,4,4,'Henry Bird',3000.00,'2019-01-18 00:00:00'),(9,4,5,5,'Linus Codecamper',5000.00,'2019-01-21 00:00:00'),(10,4,5,5,'Satoshi Bitcoin',0.00,'2019-04-21 00:00:00'),(11,4,5,5,'Mark Sugar-Mountain',5500.00,'2019-06-21 00:00:00'),(12,3,4,4,'Popeye Sailor',2500.00,'2018-11-21 00:00:00'),(13,2,3,3,'Gabriela Catastrofirea',4000.00,'2018-11-22 00:00:00'),(14,1,3,2,'Omul Paiangan',3000.00,'2019-05-12 00:00:00'),(15,2,4,3,'Agamemnon Dandanache',2000.00,'2019-08-12 00:00:00'),(16,3,3,4,'Dale Carnavalului',2500.00,'2019-09-12 00:00:00'),(17,4,5,5,'Richard Computerman',3000.00,'2019-10-12 00:00:00'),(18,4,5,5,'Bjarn Strupsoup',3000.00,'2019-11-12 00:00:00'),(19,2,4,3,'Tony Stark',10000.00,'2019-04-26 00:00:00'),(20,2,4,3,'Captain America',10000.00,'2019-04-26 00:00:00'),(21,4,3,5,'Mafaldea',5000.00,'2018-11-21 00:00:00'); /*!40000 ALTER TABLE `employee` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `position` -- DROP TABLE IF EXISTS `position`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `position` ( `id` int NOT NULL AUTO_INCREMENT, `name` varchar(50) DEFAULT NULL, `description` varchar(200) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `name_UNIQUE` (`name`) ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `position` -- LOCK TABLES `position` WRITE; /*!40000 ALTER TABLE `position` DISABLE KEYS */; INSERT INTO `position` VALUES (1,'president','You have to give the impression that all is going well. Your attributions are: rotate on the president\'s chair and give orders left and right.'),(2,'manager','My boss arrived at work in a brand-new Lamborghini. I said, \"wow, that\'s cool!\". He said \"If you work hard, I\'ll get another one next year.\"'),(3,'analyst','Ability to tactfully explain to clients why three parrallel lines can\'t intersect, be red and transparent at the same time'),(4,'salesman','If the opportunity knocks, sell the door'),(5,'dev','Software Developer (aka. Dev) – An organism that turns caffeine into software'); /*!40000 ALTER TABLE `position` 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 2020-03-16 17:10:53