· 11 years ago · Mar 18, 2015, 07:27 AM
1-- phpMyAdmin SQL Dump
2-- version 4.0.4
3-- http://www.phpmyadmin.net
4--
5-- Host: 127.0.0.1
6-- Generation Time: Mar 18, 2015 at 08:23 AM
7-- Server version: 5.5.32
8-- PHP Version: 5.4.16
9
10SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
11SET time_zone = "+00:00";
12
13
14/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
15/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
16/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
17/*!40101 SET NAMES utf8 */;
18
19--
20-- Database: `dbacademy`
21--
22CREATE DATABASE IF NOT EXISTS `dbacademy` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
23USE `dbacademy`;
24
25-- --------------------------------------------------------
26
27--
28-- Table structure for table `majors`
29--
30
31CREATE TABLE IF NOT EXISTS `majors` (
32 `id` int(11) NOT NULL AUTO_INCREMENT,
33 `name` varchar(100) NOT NULL,
34 `created` datetime NOT NULL,
35 `modfied` datetime NOT NULL,
36 PRIMARY KEY (`id`)
37) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;
38
39--
40-- Dumping data for table `majors`
41--
42
43INSERT INTO `majors` (`id`, `name`, `created`, `modfied`) VALUES
44(3, 'Sistem Informasi', '2015-03-14 06:09:00', '2015-03-14 06:09:00'),
45(4, 'Teknik Informatika', '2015-03-14 06:09:00', '2015-03-14 06:09:00');
46
47-- --------------------------------------------------------
48
49--
50-- Table structure for table `students`
51--
52
53CREATE TABLE IF NOT EXISTS `students` (
54 `id` int(11) NOT NULL AUTO_INCREMENT,
55 `nama` varchar(100) NOT NULL,
56 `tanggal_lahir` date NOT NULL,
57 `jk` enum('L','P') NOT NULL,
58 `alamat` text NOT NULL,
59 `agama` varchar(20) NOT NULL,
60 `phone` varchar(20) NOT NULL,
61 `email` varchar(255) NOT NULL,
62 `picture` varchar(255) NOT NULL,
63 `angkatan` int(11) NOT NULL,
64 `major_id` int(11) NOT NULL,
65 `created` datetime NOT NULL,
66 `modified` datetime NOT NULL,
67 `status` enum('unregister','aktif','alumni','cuti') NOT NULL,
68 PRIMARY KEY (`id`),
69 KEY `major_id` (`major_id`)
70) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1503002 ;
71
72--
73-- Dumping data for table `students`
74--
75
76INSERT INTO `students` (`id`, `nama`, `tanggal_lahir`, `jk`, `alamat`, `agama`, `phone`, `email`, `picture`, `angkatan`, `major_id`, `created`, `modified`, `status`) VALUES
77(1503001, 'Yanuar Nurcahyo', '1995-03-18', 'L', 'Jl. Bojonggede Dalam RT 06/12 No. 46, Jawa Barat, Bogor, 16320', 'Islam', '08561960986', 'yanuar@gmail.com', 'DSC00183.JPG', 2012, 4, '2015-03-18 07:28:23', '2015-03-18 07:28:23', 'aktif');
78
79-- --------------------------------------------------------
80
81--
82-- Table structure for table `subjects`
83--
84
85CREATE TABLE IF NOT EXISTS `subjects` (
86 `id` int(11) NOT NULL AUTO_INCREMENT,
87 `kode_matkul` varchar(15) NOT NULL,
88 `nama_matkul` varchar(100) NOT NULL,
89 `semester` int(11) NOT NULL,
90 `jumlah_sks` int(11) NOT NULL,
91 `subjects_precondition_count` int(11) NOT NULL,
92 `created` datetime NOT NULL,
93 `modified` datetime NOT NULL,
94 `status` enum('enabled','disabled') NOT NULL,
95 PRIMARY KEY (`id`),
96 UNIQUE KEY `kode_matkul` (`kode_matkul`)
97) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=16 ;
98
99--
100-- Dumping data for table `subjects`
101--
102
103INSERT INTO `subjects` (`id`, `kode_matkul`, `nama_matkul`, `semester`, `jumlah_sks`, `subjects_precondition_count`, `created`, `modified`, `status`) VALUES
104(9, 'MK00001', 'English 1', 1, 0, 0, '2015-03-17 22:20:59', '2015-03-17 22:20:59', 'enabled'),
105(10, 'MK00002', 'English 2', 2, 0, 0, '2015-03-17 22:21:18', '2015-03-17 22:21:18', 'enabled'),
106(11, 'MK00003', 'English 3', 3, 0, 0, '2015-03-17 22:23:45', '2015-03-17 23:17:24', 'enabled'),
107(12, 'MK00004', 'Algorthm', 1, 3, 0, '2015-03-18 07:32:34', '2015-03-18 07:32:34', 'enabled'),
108(13, 'MK00005', 'Advanced Algorithm', 2, 2, 0, '2015-03-18 07:32:58', '2015-03-18 07:32:58', 'enabled'),
109(14, 'MK00006', 'Database Design', 2, 3, 0, '2015-03-18 07:41:57', '2015-03-18 07:41:57', 'enabled'),
110(15, 'MK00007', 'Database Technologies For Web Applications', 5, 3, 0, '2015-03-18 07:45:17', '2015-03-18 07:45:17', 'enabled');
111
112-- --------------------------------------------------------
113
114--
115-- Table structure for table `subjects_majors`
116--
117
118CREATE TABLE IF NOT EXISTS `subjects_majors` (
119 `major_id` int(11) NOT NULL,
120 `subject_id` int(11) NOT NULL,
121 KEY `major_id` (`major_id`,`subject_id`),
122 KEY `subject_id` (`subject_id`)
123) ENGINE=InnoDB DEFAULT CHARSET=latin1;
124
125-- --------------------------------------------------------
126
127--
128-- Table structure for table `subjects_preconditions`
129--
130
131CREATE TABLE IF NOT EXISTS `subjects_preconditions` (
132 `precondition_id` varchar(15) NOT NULL,
133 `subject_id` int(11) NOT NULL,
134 KEY `precondition_id` (`precondition_id`,`subject_id`),
135 KEY `subject_id` (`subject_id`)
136) ENGINE=InnoDB DEFAULT CHARSET=latin1;
137
138--
139-- Dumping data for table `subjects_preconditions`
140--
141
142INSERT INTO `subjects_preconditions` (`precondition_id`, `subject_id`) VALUES
143('10', 11),
144('12', 13),
145('14', 15),
146('9', 10),
147('9', 11);
148
149-- --------------------------------------------------------
150
151--
152-- Table structure for table `tags`
153--
154
155CREATE TABLE IF NOT EXISTS `tags` (
156 `id` varchar(11) NOT NULL,
157 `name` varchar(64) NOT NULL,
158 `created` datetime NOT NULL,
159 `modified` datetime NOT NULL,
160 `status` tinyint(4) NOT NULL DEFAULT '0',
161 PRIMARY KEY (`id`)
162) ENGINE=InnoDB DEFAULT CHARSET=latin1;
163
164--
165-- Dumping data for table `tags`
166--
167
168INSERT INTO `tags` (`id`, `name`, `created`, `modified`, `status`) VALUES
169('1', 'Phalcon', '2014-09-17 10:46:04', '2014-09-17 11:03:24', 0),
170('10', 'MVC', '2014-09-20 09:15:49', '2014-09-20 09:15:49', 0),
171('11', 'BLog', '2014-09-22 16:20:31', '2014-09-22 16:20:31', 0),
172('12', 'Info', '2014-09-22 16:20:47', '2014-09-22 16:20:47', 0),
173('13', 'Gadget', '2014-09-26 07:58:40', '2014-09-26 07:58:40', 0),
174('14', 'IPhone', '2014-09-26 07:58:47', '2014-09-26 07:58:47', 0),
175('15', 'Smartphone', '2014-09-26 07:58:53', '2014-09-26 07:58:53', 0),
176('2', 'Framework', '2014-09-17 11:10:23', '2014-09-17 11:10:23', 0),
177('3', 'Database', '2014-09-17 11:10:30', '2014-09-17 11:10:30', 0),
178('4', 'PHP', '2014-09-17 11:10:34', '2014-09-17 11:10:34', 0),
179('5', 'MongoDB', '2014-09-17 15:09:49', '2014-09-17 15:09:49', 0),
180('6', 'MySQL', '2014-09-17 15:09:56', '2014-09-17 15:09:56', 0),
181('7', 'NOSQL', '2014-09-17 17:46:47', '2014-09-17 17:46:47', 0),
182('8', 'Error', '2014-09-18 08:54:31', '2014-09-18 08:54:31', 0),
183('9', 'CakePHP', '2014-09-20 09:15:42', '2014-09-20 09:15:42', 0);
184
185-- --------------------------------------------------------
186
187--
188-- Table structure for table `teachers`
189--
190
191CREATE TABLE IF NOT EXISTS `teachers` (
192 `id` int(15) NOT NULL AUTO_INCREMENT,
193 `kode_dosen` varchar(15) NOT NULL,
194 `nama` varchar(100) NOT NULL,
195 `tanggal_lahir` date NOT NULL,
196 `jk` enum('L','P') NOT NULL,
197 `alamat` text NOT NULL,
198 `agama` varchar(20) NOT NULL,
199 `phone` varchar(20) NOT NULL,
200 `email` varchar(255) NOT NULL,
201 `picture` varchar(255) NOT NULL,
202 `created` datetime NOT NULL,
203 `modified` datetime NOT NULL,
204 `status` enum('tetap','tidak tetap','aktif','non aktif') NOT NULL,
205 PRIMARY KEY (`id`),
206 UNIQUE KEY `kode_dosen` (`kode_dosen`)
207) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;
208
209--
210-- Dumping data for table `teachers`
211--
212
213INSERT INTO `teachers` (`id`, `kode_dosen`, `nama`, `tanggal_lahir`, `jk`, `alamat`, `agama`, `phone`, `email`, `picture`, `created`, `modified`, `status`) VALUES
214(2, 'DS00002', 'Siti Quraini', '2015-03-17', 'L', 'Jl. Bogor', 'Islam', '08298498234', 'dosen@mail.com', '215324_205721752786226_3405379_n.jpg', '2015-03-17 23:27:11', '2015-03-17 23:47:43', 'aktif'),
215(3, 'DS00003', 'Dahlia Widhyaestoeti, S.Kom', '1995-03-18', 'L', 'Jl. Bogor Barat RT 01/04 No.31 Jawa Barat, Bogor, 17230', 'Islam', '08139292933', 'mail@dahlia.com', '1472807_566166303462879_456788027_n.png', '2015-03-18 07:44:21', '2015-03-18 07:45:28', 'aktif');
216
217-- --------------------------------------------------------
218
219--
220-- Table structure for table `teachers_subjects`
221--
222
223CREATE TABLE IF NOT EXISTS `teachers_subjects` (
224 `teacher_id` int(11) NOT NULL,
225 `subject_id` int(11) NOT NULL,
226 KEY `teacher_id` (`teacher_id`),
227 KEY `subject_id` (`subject_id`)
228) ENGINE=InnoDB DEFAULT CHARSET=utf8;
229
230--
231-- Dumping data for table `teachers_subjects`
232--
233
234INSERT INTO `teachers_subjects` (`teacher_id`, `subject_id`) VALUES
235(2, 9),
236(2, 10),
237(2, 11),
238(3, 14),
239(3, 15);
240
241-- --------------------------------------------------------
242
243--
244-- Table structure for table `users`
245--
246
247CREATE TABLE IF NOT EXISTS `users` (
248 `id` int(11) NOT NULL AUTO_INCREMENT,
249 `username` varchar(16) NOT NULL,
250 `password` varchar(255) NOT NULL,
251 `display_name` varchar(64) DEFAULT NULL,
252 `email` varchar(64) NOT NULL,
253 `phone` varchar(20) NOT NULL,
254 `bio` varchar(160) DEFAULT NULL,
255 `gender` enum('M','F') NOT NULL DEFAULT 'M',
256 `birthdate` date DEFAULT NULL,
257 `address` varchar(160) DEFAULT NULL,
258 `city` varchar(64) DEFAULT NULL,
259 `postal_code` int(11) DEFAULT '0',
260 `url_facebook` varchar(64) DEFAULT NULL,
261 `url_twitter` varchar(64) DEFAULT NULL,
262 `url_youtube` varchar(64) DEFAULT NULL,
263 `url_linkedin` varchar(64) DEFAULT NULL,
264 `url_pinterest` varchar(64) DEFAULT NULL,
265 `url_instagram` varchar(64) DEFAULT NULL,
266 `picture_dir` varchar(255) NOT NULL DEFAULT 'default',
267 `picture` varchar(255) NOT NULL DEFAULT 'default.jpg',
268 `activation_key` varchar(255) DEFAULT NULL,
269 `role` enum('administrator','contributor','user') NOT NULL DEFAULT 'user',
270 `created` datetime DEFAULT NULL,
271 `modified` datetime DEFAULT NULL,
272 `status` tinyint(4) NOT NULL DEFAULT '0',
273 PRIMARY KEY (`id`),
274 UNIQUE KEY `username` (`username`)
275) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;
276
277--
278-- Dumping data for table `users`
279--
280
281INSERT INTO `users` (`id`, `username`, `password`, `display_name`, `email`, `phone`, `bio`, `gender`, `birthdate`, `address`, `city`, `postal_code`, `url_facebook`, `url_twitter`, `url_youtube`, `url_linkedin`, `url_pinterest`, `url_instagram`, `picture_dir`, `picture`, `activation_key`, `role`, `created`, `modified`, `status`) VALUES
282(1, 'administrator', 'ed4511c5fec2a42435e6746f30fc53a3c64df43c', 'Yanuar Nurcahyo', 'yanuar.nurcahyo6661@gmail.com', '', '', 'M', NULL, '', '', 16320, NULL, NULL, NULL, NULL, NULL, NULL, '1', 'default.jpg', NULL, 'administrator', '2014-07-16 00:00:00', '2014-07-23 20:38:43', 0),
283(2, 'fina', 'ed4511c5fec2a42435e6746f30fc53a3c64df43c', 'Fina Alis', 'fina@gmail.com', '', '', 'F', '2014-07-23', '', 'Bogor', 14320, NULL, NULL, NULL, NULL, NULL, NULL, '2', '1613765_1426376610935434_1576759072_n.jpg', '53cfe091-1bd4-4cf3-83c7-1768c16639e9', 'user', '2014-07-23 23:19:29', '2014-07-23 23:19:29', 0),
284(3, 'agus', 'ed4511c5fec2a42435e6746f30fc53a3c64df43c', 'Agus Hadiyatna', 'agus@gmail.com', '', '', 'M', '1985-08-22', 'Jl. Cibinong', 'Bogor', 16430, NULL, NULL, NULL, NULL, NULL, NULL, '3', 'ias.jpg', '53df95ac-99d0-48f6-854b-1a3cc16639e9', 'contributor', '2014-08-04 21:16:13', '2014-08-04 21:19:56', 0),
285(4, 'admin', '4bdccffffb56b487a1f122e94d41540c4e55a619', 'Administrator', 'admin@admin.com', '08561982498249', '', 'M', '0000-00-00', 'asd', 'k;', 211222, NULL, NULL, NULL, NULL, NULL, NULL, '4', 'Untitled.jpg', '54dee496-25ac-45af-a3dd-0820246c5b52', 'administrator', '2015-02-14 07:00:54', '2015-03-11 19:36:51', 0);
286
287--
288-- Constraints for dumped tables
289--
290
291--
292-- Constraints for table `students`
293--
294ALTER TABLE `students`
295 ADD CONSTRAINT `students_ibfk_1` FOREIGN KEY (`major_id`) REFERENCES `majors` (`id`) ON DELETE CASCADE;
296
297--
298-- Constraints for table `subjects_majors`
299--
300ALTER TABLE `subjects_majors`
301 ADD CONSTRAINT `subjects_majors_ibfk_2` FOREIGN KEY (`subject_id`) REFERENCES `subjects` (`id`) ON DELETE CASCADE,
302 ADD CONSTRAINT `subjects_majors_ibfk_1` FOREIGN KEY (`major_id`) REFERENCES `majors` (`id`) ON DELETE CASCADE;
303
304--
305-- Constraints for table `subjects_preconditions`
306--
307ALTER TABLE `subjects_preconditions`
308 ADD CONSTRAINT `subjects_preconditions_ibfk_1` FOREIGN KEY (`subject_id`) REFERENCES `subjects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
309
310--
311-- Constraints for table `teachers_subjects`
312--
313ALTER TABLE `teachers_subjects`
314 ADD CONSTRAINT `teachers_subjects_ibfk_1` FOREIGN KEY (`subject_id`) REFERENCES `subjects` (`id`) ON DELETE CASCADE,
315 ADD CONSTRAINT `teachers_subjects_ibfk_2` FOREIGN KEY (`teacher_id`) REFERENCES `teachers` (`id`) ON DELETE CASCADE;
316
317/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
318/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
319/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;