-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdatabase.sql
More file actions
70 lines (51 loc) · 2.24 KB
/
Copy pathdatabase.sql
File metadata and controls
70 lines (51 loc) · 2.24 KB
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
create database test;
use test;
CREATE TABLE `users` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(100) NOT NULL,
`age` int(3) NOT NULL,
`email` varchar(100) NOT NULL,
PRIMARY KEY (`id`)
);
ALTER TABLE users
ADD COLUMN role varchar(20) AFTER email;
ALTER TABLE users
ADD COLUMN username varchar(100) AFTER role;
ALTER TABLE users
ADD COLUMN password varchar(100) AFTER username;
ALTER TABLE users
ADD COLUMN confirmcode VARCHAR(32);
ALTER TABLE users
ADD COLUMN phone_number VARCHAR( 16 ) NOT NULL;
INSERT INTO `users` (`name`, `age`, `email`, `role`, `username`, `password`, confirmcode, phone_number) VALUES ('Haymon Hareto', '20', 'haymon@yahoo.com', 'Admin', 'haymon', 'haymon', 'y', '12345');
INSERT INTO `users` (`name`, `age`, `email`, `role`, `username`, `password`, confirmcode, phone_number) VALUES ('Daymon Dadeto', '21', 'Daymon@yahoo.com', 'Admin', 'Daymon', 'Daymon', 'y', '12345');
INSERT INTO `users` (`name`, `age`, `email`, `role`, `username`, `password`, confirmcode, phone_number) VALUES ('Baymon Babeto', '22', 'Baymon@yahoo.com', 'Admin', 'Baymon', 'Baymon', 'y', '12345');
CREATE TABLE medicines(
medicine_id int(11) NOT NULL auto_increment,
medicine_name varchar(100) NOT NULL,
medicine_description varchar(100) NOT NULL,
PRIMARY KEY (medicine_id)
);
CREATE TABLE symptoms(
symptom_id int(11) NOT NULL auto_increment,
symptom_name varchar(100) NOT NULL,
PRIMARY KEY (symptom_id)
);
CREATE TABLE prescription(
prescription_id int(11) NOT NULL auto_increment,
symptom_id int(11) NOT NULL,
medicine_id int(11) NOT NULL,
sickness_id int(11) NOT NULL,
PRIMARY KEY (prescription_id)
);
CREATE TABLE sickness(
sickness_id int(11) NOT NULL auto_increment,
sickness_name varchar(100) NOT NULL,
PRIMARY KEY (sickness_id)
);
INSERT INTO `symptoms`(`symptom_name`) VALUES ('Sneezing');
INSERT INTO `symptoms`(`symptom_name`) VALUES ('Runny Nose');
INSERT INTO `medicines`(`medicine_name`, `medicine_description`) VALUES ('Neozep','Phenylephrine HCI Chlorphenamine Meleate Paracetamol');
INSERT INTO sickness (sickness_name) VALUES('Colds');
INSERT INTO `prescription`(`symptom_id`, `medicine_id`, sickness_id) VALUES (1, 1, 1);
INSERT INTO `prescription`(`symptom_id`, `medicine_id`, sickness_id) VALUES (2, 1, 1);