-
Notifications
You must be signed in to change notification settings - Fork 0
/
school_db.sql
191 lines (156 loc) · 4.26 KB
/
school_db.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
-- phpMyAdmin SQL Dump
-- version 4.7.9
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Apr 10, 2018 at 08:21 PM
-- Server version: 10.1.31-MariaDB
-- PHP Version: 7.2.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
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 utf8mb4 */;
--
-- Database: `school_db`
--
-- --------------------------------------------------------
--
-- Table structure for table `attendance`
--
CREATE TABLE `attendance` (
`csid` int(11) NOT NULL,
`present_student` int(11) NOT NULL,
`present_staff` int(11) NOT NULL,
`date` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `classes`
--
CREATE TABLE `classes` (
`csid` int(11) NOT NULL,
`sid` int(11) NOT NULL,
`class` int(11) NOT NULL,
`reg_student` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `classes`
--
INSERT INTO `classes` (`csid`, `sid`, `class`, `reg_student`) VALUES
(1, 1, 1, 36),
(2, 1, 2, 40),
(3, 1, 3, 32),
(4, 1, 4, 35),
(5, 4, 1, 50),
(6, 4, 2, 38),
(7, 1, 5, 30),
(8, 4, 3, 56),
(9, 4, 4, 45),
(10, 4, 5, 34);
-- --------------------------------------------------------
--
-- Table structure for table `performance`
--
CREATE TABLE `performance` (
`csid` int(11) NOT NULL,
`date` date NOT NULL,
`avg_marks` double NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `performance`
--
INSERT INTO `performance` (`csid`, `date`, `avg_marks`) VALUES
(1, '2018-04-10', 85.4),
(2, '2018-04-10', 74),
(3, '2018-04-10', 65),
(4, '2018-04-10', 82),
(5, '2018-04-10', 70),
(6, '2018-04-10', 67),
(7, '2018-04-10', 54),
(8, '2018-04-10', 63),
(9, '2018-04-10', 76),
(10, '2018-04-10', 75);
-- --------------------------------------------------------
--
-- Table structure for table `school`
--
CREATE TABLE `school` (
`sid` int(11) NOT NULL,
`sname` varchar(128) NOT NULL,
`hname` varchar(64) NOT NULL,
`hmobile` varchar(16) NOT NULL,
`location` varchar(128) NOT NULL,
`img` varchar(256) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `school`
--
INSERT INTO `school` (`sid`, `sname`, `hname`, `hmobile`, `location`, `img`) VALUES
(1, 'Bahadur Primary Schools Allahabad', 'Rajendra Prasad', '9161575960', 'taliarganj', ''),
(2, 'Rampur Primary Schools Allahabad', 'Ramesh', '8483748374', 'Rampur', ''),
(3, 'Sangam Primary Schools Allahabad', 'Samyak Jain', '7905804461', 'Sangam Allahabad', ''),
(4, 'Ramgarh Primary Schools Allahabad', 'Ajay Kumar', '8458449584', 'Rambagh ', '');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `attendance`
--
ALTER TABLE `attendance`
ADD PRIMARY KEY (`csid`,`date`);
--
-- Indexes for table `classes`
--
ALTER TABLE `classes`
ADD PRIMARY KEY (`csid`),
ADD KEY `sid` (`sid`);
--
-- Indexes for table `performance`
--
ALTER TABLE `performance`
ADD PRIMARY KEY (`csid`,`date`);
--
-- Indexes for table `school`
--
ALTER TABLE `school`
ADD PRIMARY KEY (`sid`),
ADD UNIQUE KEY `hmobile` (`hmobile`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `classes`
--
ALTER TABLE `classes`
MODIFY `csid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;
--
-- AUTO_INCREMENT for table `school`
--
ALTER TABLE `school`
MODIFY `sid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `attendance`
--
ALTER TABLE `attendance`
ADD CONSTRAINT `attendance_ibfk_1` FOREIGN KEY (`csid`) REFERENCES `classes` (`csid`);
--
-- Constraints for table `classes`
--
ALTER TABLE `classes`
ADD CONSTRAINT `classes_ibfk_1` FOREIGN KEY (`sid`) REFERENCES `school` (`sid`);
--
-- Constraints for table `performance`
--
ALTER TABLE `performance`
ADD CONSTRAINT `performance_ibfk_1` FOREIGN KEY (`csid`) REFERENCES `classes` (`csid`);
COMMIT;
/*!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 */;