-
Notifications
You must be signed in to change notification settings - Fork 0
/
paylee.sql
274 lines (221 loc) · 7.07 KB
/
paylee.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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
-- phpMyAdmin SQL Dump
-- version 5.2.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 12, 2023 at 02:50 PM
-- Server version: 10.4.27-MariaDB
-- PHP Version: 8.2.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
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: `paylee`
--
-- --------------------------------------------------------
--
-- Table structure for table `bank`
--
CREATE TABLE `bank` (
`employee_id` int(10) NOT NULL,
`bankid` int(10) NOT NULL,
`bankname` varchar(100) NOT NULL,
`bankbranch` varchar(100) NOT NULL,
`branchid` int(100) NOT NULL,
`bankloanmonthlyinstalment` int(100) NOT NULL,
`banksavings` int(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Dumping data for table `bank`
--
INSERT INTO `bank` (`employee_id`, `bankid`, `bankname`, `bankbranch`, `branchid`, `bankloanmonthlyinstalment`, `banksavings`) VALUES
(1, 123, 'equity', 'south', 144, 14345, 200);
-- --------------------------------------------------------
--
-- Table structure for table `department`
--
CREATE TABLE `department` (
`department_id` varchar(10) NOT NULL,
`department_name` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Dumping data for table `department`
--
INSERT INTO `department` (`department_id`, `department_name`) VALUES
('FIN', 'Finance'),
('ITDept', 'IT Department'),
('SOB', 'School Of Business'),
('SOE', 'School Of Engineering'),
('SOS', 'School Of Science'),
('SStaff', 'Support Staff');
-- --------------------------------------------------------
--
-- Table structure for table `dependants`
--
CREATE TABLE `dependants` (
`employee_id` int(10) NOT NULL,
`namedep` varchar(100) NOT NULL,
`agedep` int(3) NOT NULL,
`relationdep` varchar(100) NOT NULL,
`phone_nodep` int(15) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Dumping data for table `dependants`
--
INSERT INTO `dependants` (`employee_id`, `namedep`, `agedep`, `relationdep`, `phone_nodep`) VALUES
(1, 'mnm', 13, 'son', 0);
-- --------------------------------------------------------
--
-- Table structure for table `employee_details`
--
CREATE TABLE `employee_details` (
`employee_id` int(100) NOT NULL,
`department_id` varchar(100) NOT NULL,
`fulname` varchar(100) NOT NULL,
`email` varchar(100) NOT NULL,
`age` int(2) NOT NULL,
`phone` int(12) NOT NULL,
`gender` varchar(15) NOT NULL,
`job` text NOT NULL,
`hire` date NOT NULL,
`account` varchar(100) NOT NULL,
`kra` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Dumping data for table `employee_details`
--
INSERT INTO `employee_details` (`employee_id`, `department_id`, `fulname`, `email`, `age`, `phone`, `gender`, `job`, `hire`, `account`, `kra`) VALUES
(1, 'SOS', 'ann ', '[email protected]', 21, 795426090, 'female', 'admin', '2012-01-21', 'a1232333', 'A2222222');
-- --------------------------------------------------------
--
-- Table structure for table `login`
--
CREATE TABLE `login` (
`employee_id` int(4) NOT NULL,
`password` varchar(8) NOT NULL,
`email` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-- --------------------------------------------------------
--
-- Table structure for table `next_of_kin`
--
CREATE TABLE `next_of_kin` (
`employee_id` int(10) NOT NULL,
`namekin` varchar(100) NOT NULL,
`agekin` int(3) NOT NULL,
`relationkin` varchar(10) NOT NULL,
`phone_no` int(15) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Dumping data for table `next_of_kin`
--
INSERT INTO `next_of_kin` (`employee_id`, `namekin`, `agekin`, `relationkin`, `phone_no`) VALUES
(1, 'maura', 20, 'sister', 11111222);
-- --------------------------------------------------------
--
-- Table structure for table `salary`
--
CREATE TABLE `salary` (
`employee_id` int(10) NOT NULL,
`department_id` varchar(10) NOT NULL,
`job` varchar(100) NOT NULL,
`basicpay` int(10) NOT NULL,
`houseallowances` int(10) NOT NULL,
`medallowances` int(10) NOT NULL,
`grosspay` int(10) NOT NULL,
`NHIF` int(10) NOT NULL,
`NSSF` int(10) NOT NULL,
`damages` int(10) NOT NULL,
`pension` int(10) NOT NULL,
`totdeduc` int(10) NOT NULL,
`netsal` int(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `bank`
--
ALTER TABLE `bank`
ADD PRIMARY KEY (`bankid`),
ADD KEY `employee_id` (`employee_id`);
--
-- Indexes for table `department`
--
ALTER TABLE `department`
ADD PRIMARY KEY (`department_id`);
--
-- Indexes for table `dependants`
--
ALTER TABLE `dependants`
ADD KEY `employee_id` (`employee_id`);
--
-- Indexes for table `employee_details`
--
ALTER TABLE `employee_details`
ADD PRIMARY KEY (`employee_id`),
ADD KEY `department_id` (`department_id`);
--
-- Indexes for table `login`
--
ALTER TABLE `login`
ADD PRIMARY KEY (`employee_id`);
--
-- Indexes for table `next_of_kin`
--
ALTER TABLE `next_of_kin`
ADD KEY `employee_id` (`employee_id`);
--
-- Indexes for table `salary`
--
ALTER TABLE `salary`
ADD KEY `employee_id` (`employee_id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `employee_details`
--
ALTER TABLE `employee_details`
MODIFY `employee_id` int(100) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=106;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `bank`
--
ALTER TABLE `bank`
ADD CONSTRAINT `bank_ibfk_1` FOREIGN KEY (`employee_id`) REFERENCES `employee_details` (`employee_id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `dependants`
--
ALTER TABLE `dependants`
ADD CONSTRAINT `dependants_ibfk_1` FOREIGN KEY (`employee_id`) REFERENCES `employee_details` (`employee_id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `employee_details`
--
ALTER TABLE `employee_details`
ADD CONSTRAINT `employee_details_ibfk_1` FOREIGN KEY (`department_id`) REFERENCES `department` (`department_id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `login`
--
ALTER TABLE `login`
ADD CONSTRAINT `login_ibfk_1` FOREIGN KEY (`employee_id`) REFERENCES `employee_details` (`employee_id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `next_of_kin`
--
ALTER TABLE `next_of_kin`
ADD CONSTRAINT `next_of_kin_ibfk_1` FOREIGN KEY (`employee_id`) REFERENCES `employee_details` (`employee_id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `salary`
--
ALTER TABLE `salary`
ADD CONSTRAINT `salary_ibfk_1` FOREIGN KEY (`employee_id`) REFERENCES `employee_details` (`employee_id`) ON DELETE CASCADE ON UPDATE CASCADE;
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 */;