/
path2health.sql
104 lines (84 loc) · 3.17 KB
/
path2health.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
-- phpMyAdmin SQL Dump
-- version 4.0.4
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Mar 27, 2014 at 01:54 AM
-- Server version: 5.6.12-log
-- PHP Version: 5.4.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
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 utf8 */;
--
-- Database: `path2health`
--
CREATE DATABASE IF NOT EXISTS `path2health` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
USE `path2health`;
-- --------------------------------------------------------
--
-- Table structure for table `data`
--
CREATE TABLE IF NOT EXISTS `data` (
`record_number` int(10) NOT NULL AUTO_INCREMENT,
`patient_id` varchar(20) NOT NULL,
`systolic` int(3) NOT NULL,
`diastolic` int(3) NOT NULL,
`record_date` date NOT NULL,
PRIMARY KEY (`record_number`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=10 ;
--
-- Dumping data for table `data`
--
INSERT INTO `data` (`record_number`, `patient_id`, `systolic`, `diastolic`, `record_date`) VALUES
(1, 'patient1', 120, 70, '2014-03-11'),
(2, 'patient1', 140, 70, '2014-03-04'),
(5, 'patient1', 120, 60, '2014-03-11'),
(6, 'patient1', 130, 60, '2014-03-06'),
(8, 'patient1', 180, 100, '2014-03-25'),
(9, 'patient1', 160, 40, '2014-03-26');
-- --------------------------------------------------------
--
-- Table structure for table `doctor`
--
CREATE TABLE IF NOT EXISTS `doctor` (
`doctor_id` varchar(20) NOT NULL,
`doctor_name` varchar(20) NOT NULL,
`doctor_pwd` varchar(20) NOT NULL,
PRIMARY KEY (`doctor_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `doctor`
--
INSERT INTO `doctor` (`doctor_id`, `doctor_name`, `doctor_pwd`) VALUES
('gaofang', 'Michael', '123456');
-- --------------------------------------------------------
--
-- Table structure for table `patient`
--
CREATE TABLE IF NOT EXISTS `patient` (
`patient_id` varchar(20) NOT NULL,
`patient_name` varchar(20) NOT NULL,
`patient_pwd` varchar(20) NOT NULL,
`doctor_id` varchar(20) NOT NULL,
`patient_gender` char(1) NOT NULL,
`patient_dob` date NOT NULL,
`patient_stage` int(2) NOT NULL DEFAULT '0' COMMENT '0--4 Normal --Hypertensive Crisis',
`patient_emergency` int(2) NOT NULL,
PRIMARY KEY (`patient_id`),
KEY `patient_id` (`patient_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `patient`
--
INSERT INTO `patient` (`patient_id`, `patient_name`, `patient_pwd`, `doctor_id`, `patient_gender`, `patient_dob`, `patient_stage`, `patient_emergency`) VALUES
('patient1', 'John', '123456', 'gaofang', 'M', '1994-08-13', 3, 0),
('patient2', 'Mary', '123456', 'gaofang', 'F', '1994-03-04', 0, 0),
('patient3', 'Max', '123456', 'gaofang', 'M', '1984-03-18', 0, 0),
('patient4', 'Steve', '123456', 'gaofang', 'M', '2014-03-13', 0, 0),
('patient5', 'Shao', '123456', 'gaofang', 'F', '2014-03-26', 0, 0);
/*!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 */;