Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- MySQL dump 10.13
- --
- -- Host: localhost Database: x
- -- ------------------------------------------------------
- -- Server version 5.1.22-rc-community
- /*!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 */;
- /*!40101 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 */;
- --
- -- Current Database: `x`
- --
- CREATE DATABASE /*!32312 IF NOT EXISTS*/ `x` /*!40100 DEFAULT CHARACTER SET latin1 */;
- USE `x`;
- --
- -- Table structure for table `departments`
- --
- DROP TABLE IF EXISTS `departments`;
- SET @saved_cs_client = @@character_set_client;
- SET character_set_client = utf8;
- CREATE TABLE `departments` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `name` text NOT NULL,
- `manager_id` int(11) NOT NULL,
- PRIMARY KEY (`id`),
- KEY `manager_id` (`manager_id`),
- CONSTRAINT `departments_ibfk_1` FOREIGN KEY (`manager_id`) REFERENCES `managers` (`id`)
- ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
- SET character_set_client = @saved_cs_client;
- --
- -- Dumping data for table `departments`
- --
- LOCK TABLES `departments` WRITE;
- /*!40000 ALTER TABLE `departments` DISABLE KEYS */;
- INSERT INTO `departments` VALUES (1,'H32',1),(2,'X11',3);
- /*!40000 ALTER TABLE `departments` ENABLE KEYS */;
- UNLOCK TABLES;
- --
- -- Table structure for table `employees`
- --
- DROP TABLE IF EXISTS `employees`;
- SET @saved_cs_client = @@character_set_client;
- SET character_set_client = utf8;
- CREATE TABLE `employees` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `name` text NOT NULL,
- `department_id` int(11) NOT NULL,
- `manager_id` int(11) NOT NULL,
- `job_type_id` int(11) NOT NULL,
- PRIMARY KEY (`id`),
- KEY `manager_id` (`manager_id`),
- KEY `job_type_id` (`job_type_id`),
- KEY `department_id` (`department_id`),
- CONSTRAINT `employees_ibfk_1` FOREIGN KEY (`department_id`) REFERENCES `departments` (`id`),
- CONSTRAINT `employees_ibfk_2` FOREIGN KEY (`manager_id`) REFERENCES `managers` (`id`),
- CONSTRAINT `employees_ibfk_3` FOREIGN KEY (`job_type_id`) REFERENCES `job_types` (`id`)
- ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
- SET character_set_client = @saved_cs_client;
- --
- -- Dumping data for table `employees`
- --
- LOCK TABLES `employees` WRITE;
- /*!40000 ALTER TABLE `employees` DISABLE KEYS */;
- INSERT INTO `employees` VALUES (1,'Billy Bob',1,1,1),(2,'Sandra Lee',1,1,3),(3,'Buddy Holly',2,3,1);
- /*!40000 ALTER TABLE `employees` ENABLE KEYS */;
- UNLOCK TABLES;
- --
- -- Table structure for table `job_types`
- --
- DROP TABLE IF EXISTS `job_types`;
- SET @saved_cs_client = @@character_set_client;
- SET character_set_client = utf8;
- CREATE TABLE `job_types` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `jobcode` text NOT NULL,
- PRIMARY KEY (`id`)
- ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
- SET character_set_client = @saved_cs_client;
- --
- -- Dumping data for table `job_types`
- --
- LOCK TABLES `job_types` WRITE;
- /*!40000 ALTER TABLE `job_types` DISABLE KEYS */;
- INSERT INTO `job_types` VALUES (1,'DEADBEEF'),(3,'FEEDFACE');
- /*!40000 ALTER TABLE `job_types` ENABLE KEYS */;
- UNLOCK TABLES;
- --
- -- Table structure for table `managers`
- --
- DROP TABLE IF EXISTS `managers`;
- SET @saved_cs_client = @@character_set_client;
- SET character_set_client = utf8;
- CREATE TABLE `managers` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `name` text NOT NULL,
- `job_type_id` int(11) NOT NULL,
- PRIMARY KEY (`id`),
- KEY `job_type_id` (`job_type_id`),
- CONSTRAINT `managers_ibfk_1` FOREIGN KEY (`job_type_id`) REFERENCES `job_types` (`id`)
- ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
- SET character_set_client = @saved_cs_client;
- --
- -- Dumping data for table `managers`
- --
- LOCK TABLES `managers` WRITE;
- /*!40000 ALTER TABLE `managers` DISABLE KEYS */;
- INSERT INTO `managers` VALUES (1,'John',1),(3,'Michael Scott',3);
- /*!40000 ALTER TABLE `managers` 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 2010-07-14 18:06:10
Add Comment
Please, Sign In to add comment