· 8 years ago · Jan 24, 2018, 10:34 PM
1-- MySQL dump 10.13 Distrib 5.1.40, for Win32 (ia32)
2--
3-- Host: localhost Database: oes
4-- ------------------------------------------------------
5-- Server version 5.1.40-community
6
7/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
8/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
9/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
10/*!40101 SET NAMES utf8 */;
11/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
12/*!40103 SET TIME_ZONE='+00:00' */;
13/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
14/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
15/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
16/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
17
18--
19-- Current Database: `oes`
20--
21
22CREATE DATABASE /*!32312 IF NOT EXISTS*/ `oes` /*!40100 DEFAULT CHARACTER SET latin1 */;
23
24USE `oes`;
25
26--
27-- Table structure for table `adminlogin`
28--
29
30DROP TABLE IF EXISTS `adminlogin`;
31/*!40101 SET @saved_cs_client = @@character_set_client */;
32/*!40101 SET character_set_client = utf8 */;
33CREATE TABLE `adminlogin` (
34 `admname` varchar(32) NOT NULL,
35 `admpassword` varchar(32) DEFAULT NULL,
36 PRIMARY KEY (`admname`)
37) ENGINE=InnoDB DEFAULT CHARSET=latin1;
38/*!40101 SET character_set_client = @saved_cs_client */;
39
40--
41-- Dumping data for table `adminlogin`
42--
43
44LOCK TABLES `adminlogin` WRITE;
45/*!40000 ALTER TABLE `adminlogin` DISABLE KEYS */;
46INSERT INTO `adminlogin` VALUES ('root','63a9f0ea7bb98050796b649e85481845');
47/*!40000 ALTER TABLE `adminlogin` ENABLE KEYS */;
48UNLOCK TABLES;
49
50--
51-- Table structure for table `question`
52--
53
54DROP TABLE IF EXISTS `question`;
55/*!40101 SET @saved_cs_client = @@character_set_client */;
56/*!40101 SET character_set_client = utf8 */;
57CREATE TABLE `question` (
58 `testid` bigint(20) NOT NULL DEFAULT '0',
59 `qnid` int(11) NOT NULL DEFAULT '0',
60 `question` varchar(500) DEFAULT NULL,
61 `optiona` varchar(100) DEFAULT NULL,
62 `optionb` varchar(100) DEFAULT NULL,
63 `optionc` varchar(100) DEFAULT NULL,
64 `optiond` varchar(100) DEFAULT NULL,
65 `correctanswer` enum('optiona','optionb','optionc','optiond') DEFAULT NULL,
66 `marks` int(11) DEFAULT NULL,
67 PRIMARY KEY (`testid`,`qnid`),
68 CONSTRAINT `question_ibfk_1` FOREIGN KEY (`testid`) REFERENCES `test` (`testid`)
69) ENGINE=InnoDB DEFAULT CHARSET=latin1;
70/*!40101 SET character_set_client = @saved_cs_client */;
71
72--
73-- Dumping data for table `question`
74--
75
76LOCK TABLES `question` WRITE;
77/*!40000 ALTER TABLE `question` DISABLE KEYS */;
78/*!40000 ALTER TABLE `question` ENABLE KEYS */;
79UNLOCK TABLES;
80
81--
82-- Table structure for table `student`
83--
84
85DROP TABLE IF EXISTS `student`;
86/*!40101 SET @saved_cs_client = @@character_set_client */;
87/*!40101 SET character_set_client = utf8 */;
88CREATE TABLE `student` (
89 `stdid` bigint(20) NOT NULL,
90 `stdname` varchar(40) DEFAULT NULL,
91 `stdpassword` varchar(40) DEFAULT NULL,
92 `emailid` varchar(40) DEFAULT NULL,
93 `contactno` varchar(20) DEFAULT NULL,
94 `address` varchar(40) DEFAULT NULL,
95 `city` varchar(40) DEFAULT NULL,
96 `pincode` varchar(20) DEFAULT NULL,
97 PRIMARY KEY (`stdid`),
98 UNIQUE KEY `stdname` (`stdname`),
99 UNIQUE KEY `emailid` (`emailid`)
100) ENGINE=InnoDB DEFAULT CHARSET=latin1;
101/*!40101 SET character_set_client = @saved_cs_client */;
102
103--
104-- Dumping data for table `student`
105--
106
107LOCK TABLES `student` WRITE;
108/*!40000 ALTER TABLE `student` DISABLE KEYS */;
109/*!40000 ALTER TABLE `student` ENABLE KEYS */;
110UNLOCK TABLES;
111
112--
113-- Table structure for table `studentquestion`
114--
115
116DROP TABLE IF EXISTS `studentquestion`;
117/*!40101 SET @saved_cs_client = @@character_set_client */;
118/*!40101 SET character_set_client = utf8 */;
119CREATE TABLE `studentquestion` (
120 `stdid` bigint(20) NOT NULL DEFAULT '0',
121 `testid` bigint(20) NOT NULL DEFAULT '0',
122 `qnid` int(11) NOT NULL DEFAULT '0',
123 `answered` enum('answered','unanswered','review') DEFAULT NULL,
124 `stdanswer` enum('optiona','optionb','optionc','optiond') DEFAULT NULL,
125 PRIMARY KEY (`stdid`,`testid`,`qnid`),
126 KEY `testid` (`testid`,`qnid`),
127 CONSTRAINT `studentquestion_ibfk_1` FOREIGN KEY (`stdid`) REFERENCES `student` (`stdid`),
128 CONSTRAINT `studentquestion_ibfk_2` FOREIGN KEY (`testid`, `qnid`) REFERENCES `question` (`testid`, `qnid`)
129) ENGINE=InnoDB DEFAULT CHARSET=latin1;
130/*!40101 SET character_set_client = @saved_cs_client */;
131
132--
133-- Dumping data for table `studentquestion`
134--
135
136LOCK TABLES `studentquestion` WRITE;
137/*!40000 ALTER TABLE `studentquestion` DISABLE KEYS */;
138/*!40000 ALTER TABLE `studentquestion` ENABLE KEYS */;
139UNLOCK TABLES;
140
141--
142-- Table structure for table `studenttest`
143--
144
145DROP TABLE IF EXISTS `studenttest`;
146/*!40101 SET @saved_cs_client = @@character_set_client */;
147/*!40101 SET character_set_client = utf8 */;
148CREATE TABLE `studenttest` (
149 `stdid` bigint(20) NOT NULL DEFAULT '0',
150 `testid` bigint(20) NOT NULL DEFAULT '0',
151 `starttime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
152 `endtime` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
153 `correctlyanswered` int(11) DEFAULT NULL,
154 `status` enum('over','inprogress') DEFAULT NULL,
155 PRIMARY KEY (`stdid`,`testid`),
156 KEY `testid` (`testid`),
157 CONSTRAINT `studenttest_ibfk_1` FOREIGN KEY (`stdid`) REFERENCES `student` (`stdid`),
158 CONSTRAINT `studenttest_ibfk_2` FOREIGN KEY (`testid`) REFERENCES `test` (`testid`)
159) ENGINE=InnoDB DEFAULT CHARSET=latin1;
160/*!40101 SET character_set_client = @saved_cs_client */;
161
162--
163-- Dumping data for table `studenttest`
164--
165
166LOCK TABLES `studenttest` WRITE;
167/*!40000 ALTER TABLE `studenttest` DISABLE KEYS */;
168/*!40000 ALTER TABLE `studenttest` ENABLE KEYS */;
169UNLOCK TABLES;
170
171
172--
173-- Table structure for table `testconductor`
174--
175
176DROP TABLE IF EXISTS `testconductor`;
177/*!40101 SET @saved_cs_client = @@character_set_client */;
178/*!40101 SET character_set_client = utf8 */;
179CREATE TABLE `testconductor` (
180 `tcid` bigint(20) NOT NULL,
181 `tcname` varchar(40) DEFAULT NULL,
182 `tcpassword` varchar(40) DEFAULT NULL,
183 `emailid` varchar(40) DEFAULT NULL,
184 `contactno` varchar(20) DEFAULT NULL,
185 `address` varchar(40) DEFAULT NULL,
186 `city` varchar(40) DEFAULT NULL,
187 `pincode` varchar(20) DEFAULT NULL,
188 PRIMARY KEY (`tcid`),
189 UNIQUE KEY `stdname` (`tcname`),
190 UNIQUE KEY `emailid` (`emailid`)
191) ENGINE=InnoDB DEFAULT CHARSET=latin1;
192/*!40101 SET character_set_client = @saved_cs_client */;
193
194--
195-- Dumping data for table `testconductor`
196--
197
198LOCK TABLES `testconductor` WRITE;
199/*!40000 ALTER TABLE `testconductor` DISABLE KEYS */;
200/*!40000 ALTER TABLE `testconductor` ENABLE KEYS */;
201UNLOCK TABLES;
202
203--
204-- Table structure for table `subject`
205--
206
207DROP TABLE IF EXISTS `subject`;
208/*!40101 SET @saved_cs_client = @@character_set_client */;
209/*!40101 SET character_set_client = utf8 */;
210CREATE TABLE `subject` (
211 `subid` int(11) NOT NULL,
212 `subname` varchar(40) DEFAULT NULL,
213 `subdesc` varchar(100) DEFAULT NULL,
214 `tcid` bigint(20),
215 PRIMARY KEY (`subid`),
216 UNIQUE KEY `subname` (`subname`),
217 CONSTRAINT `subject_fk1` FOREIGN KEY (`tcid`) REFERENCES `testconductor` (`tcid`)
218) ENGINE=InnoDB DEFAULT CHARSET=latin1;
219/*!40101 SET character_set_client = @saved_cs_client */;
220
221--
222-- Dumping data for table `subject`
223--
224
225LOCK TABLES `subject` WRITE;
226/*!40000 ALTER TABLE `subject` DISABLE KEYS */;
227/*!40000 ALTER TABLE `subject` ENABLE KEYS */;
228UNLOCK TABLES;
229
230--
231-- Table structure for table `test`
232--
233
234DROP TABLE IF EXISTS `test`;
235/*!40101 SET @saved_cs_client = @@character_set_client */;
236/*!40101 SET character_set_client = utf8 */;
237CREATE TABLE `test` (
238 `testid` bigint(20) NOT NULL,
239 `testname` varchar(30) NOT NULL,
240 `testdesc` varchar(100) DEFAULT NULL,
241 `testdate` date DEFAULT NULL,
242 `testtime` time DEFAULT NULL,
243 `subid` int(11) DEFAULT NULL,
244 `testfrom` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
245 `testto` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
246 `duration` int(11) DEFAULT NULL,
247 `totalquestions` int(11) DEFAULT NULL,
248 `attemptedstudents` bigint(20) DEFAULT NULL,
249 `testcode` varchar(40) NOT NULL,
250 `tcid` bigint(20),
251 PRIMARY KEY (`testid`),
252 UNIQUE KEY `testname` (`testname`),
253 CONSTRAINT `test_fk1` FOREIGN KEY (`subid`) REFERENCES `subject` (`subid`),
254 CONSTRAINT `test_fk2` FOREIGN KEY (`tcid`) REFERENCES `testconductor` (`tcid`)
255) ENGINE=InnoDB DEFAULT CHARSET=latin1;
256/*!40101 SET character_set_client = @saved_cs_client */;
257
258--
259-- Dumping data for table `test`
260--
261
262LOCK TABLES `test` WRITE;
263/*!40000 ALTER TABLE `test` DISABLE KEYS */;
264/*!40000 ALTER TABLE `test` ENABLE KEYS */;
265UNLOCK TABLES;
266/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
267
268/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
269/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
270/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
271/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
272/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
273/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
274/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
275
276-- Dump completed on 2010-07-12 20:46:26