Guest User

Example SQL Dump

a guest
Jul 14th, 2010
280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 4.92 KB | None | 0 0
  1. -- MySQL dump 10.13
  2. --
  3. -- Host: localhost    Database: x
  4. -- ------------------------------------------------------
  5. -- Server version   5.1.22-rc-community
  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. -- Current Database: `x`
  20. --
  21.  
  22. CREATE DATABASE /*!32312 IF NOT EXISTS*/ `x` /*!40100 DEFAULT CHARACTER SET latin1 */;
  23.  
  24. USE `x`;
  25.  
  26. --
  27. -- Table structure for table `departments`
  28. --
  29.  
  30. DROP TABLE IF EXISTS `departments`;
  31. SET @saved_cs_client     = @@character_set_client;
  32. SET character_set_client = utf8;
  33. CREATE TABLE `departments` (
  34.   `id` int(11) NOT NULL AUTO_INCREMENT,
  35.   `name` text NOT NULL,
  36.   `manager_id` int(11) NOT NULL,
  37.   PRIMARY KEY (`id`),
  38.   KEY `manager_id` (`manager_id`),
  39.   CONSTRAINT `departments_ibfk_1` FOREIGN KEY (`manager_id`) REFERENCES `managers` (`id`)
  40. ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
  41. SET character_set_client = @saved_cs_client;
  42.  
  43. --
  44. -- Dumping data for table `departments`
  45. --
  46.  
  47. LOCK TABLES `departments` WRITE;
  48. /*!40000 ALTER TABLE `departments` DISABLE KEYS */;
  49. INSERT INTO `departments` VALUES (1,'H32',1),(2,'X11',3);
  50. /*!40000 ALTER TABLE `departments` ENABLE KEYS */;
  51. UNLOCK TABLES;
  52.  
  53. --
  54. -- Table structure for table `employees`
  55. --
  56.  
  57. DROP TABLE IF EXISTS `employees`;
  58. SET @saved_cs_client     = @@character_set_client;
  59. SET character_set_client = utf8;
  60. CREATE TABLE `employees` (
  61.   `id` int(11) NOT NULL AUTO_INCREMENT,
  62.   `name` text NOT NULL,
  63.   `department_id` int(11) NOT NULL,
  64.   `manager_id` int(11) NOT NULL,
  65.   `job_type_id` int(11) NOT NULL,
  66.   PRIMARY KEY (`id`),
  67.   KEY `manager_id` (`manager_id`),
  68.   KEY `job_type_id` (`job_type_id`),
  69.   KEY `department_id` (`department_id`),
  70.   CONSTRAINT `employees_ibfk_1` FOREIGN KEY (`department_id`) REFERENCES `departments` (`id`),
  71.   CONSTRAINT `employees_ibfk_2` FOREIGN KEY (`manager_id`) REFERENCES `managers` (`id`),
  72.   CONSTRAINT `employees_ibfk_3` FOREIGN KEY (`job_type_id`) REFERENCES `job_types` (`id`)
  73. ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
  74. SET character_set_client = @saved_cs_client;
  75.  
  76. --
  77. -- Dumping data for table `employees`
  78. --
  79.  
  80. LOCK TABLES `employees` WRITE;
  81. /*!40000 ALTER TABLE `employees` DISABLE KEYS */;
  82. INSERT INTO `employees` VALUES (1,'Billy Bob',1,1,1),(2,'Sandra Lee',1,1,3),(3,'Buddy Holly',2,3,1);
  83. /*!40000 ALTER TABLE `employees` ENABLE KEYS */;
  84. UNLOCK TABLES;
  85.  
  86. --
  87. -- Table structure for table `job_types`
  88. --
  89.  
  90. DROP TABLE IF EXISTS `job_types`;
  91. SET @saved_cs_client     = @@character_set_client;
  92. SET character_set_client = utf8;
  93. CREATE TABLE `job_types` (
  94.   `id` int(11) NOT NULL AUTO_INCREMENT,
  95.   `jobcode` text NOT NULL,
  96.   PRIMARY KEY (`id`)
  97. ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
  98. SET character_set_client = @saved_cs_client;
  99.  
  100. --
  101. -- Dumping data for table `job_types`
  102. --
  103.  
  104. LOCK TABLES `job_types` WRITE;
  105. /*!40000 ALTER TABLE `job_types` DISABLE KEYS */;
  106. INSERT INTO `job_types` VALUES (1,'DEADBEEF'),(3,'FEEDFACE');
  107. /*!40000 ALTER TABLE `job_types` ENABLE KEYS */;
  108. UNLOCK TABLES;
  109.  
  110. --
  111. -- Table structure for table `managers`
  112. --
  113.  
  114. DROP TABLE IF EXISTS `managers`;
  115. SET @saved_cs_client     = @@character_set_client;
  116. SET character_set_client = utf8;
  117. CREATE TABLE `managers` (
  118.   `id` int(11) NOT NULL AUTO_INCREMENT,
  119.   `name` text NOT NULL,
  120.   `job_type_id` int(11) NOT NULL,
  121.   PRIMARY KEY (`id`),
  122.   KEY `job_type_id` (`job_type_id`),
  123.   CONSTRAINT `managers_ibfk_1` FOREIGN KEY (`job_type_id`) REFERENCES `job_types` (`id`)
  124. ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
  125. SET character_set_client = @saved_cs_client;
  126.  
  127. --
  128. -- Dumping data for table `managers`
  129. --
  130.  
  131. LOCK TABLES `managers` WRITE;
  132. /*!40000 ALTER TABLE `managers` DISABLE KEYS */;
  133. INSERT INTO `managers` VALUES (1,'John',1),(3,'Michael Scott',3);
  134. /*!40000 ALTER TABLE `managers` ENABLE KEYS */;
  135. UNLOCK TABLES;
  136. /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
  137.  
  138. /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
  139. /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
  140. /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
  141. /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
  142. /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
  143. /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
  144. /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
  145.  
  146. -- Dump completed on 2010-07-14 18:06:10
Add Comment
Please, Sign In to add comment