mysql.sql 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. -- phpMyAdmin SQL Dump
  2. -- version 4.2.10
  3. -- http://www.phpmyadmin.net
  4. --
  5. -- Host: localhost:3306
  6. -- Generation Time: May 10, 2016 at 08:47 PM
  7. -- Server version: 5.5.38
  8. -- PHP Version: 5.6.2
  9. SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
  10. SET time_zone = "+00:00";
  11. --
  12. -- Database: `r2rml`
  13. --
  14. -- --------------------------------------------------------
  15. --
  16. -- Table structure for table `DEPT`
  17. --
  18. CREATE TABLE `DEPT` (
  19. `DEPTNO` int(11) NOT NULL,
  20. `DNAME` varchar(30) DEFAULT NULL,
  21. `LOC` varchar(30) DEFAULT NULL
  22. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  23. --
  24. -- Dumping data for table `DEPT`
  25. --
  26. INSERT INTO `DEPT` (`DEPTNO`, `DNAME`, `LOC`) VALUES
  27. (10, 'APPSERVER', 'NEW YORK');
  28. -- --------------------------------------------------------
  29. --
  30. -- Table structure for table `DEPT2`
  31. --
  32. CREATE TABLE `DEPT2` (
  33. `DEPTNO` int(11) DEFAULT NULL,
  34. `DNAME` varchar(30) DEFAULT NULL,
  35. `LOC` varchar(30) DEFAULT NULL
  36. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  37. --
  38. -- Dumping data for table `DEPT2`
  39. --
  40. INSERT INTO `DEPT2` (`DEPTNO`, `DNAME`, `LOC`) VALUES
  41. (10, 'APPSERVER', 'NEW YORK'),
  42. (20, 'RESEARCH', 'BOSTON');
  43. -- --------------------------------------------------------
  44. --
  45. -- Table structure for table `EMP`
  46. --
  47. CREATE TABLE `EMP` (
  48. `EMPNO` int(11) NOT NULL,
  49. `ENAME` varchar(100) DEFAULT NULL,
  50. `JOB` varchar(20) DEFAULT NULL,
  51. `DEPTNO` int(11) DEFAULT NULL
  52. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  53. --
  54. -- Dumping data for table `EMP`
  55. --
  56. INSERT INTO `EMP` (`EMPNO`, `ENAME`, `JOB`, `DEPTNO`) VALUES
  57. (7369, 'SMITH', 'CLERK', 10);
  58. -- --------------------------------------------------------
  59. --
  60. -- Table structure for table `EMP2`
  61. --
  62. CREATE TABLE `EMP2` (
  63. `EMPNO` int(11) DEFAULT NULL,
  64. `ENAME` varchar(100) DEFAULT NULL,
  65. `JOB` varchar(20) DEFAULT NULL
  66. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  67. --
  68. -- Dumping data for table `EMP2`
  69. --
  70. INSERT INTO `EMP2` (`EMPNO`, `ENAME`, `JOB`) VALUES
  71. (7369, 'SMITH', 'CLERK'),
  72. (7369, 'SMITH', 'NIGHTGUARD'),
  73. (7400, 'JONES', 'ENGINEER');
  74. -- --------------------------------------------------------
  75. --
  76. -- Table structure for table `EMP2DEPT`
  77. --
  78. CREATE TABLE `EMP2DEPT` (
  79. `EMPNO` int(11) DEFAULT NULL,
  80. `DEPTNO` int(11) DEFAULT NULL
  81. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  82. --
  83. -- Dumping data for table `EMP2DEPT`
  84. --
  85. INSERT INTO `EMP2DEPT` (`EMPNO`, `DEPTNO`) VALUES
  86. (7369, 10),
  87. (7369, 20),
  88. (7400, 10);
  89. --
  90. -- Indexes for dumped tables
  91. --
  92. --
  93. -- Indexes for table `DEPT`
  94. --
  95. ALTER TABLE `DEPT`
  96. ADD PRIMARY KEY (`DEPTNO`);
  97. --
  98. -- Indexes for table `EMP`
  99. --
  100. ALTER TABLE `EMP`
  101. ADD PRIMARY KEY (`EMPNO`), ADD KEY `DEPTNO` (`DEPTNO`);
  102. --
  103. -- Constraints for dumped tables
  104. --
  105. --
  106. -- Constraints for table `EMP`
  107. --
  108. ALTER TABLE `EMP`
  109. ADD CONSTRAINT `emp_ibfk_1` FOREIGN KEY (`DEPTNO`) REFERENCES `DEPT` (`DEPTNO`);