-
Notifications
You must be signed in to change notification settings - Fork 0
/
sitahta.sql
executable file
·210 lines (170 loc) · 6.25 KB
/
sitahta.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
-- phpMyAdmin SQL Dump
-- version 4.0.10deb1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Mar 19, 2015 at 09:46 AM
-- Server version: 5.5.41-0ubuntu0.14.04.1
-- PHP Version: 5.5.9-1ubuntu4.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!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 */;
--
-- Database: `sitahta`
--
-- --------------------------------------------------------
--
-- Table structure for table `guru`
--
CREATE TABLE IF NOT EXISTS `guru` (
`nip` int(11) NOT NULL,
`nama` varchar(40) DEFAULT NULL,
`jenis_kelamin` varchar(3) DEFAULT NULL,
`alamat` varchar(50) DEFAULT NULL,
`email` varchar(40) DEFAULT NULL,
`no_telp` varchar(15) DEFAULT NULL,
`password` varchar(255) NOT NULL,
`kewenangan` varchar(8) DEFAULT NULL,
PRIMARY KEY (`nip`),
UNIQUE KEY `email_UNIQUE` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `guru`
--
INSERT INTO `guru` (`nip`, `nama`, `jenis_kelamin`, `alamat`, `email`, `no_telp`, `password`, `kewenangan`) VALUES
(1, 'admin', 'L', 'foo city', '[email protected]', '08674839291', 'd8578edf8458ce06fbc5bb76a58c5ca4', 'admin'),
(2, 'guru', 'P', 'Magelang', '[email protected]', '+62874938182', 'd8578edf8458ce06fbc5bb76a58c5ca4', 'guru');
-- --------------------------------------------------------
--
-- Table structure for table `hafalan_awal`
--
CREATE TABLE IF NOT EXISTS `hafalan_awal` (
`nis` int(11) NOT NULL,
`juz` int(11) NOT NULL,
PRIMARY KEY (`nis`,`juz`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `nilai`
--
CREATE TABLE IF NOT EXISTS `nilai` (
`no_uh` varchar(3) NOT NULL,
`kelas` varchar(5) NOT NULL,
`nis` int(11) NOT NULL,
`tanggal` date DEFAULT NULL,
`juz` int(11) DEFAULT NULL,
`halaman` int(11) DEFAULT NULL,
`nilai` int(11) DEFAULT NULL,
`penguji` int(11) DEFAULT NULL,
PRIMARY KEY (`no_uh`,`kelas`,`nis`),
KEY `fk_nilai_1_idx` (`nis`),
KEY `fk_nilai_2_idx` (`penguji`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `nilai`
--
INSERT INTO `nilai` (`no_uh`, `kelas`, `nis`, `tanggal`, `juz`, `halaman`, `nilai`, `penguji`) VALUES
('1', 'XI', 1001, '2015-12-12', 4, 4, 78, 1);
-- --------------------------------------------------------
--
-- Table structure for table `nilai_uas`
--
CREATE TABLE IF NOT EXISTS `nilai_uas` (
`nis` int(11) NOT NULL,
`kelas` varchar(3) NOT NULL,
`semester` int(11) NOT NULL,
`nilai` int(11) DEFAULT NULL,
PRIMARY KEY (`nis`,`kelas`,`semester`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `nilai_uts`
--
CREATE TABLE IF NOT EXISTS `nilai_uts` (
`nis` int(11) NOT NULL,
`kelas` varchar(3) NOT NULL,
`semester` int(11) NOT NULL,
`nilai` int(11) DEFAULT NULL,
PRIMARY KEY (`nis`,`kelas`,`semester`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `sertifikasi`
--
CREATE TABLE IF NOT EXISTS `sertifikasi` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`nis` int(11) DEFAULT NULL,
`nama` varchar(30) DEFAULT NULL,
`tempat_ujian` varchar(100) DEFAULT NULL,
`tgl_ujian` date DEFAULT NULL,
`juz` int(11) DEFAULT NULL,
`nilai` int(11) DEFAULT NULL,
`predikat` varchar(15) DEFAULT NULL,
`keterangan` varchar(100) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `fk_sertifikasi_1_idx` (`nis`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=12349 ;
--
-- Dumping data for table `sertifikasi`
--
INSERT INTO `sertifikasi` (`id`, `nis`, `nama`, `tempat_ujian`, `tgl_ujian`, `juz`, `nilai`, `predikat`, `keterangan`) VALUES
(12345, 1001, 'user', 'SMA IT Ihsanul Fikri Magelang', '2014-12-12', 4, 89, 'Jayyid Jiddan', 'terferifikasi');
-- --------------------------------------------------------
--
-- Table structure for table `siswa`
--
CREATE TABLE IF NOT EXISTS `siswa` (
`nis` int(11) NOT NULL,
`nama` varchar(40) DEFAULT NULL,
`jenis_kelamin` varchar(3) DEFAULT NULL,
`tempat_lahir` varchar(20) DEFAULT NULL,
`tgl_lahir` date DEFAULT NULL,
`kelas` varchar(5) DEFAULT NULL,
`jurusan` varchar(9) DEFAULT NULL,
`no_kelas` int(11) DEFAULT NULL,
`password` varchar(255) NOT NULL,
`nama_ortu` varchar(25) DEFAULT NULL,
PRIMARY KEY (`nis`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `siswa`
--
INSERT INTO `siswa` (`nis`, `nama`, `jenis_kelamin`, `tempat_lahir`, `tgl_lahir`, `kelas`, `jurusan`, `no_kelas`, `password`, `nama_ortu`) VALUES
(1001, 'user', 'L', 'magelang', '2000-12-12', 'XI', 'IPS', 2, 'd8578edf8458ce06fbc5bb76a58c5ca4', 'ortu'),
(1002, 'user2', 'P', 'Kebumen', '2001-01-01', 'X', 'Tahfidz', 2, '', 'Orang Tua2'),
(1003, 'User3', 'P', 'Tenggarong', '1999-01-01', 'XII', 'IPS', 2, 'd8578edf8458ce06fbc5bb76a58c5ca4', 'Ortu 3');
--
-- Constraints for dumped tables
--
--
-- Constraints for table `hafalan_awal`
--
ALTER TABLE `hafalan_awal`
ADD CONSTRAINT `fk_hafalan_awal_1` FOREIGN KEY (`nis`) REFERENCES `siswa` (`nis`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `nilai`
--
ALTER TABLE `nilai`
ADD CONSTRAINT `fk_nilai_1` FOREIGN KEY (`nis`) REFERENCES `siswa` (`nis`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `fk_nilai_2` FOREIGN KEY (`penguji`) REFERENCES `guru` (`nip`) ON DELETE SET NULL ON UPDATE CASCADE;
--
-- Constraints for table `nilai_uas`
--
ALTER TABLE `nilai_uas`
ADD CONSTRAINT `fk_nilai_uas_1` FOREIGN KEY (`nis`) REFERENCES `siswa` (`nis`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Constraints for table `nilai_uts`
--
ALTER TABLE `nilai_uts`
ADD CONSTRAINT `fk_nilai_uts_1` FOREIGN KEY (`nis`) REFERENCES `siswa` (`nis`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Constraints for table `sertifikasi`
--
ALTER TABLE `sertifikasi`
ADD CONSTRAINT `fk_sertifikasi_1` FOREIGN KEY (`nis`) REFERENCES `siswa` (`nis`) ON DELETE CASCADE ON UPDATE CASCADE;
/*!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 */;