-
Notifications
You must be signed in to change notification settings - Fork 0
/
census.sql
386 lines (313 loc) · 10.1 KB
/
census.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
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
-- phpMyAdmin SQL Dump
-- version 5.2.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 07, 2023 at 10:35 PM
-- Server version: 10.4.27-MariaDB
-- PHP Version: 8.1.12
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: `census`
--
-- --------------------------------------------------------
--
-- Table structure for table `admin`
--
CREATE TABLE `admin` (
`id` int(11) NOT NULL,
`email` varchar(50) NOT NULL,
`fname` varchar(20) NOT NULL,
`lname` varchar(20) NOT NULL,
`username` varchar(100) NOT NULL,
`password` varchar(100) NOT NULL,
`profilepic` varchar(100) NOT NULL,
`updationDate` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`contact` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
--
-- Dumping data for table `admin`
--
INSERT INTO `admin` (`id`, `email`, `fname`, `lname`, `username`, `password`, `profilepic`, `updationDate`, `contact`) VALUES
(1, 'admin@gmail.com', 'admin', 'admin', 'admin', '1bbc8618df51d6034bd74d03ce89a755', 'istockphoto-77931645-170667a.jpg', '2023-01-07 21:31:16', 745566505);
-- --------------------------------------------------------
--
-- Table structure for table `animal`
--
CREATE TABLE `animal` (
`id` int(11) NOT NULL,
`name` varchar(50) NOT NULL,
`no` int(20) NOT NULL,
`spec` varchar(30) NOT NULL,
`userid` int(11) NOT NULL,
`created_at` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Dumping data for table `animal`
--
INSERT INTO `animal` (`id`, `name`, `no`, `spec`, `userid`, `created_at`) VALUES
(12, 'Birds', 20, 'Kenyan', 9, '2022-10-11 08:44:06'),
(13, 'Cows', 890, 'Maasai', 9, '2022-10-11 08:47:00'),
(14, 'Birds', 600, 'American', 0, '2022-10-11 09:03:13');
-- --------------------------------------------------------
--
-- Table structure for table `deceased`
--
CREATE TABLE `deceased` (
`id` int(11) NOT NULL,
`name` varchar(50) NOT NULL,
`gender` varchar(20) NOT NULL,
`dob` date NOT NULL,
`dod` date NOT NULL,
`position` varchar(30) NOT NULL,
`profession` varchar(30) NOT NULL,
`cause` varchar(30) NOT NULL,
`userid` int(11) NOT NULL,
`created_at` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-- --------------------------------------------------------
--
-- Table structure for table `loc`
--
CREATE TABLE `loc` (
`id` int(11) NOT NULL,
`name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '1=Active | 0=Inactive',
`created_at` datetime NOT NULL DEFAULT current_timestamp(),
`updated_at` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `loc`
--
INSERT INTO `loc` (`id`, `name`, `status`, `created_at`, `updated_at`) VALUES
(4, 'Bassi Central', 1, '2022-10-10 21:36:27', '2022-10-10 21:36:27'),
(5, 'Borabu', 1, '2022-10-10 21:36:37', '2022-10-10 21:36:37');
-- --------------------------------------------------------
--
-- Table structure for table `location`
--
CREATE TABLE `location` (
`id` int(11) NOT NULL,
`location` varchar(20) NOT NULL,
`sub` varchar(20) NOT NULL,
`village` varchar(20) NOT NULL,
`userid` int(11) NOT NULL,
`code` varchar(100) NOT NULL,
`created_at` date NOT NULL DEFAULT current_timestamp(),
`updated_at` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Dumping data for table `location`
--
INSERT INTO `location` (`id`, `location`, `sub`, `village`, `userid`, `code`, `created_at`, `updated_at`) VALUES
(19, '1', '1', '1', 9, '69682121', '2022-10-10', '2022-10-10 18:13:24'),
(20, '4', '5', '3', 9, '31537377', '2022-10-10', '2022-10-10 22:29:48'),
(21, '4', '5', '3', 9, '18599288', '2023-01-07', '2023-01-07 23:37:39');
-- --------------------------------------------------------
--
-- Table structure for table `residence`
--
CREATE TABLE `residence` (
`id` int(11) NOT NULL,
`name` varchar(50) NOT NULL,
`gender` varchar(20) NOT NULL,
`dob` date NOT NULL,
`position` varchar(30) NOT NULL,
`profession` varchar(30) NOT NULL,
`idno` varchar(20) NOT NULL,
`userid` int(11) NOT NULL,
`created_at` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-- --------------------------------------------------------
--
-- Table structure for table `social`
--
CREATE TABLE `social` (
`id` int(11) NOT NULL,
`source` varchar(50) NOT NULL,
`amount` float NOT NULL,
`house` varchar(30) NOT NULL,
`no` int(11) NOT NULL,
`userid` int(11) NOT NULL,
`created_at` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Dumping data for table `social`
--
INSERT INTO `social` (`id`, `source`, `amount`, `house`, `no`, `userid`, `created_at`) VALUES
(9, 'Savings', 10000, 'Stoned', 100, 9, '2022-10-10 11:18:25');
-- --------------------------------------------------------
--
-- Table structure for table `sub`
--
CREATE TABLE `sub` (
`id` int(11) NOT NULL,
`loc_id` int(11) NOT NULL,
`name` varchar(50) NOT NULL,
`status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '1=Active | 0=Inactive',
`created_at` datetime NOT NULL DEFAULT current_timestamp(),
`updated_at` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `sub`
--
INSERT INTO `sub` (`id`, `loc_id`, `name`, `status`, `created_at`, `updated_at`) VALUES
(5, 4, 'Maji Mazuri', 1, '2022-10-10 21:36:56', '2022-10-10 21:36:56'),
(6, 5, 'Kagame', 1, '2022-10-10 21:37:13', '2022-10-10 21:37:13');
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`id` bigint(255) NOT NULL,
`fname` varchar(15) NOT NULL,
`lname` varchar(15) NOT NULL,
`email` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL,
`contact` varchar(15) NOT NULL,
`status` int(2) DEFAULT NULL,
`creationdate` timestamp NOT NULL DEFAULT current_timestamp(),
`updationdate` timestamp NULL DEFAULT NULL ON UPDATE current_timestamp(),
`profilepic` varchar(100) NOT NULL,
`address` varchar(50) NOT NULL,
`county` varchar(20) NOT NULL,
`dob` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id`, `fname`, `lname`, `email`, `password`, `contact`, `status`, `creationdate`, `updationdate`, `profilepic`, `address`, `county`, `dob`) VALUES
(9, 'Test ', 'User', 'test@gmail.com', '24fb219617f65f1964228009c155052c', '712345678', 1, '2022-07-16 14:50:36', '2023-01-07 21:21:16', '20220725_164402.jpg', '148 Kilifi', 'Kilifi', '');
-- --------------------------------------------------------
--
-- Table structure for table `village`
--
CREATE TABLE `village` (
`id` int(11) NOT NULL,
`sub_id` int(11) NOT NULL,
`name` varchar(50) NOT NULL,
`status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '1=Active | 0=Inactive',
`created_at` datetime NOT NULL DEFAULT current_timestamp(),
`updated_at` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `village`
--
INSERT INTO `village` (`id`, `sub_id`, `name`, `status`, `created_at`, `updated_at`) VALUES
(3, 5, 'Enchoro', 1, '2022-10-10 21:45:47', '2022-10-10 21:45:47');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `admin`
--
ALTER TABLE `admin`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `animal`
--
ALTER TABLE `animal`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `deceased`
--
ALTER TABLE `deceased`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `loc`
--
ALTER TABLE `loc`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `location`
--
ALTER TABLE `location`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `residence`
--
ALTER TABLE `residence`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `social`
--
ALTER TABLE `social`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `sub`
--
ALTER TABLE `sub`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `village`
--
ALTER TABLE `village`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `admin`
--
ALTER TABLE `admin`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `animal`
--
ALTER TABLE `animal`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;
--
-- AUTO_INCREMENT for table `deceased`
--
ALTER TABLE `deceased`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `loc`
--
ALTER TABLE `loc`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `location`
--
ALTER TABLE `location`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=22;
--
-- AUTO_INCREMENT for table `residence`
--
ALTER TABLE `residence`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
--
-- AUTO_INCREMENT for table `social`
--
ALTER TABLE `social`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
--
-- AUTO_INCREMENT for table `sub`
--
ALTER TABLE `sub`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` bigint(255) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19;
--
-- AUTO_INCREMENT for table `village`
--
ALTER TABLE `village`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
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 */;