· 8 years ago · Jun 01, 2018, 05:54 AM
1-- --------------------------------------------------------
2-- Host: 127.0.0.1
3-- Server version: 5.5.19 - MySQL Community Server (GPL)
4-- Server OS: Win64
5-- HeidiSQL version: 6.0.0.4030
6-- Date/time: 2012-01-21 16:17:35
7-- --------------------------------------------------------
8
9/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
10/*!40101 SET NAMES utf8 */;
11/*!40014 SET FOREIGN_KEY_CHECKS=0 */;
12
13-- Dumping database structure for pnhs
14DROP DATABASE IF EXISTS `pnhs`;
15CREATE DATABASE IF NOT EXISTS `pnhs` /*!40100 DEFAULT CHARACTER SET utf8 */;
16USE `pnhs`;
17
18
19-- Dumping structure for table pnhs.academics
20DROP TABLE IF EXISTS `academics`;
21CREATE TABLE IF NOT EXISTS `academics` (
22 `ID` bigint(20) unsigned NOT NULL,
23 `SubjectID` int(10) unsigned NOT NULL,
24 `StudentID` bigint(20) unsigned NOT NULL,
25 `FirstGrading` int(10) unsigned DEFAULT NULL,
26 `SecondGrading` int(10) unsigned DEFAULT NULL,
27 `ThirdGrading` int(10) unsigned DEFAULT NULL,
28 `FourthGrading` int(10) unsigned DEFAULT NULL,
29 `Final` int(10) unsigned DEFAULT NULL,
30 PRIMARY KEY (`ID`),
31 KEY `FK_academics_subjects` (`SubjectID`),
32 KEY `FK_academics_students` (`StudentID`),
33 CONSTRAINT `FK_academics_students` FOREIGN KEY (`StudentID`) REFERENCES `students` (`Row`),
34 CONSTRAINT `FK_academics_subjects` FOREIGN KEY (`SubjectID`) REFERENCES `subjects` (`ID`)
35) ENGINE=InnoDB DEFAULT CHARSET=utf8;
36
37-- Dumping data for table pnhs.academics: ~0 rows (approximately)
38DELETE FROM `academics`;
39/*!40000 ALTER TABLE `academics` DISABLE KEYS */;
40/*!40000 ALTER TABLE `academics` ENABLE KEYS */;
41
42
43-- Dumping structure for table pnhs.access
44DROP TABLE IF EXISTS `access`;
45CREATE TABLE IF NOT EXISTS `access` (
46 `ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
47 `AccessLevel` varchar(50) NOT NULL,
48 PRIMARY KEY (`ID`)
49) ENGINE=InnoDB DEFAULT CHARSET=utf8;
50
51-- Dumping data for table pnhs.access: ~0 rows (approximately)
52DELETE FROM `access`;
53/*!40000 ALTER TABLE `access` DISABLE KEYS */;
54/*!40000 ALTER TABLE `access` ENABLE KEYS */;
55
56
57-- Dumping structure for table pnhs.adviser
58DROP TABLE IF EXISTS `adviser`;
59CREATE TABLE IF NOT EXISTS `adviser` (
60 `ID` varchar(25) NOT NULL,
61 `Surname` varchar(25) NOT NULL,
62 `Firstname` varchar(50) NOT NULL,
63 `Middlename` varchar(25) DEFAULT NULL,
64 `Namesuffix` varchar(25) DEFAULT NULL,
65 `Taken` enum('Y','N') NOT NULL,
66 PRIMARY KEY (`ID`)
67) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Table for class advisers';
68
69-- Dumping data for table pnhs.adviser: ~0 rows (approximately)
70DELETE FROM `adviser`;
71/*!40000 ALTER TABLE `adviser` DISABLE KEYS */;
72/*!40000 ALTER TABLE `adviser` ENABLE KEYS */;
73
74
75-- Dumping structure for table pnhs.schoolyear
76DROP TABLE IF EXISTS `schoolyear`;
77CREATE TABLE IF NOT EXISTS `schoolyear` (
78 `Year` int(10) unsigned NOT NULL DEFAULT '0',
79 `Curriculum` int(10) DEFAULT NULL,
80 PRIMARY KEY (`Year`)
81) ENGINE=InnoDB DEFAULT CHARSET=utf8;
82
83-- Dumping data for table pnhs.schoolyear: ~0 rows (approximately)
84DELETE FROM `schoolyear`;
85/*!40000 ALTER TABLE `schoolyear` DISABLE KEYS */;
86/*!40000 ALTER TABLE `schoolyear` ENABLE KEYS */;
87
88
89-- Dumping structure for table pnhs.sections
90DROP TABLE IF EXISTS `sections`;
91CREATE TABLE IF NOT EXISTS `sections` (
92 `ID` int(10) NOT NULL AUTO_INCREMENT,
93 `SectionNum` int(10) NOT NULL,
94 `SectionName` varchar(50) NOT NULL,
95 `Adviser` varchar(25) NOT NULL,
96 PRIMARY KEY (`ID`),
97 KEY `FK_sections_adviser` (`Adviser`),
98 CONSTRAINT `FK_sections_adviser` FOREIGN KEY (`Adviser`) REFERENCES `adviser` (`ID`)
99) ENGINE=InnoDB DEFAULT CHARSET=utf8;
100
101-- Dumping data for table pnhs.sections: ~0 rows (approximately)
102DELETE FROM `sections`;
103/*!40000 ALTER TABLE `sections` DISABLE KEYS */;
104/*!40000 ALTER TABLE `sections` ENABLE KEYS */;
105
106
107-- Dumping structure for table pnhs.students
108DROP TABLE IF EXISTS `students`;
109CREATE TABLE IF NOT EXISTS `students` (
110 `Row` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
111 `Year` int(10) unsigned NOT NULL,
112 `StudentID` int(10) unsigned NOT NULL,
113 `LastName` varchar(25) NOT NULL,
114 `FirstName` varchar(50) NOT NULL,
115 `MiddleName` varchar(25) DEFAULT NULL,
116 `Address` varchar(255) NOT NULL,
117 `Gender` enum('M','F') NOT NULL,
118 PRIMARY KEY (`Row`),
119 KEY `Year` (`Year`),
120 KEY `StudentID` (`StudentID`)
121) ENGINE=InnoDB DEFAULT CHARSET=utf8;
122
123-- Dumping data for table pnhs.students: ~0 rows (approximately)
124DELETE FROM `students`;
125/*!40000 ALTER TABLE `students` DISABLE KEYS */;
126/*!40000 ALTER TABLE `students` ENABLE KEYS */;
127
128
129-- Dumping structure for table pnhs.student_status
130DROP TABLE IF EXISTS `student_status`;
131CREATE TABLE IF NOT EXISTS `student_status` (
132 `ID` bigint(20) unsigned NOT NULL,
133 `StudentRow` bigint(20) unsigned NOT NULL,
134 `SchoolYear` int(10) unsigned NOT NULL,
135 PRIMARY KEY (`ID`),
136 KEY `FK_student_status_students` (`StudentRow`),
137 KEY `FK_student_status_schoolyear` (`SchoolYear`),
138 CONSTRAINT `FK_student_status_schoolyear` FOREIGN KEY (`SchoolYear`) REFERENCES `schoolyear` (`Year`),
139 CONSTRAINT `FK_student_status_students` FOREIGN KEY (`StudentRow`) REFERENCES `students` (`Row`) ON UPDATE CASCADE
140) ENGINE=InnoDB DEFAULT CHARSET=utf8;
141
142-- Dumping data for table pnhs.student_status: ~0 rows (approximately)
143DELETE FROM `student_status`;
144/*!40000 ALTER TABLE `student_status` DISABLE KEYS */;
145/*!40000 ALTER TABLE `student_status` ENABLE KEYS */;
146
147
148-- Dumping structure for table pnhs.subjects
149DROP TABLE IF EXISTS `subjects`;
150CREATE TABLE IF NOT EXISTS `subjects` (
151 `ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
152 `Year` int(10) unsigned NOT NULL,
153 `Title` varchar(50) NOT NULL,
154 PRIMARY KEY (`ID`)
155) ENGINE=InnoDB DEFAULT CHARSET=utf8;
156
157-- Dumping data for table pnhs.subjects: ~0 rows (approximately)
158DELETE FROM `subjects`;
159/*!40000 ALTER TABLE `subjects` DISABLE KEYS */;
160/*!40000 ALTER TABLE `subjects` ENABLE KEYS */;
161
162
163-- Dumping structure for table pnhs.users
164DROP TABLE IF EXISTS `users`;
165CREATE TABLE IF NOT EXISTS `users` (
166 `ID` varchar(25) NOT NULL,
167 `UserName` varchar(25) NOT NULL,
168 `Password` char(32) NOT NULL,
169 `AccessLevel` int(10) unsigned NOT NULL,
170 PRIMARY KEY (`ID`),
171 KEY `FK_users_access` (`AccessLevel`),
172 CONSTRAINT `FK_users_access` FOREIGN KEY (`AccessLevel`) REFERENCES `access` (`ID`) ON UPDATE CASCADE
173) ENGINE=InnoDB DEFAULT CHARSET=utf8;
174
175-- Dumping data for table pnhs.users: ~0 rows (approximately)
176DELETE FROM `users`;
177/*!40000 ALTER TABLE `users` DISABLE KEYS */;
178/*!40000 ALTER TABLE `users` ENABLE KEYS */;
179/*!40014 SET FOREIGN_KEY_CHECKS=1 */;
180/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;