-
Notifications
You must be signed in to change notification settings - Fork 0
/
modul3.sql
209 lines (184 loc) · 7.4 KB
/
modul3.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
-- MySQL Script generated by MySQL Workbench
-- Min 15 Okt 2017 07:14:20 WIB
-- Model: New Model Version: 1.0
-- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
-- -----------------------------------------------------
-- Schema mydb
-- -----------------------------------------------------
-- -----------------------------------------------------
-- Schema mydb
-- -----------------------------------------------------
CREATE SCHEMA IF NOT EXISTS `modul_3` DEFAULT CHARACTER SET utf8 ;
USE `modul_3` ;
-- -----------------------------------------------------
-- Table `mydb`.`login_karyawan`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `modul_3`.`login_karyawan` (
`id_karyawan` INT NOT NULL,
`NIK` VARCHAR(45) NULL,
`password` VARCHAR(45) NULL,
`status` VARCHAR(45) NULL,
PRIMARY KEY (`id_karyawan`))
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `mydb`.`penguji`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `modul_3`.`penguji` (
`id_penguji` INT NOT NULL AUTO_INCREMENT,
`ketua` VARCHAR(120) NULL,
`sekertaris` VARCHAR(120) NULL,
`anggota` VARCHAR(120) NULL,
`tanggal` VARCHAR(45) NULL,
`jam` VARCHAR(45) NULL DEFAULT 'current_time',
`ruangan` INT(1) NULL,
`id_karyawan` INT NOT NULL,
PRIMARY KEY (`id_penguji`, `id_karyawan`),
INDEX `fk_penguji_login_karyawan1_idx` (`id_karyawan` ASC),
CONSTRAINT `fk_penguji_login_karyawan1`
FOREIGN KEY (`id_karyawan`)
REFERENCES `mydb`.`login_karyawan` (`id_karyawan`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `mydb`.`laporanproposal`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `modul_3`.`laporanproposal` (
`id_laporanproposal` INT NOT NULL AUTO_INCREMENT,
`laporan_proposal` VARCHAR(100) NULL,
PRIMARY KEY (`id_laporanproposal`))
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `mydb`.`bukti_spp_terakhir`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `modul_3`.`bukti_spp_terakhir` (
`id_bukti` INT NOT NULL AUTO_INCREMENT,
`berkas_spp` VARCHAR(100) NULL,
PRIMARY KEY (`id_bukti`))
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `mydb`.`notification`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `modul_3`.`notification` (
`id_notification` INT NOT NULL AUTO_INCREMENT,
`pesan` VARCHAR(45) NULL,
`timestamp` TIMESTAMP NULL DEFAULT 'CURRENT_TIMESTAMP',
PRIMARY KEY (`id_notification`))
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `mydb`.`mahasiswa`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `modul_3`.`mahasiswa` (
`NIM` VARCHAR(9) NOT NULL,
`nama_mahasiswa` VARCHAR(120) NULL,
`program_studi` VARCHAR(55) NULL,
`dospem_1` VARCHAR(120) NULL,
`dospem_2` VARCHAR(120) NULL,
`judul_TA` VARCHAR(120) NULL,
`deskripsi` VARCHAR(200) NULL,
`rumpun_matkul` VARCHAR(45) NULL,
`refrensi` VARCHAR(45) NULL,
PRIMARY KEY (`NIM`))
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `mydb`.`lembar_revisi`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `modul_3`.`lembar_revisi` (
`idlembar_revisi` INT NOT NULL AUTO_INCREMENT,
`lembar_revisi` VARCHAR(100) NULL,
PRIMARY KEY (`idlembar_revisi`))
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `mydb`.`status_sidang`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `modul_3`.`status_sidang` (
`id_statussidang` INT NOT NULL AUTO_INCREMENT,
`NIM` INT NOT NULL,
`id_penguji` INT NOT NULL,
`id_laporanproposal` INT NOT NULL,
`id_bukti` INT NOT NULL,
`id_notification` INT NOT NULL,
`idlembar_revisi` INT NOT NULL,
`id_karyawan` INT NOT NULL,
`status` TINYINT(1) NOT NULL DEFAULT 0,
`create_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id_statussidang`, `NIM`, `id_penguji`, `id_laporanproposal`, `id_bukti`, `id_notification`, `idlembar_revisi`, `id_karyawan`),
INDEX `fk_user_sidang_penguji1_idx` (`id_penguji` ASC),
INDEX `fk_user_sidang_laporanproposal1_idx` (`id_laporanproposal` ASC),
INDEX `fk_status_sidang_bukti_spp_terakhir1_idx` (`id_bukti` ASC),
INDEX `fk_status_sidang_notification1_idx` (`id_notification` ASC),
INDEX `fk_status_sidang_pengajuan1_idx` (`NIM` ASC),
INDEX `fk_status_sidang_login_karyawan1_idx` (`id_karyawan` ASC),
INDEX `fk_status_sidang_lembar_revisi1_idx` (`idlembar_revisi` ASC),
CONSTRAINT `fk_user_sidang_penguji1`
FOREIGN KEY (`id_penguji`)
REFERENCES `mydb`.`penguji` (`id_penguji`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_user_sidang_laporanproposal1`
FOREIGN KEY (`id_laporanproposal`)
REFERENCES `mydb`.`laporanproposal` (`id_laporanproposal`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_status_sidang_bukti_spp_terakhir1`
FOREIGN KEY (`id_bukti`)
REFERENCES `mydb`.`bukti_spp_terakhir` (`id_bukti`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_status_sidang_notification1`
FOREIGN KEY (`id_notification`)
REFERENCES `mydb`.`notification` (`id_notification`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_status_sidang_pengajuan1`
FOREIGN KEY (`NIM`)
REFERENCES `mydb`.`mahasiswa` (`NIM`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_status_sidang_login_karyawan1`
FOREIGN KEY (`id_karyawan`)
REFERENCES `mydb`.`login_karyawan` (`id_karyawan`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_status_sidang_lembar_revisi1`
FOREIGN KEY (`idlembar_revisi`)
REFERENCES `mydb`.`lembar_revisi` (`idlembar_revisi`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `mydb`.`kartuhasilstudi`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `modul_3`.`kartuhasilstudi` (
`id_kartuhasilstudi` INT NOT NULL AUTO_INCREMENT,
`berkas_khs` VARCHAR(100) NULL,
`id_statussidang` INT NOT NULL,
PRIMARY KEY (`id_kartuhasilstudi`, `id_statussidang`),
INDEX `fk_kartuhasilstudi_user_sidang_idx` (`id_statussidang` ASC),
CONSTRAINT `fk_kartuhasilstudi_user_sidang`
FOREIGN KEY (`id_statussidang`)
REFERENCES `mydb`.`status_sidang` (`id_statussidang`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `mydb`.`login_mhs`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `modul_3`.`login_mhs` (
`id_mhs` INT NOT NULL AUTO_INCREMENT,
`NIM` VARCHAR(9) NOT NULL,
`password` VARCHAR(45) NULL,
PRIMARY KEY (`id_mhs`, `NIM`),
INDEX `fk_login_mhs_mahasiswa1_idx` (`NIM` ASC),
CONSTRAINT `fk_login_mhs_mahasiswa1`
FOREIGN KEY (`NIM`)
REFERENCES `mydb`.`mahasiswa` (`NIM`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;