-
Notifications
You must be signed in to change notification settings - Fork 18
/
titangym.sql
159 lines (141 loc) · 7.55 KB
/
titangym.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
/*
Navicat Premium Data Transfer
Source Server : mysql
Source Server Type : MySQL
Source Server Version : 50714
Source Host : localhost:3306
Source Schema : titangym
Target Server Type : MySQL
Target Server Version : 50714
File Encoding : 65001
Date: 18/06/2018 21:25:06
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for address
-- ----------------------------
DROP TABLE IF EXISTS `address`;
CREATE TABLE `address` (
`id` varchar(20) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
`streetName` varchar(40) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
`state` varchar(15) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
`city` varchar(15) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
`zipcode` varchar(20) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
INDEX `userID`(`id`) USING BTREE,
CONSTRAINT `userID` FOREIGN KEY (`id`) REFERENCES `users` (`userid`) ON DELETE CASCADE ON UPDATE NO ACTION
) ENGINE = InnoDB CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of address
-- ----------------------------
INSERT INTO `address` VALUES ('1529336794', '2069 Quarry Drive', 'NC', 'Greensboro', '27409');
-- ----------------------------
-- Table structure for admin
-- ----------------------------
DROP TABLE IF EXISTS `admin`;
CREATE TABLE `admin` (
`username` varchar(20) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
`pass_key` varchar(20) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
`securekey` varchar(20) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
`Full_name` varchar(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
PRIMARY KEY (`username`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of admin
-- ----------------------------
INSERT INTO `admin` VALUES ('admin1', 'admin1', 'admin1', 'Titanium Gym');
-- ----------------------------
-- Table structure for enrolls_to
-- ----------------------------
DROP TABLE IF EXISTS `enrolls_to`;
CREATE TABLE `enrolls_to` (
`et_id` int(5) NOT NULL AUTO_INCREMENT,
`pid` varchar(8) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
`uid` varchar(20) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
`paid_date` varchar(15) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
`expire` varchar(15) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
`renewal` varchar(15) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
PRIMARY KEY (`et_id`) USING BTREE,
INDEX `user_ID`(`uid`) USING BTREE,
INDEX `plan_ID_idx`(`pid`) USING BTREE,
CONSTRAINT `plan_ID` FOREIGN KEY (`pid`) REFERENCES `plan` (`pid`) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT `user_ID` FOREIGN KEY (`uid`) REFERENCES `users` (`userid`) ON DELETE CASCADE ON UPDATE NO ACTION
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of enrolls_to
-- ----------------------------
INSERT INTO `enrolls_to` VALUES (1, 'POQKJC', '1529336794', '2018-06-18', '2018-07-18', 'yes');
-- ----------------------------
-- Table structure for health_status
-- ----------------------------
DROP TABLE IF EXISTS `health_status`;
CREATE TABLE `health_status` (
`hid` int(5) NOT NULL AUTO_INCREMENT,
`calorie` varchar(8) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
`height` varchar(8) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
`weight` varchar(8) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
`fat` varchar(8) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
`remarks` varchar(200) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
`uid` varchar(20) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
PRIMARY KEY (`hid`) USING BTREE,
INDEX `userID_idx`(`uid`) USING BTREE,
CONSTRAINT `uID` FOREIGN KEY (`uid`) REFERENCES `users` (`userid`) ON DELETE CASCADE ON UPDATE NO ACTION
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of health_status
-- ----------------------------
INSERT INTO `health_status` VALUES (1, NULL, NULL, NULL, NULL, NULL, '1529336794');
-- ----------------------------
-- Table structure for plan
-- ----------------------------
DROP TABLE IF EXISTS `plan`;
CREATE TABLE `plan` (
`pid` varchar(8) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
`planName` varchar(20) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
`description` varchar(200) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
`validity` varchar(20) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
`amount` int(10) NOT NULL,
`active` varchar(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
PRIMARY KEY (`pid`) USING BTREE,
INDEX `pid`(`pid`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of plan
-- ----------------------------
INSERT INTO `plan` VALUES ('POQKJC', 'Monthly Plan', 'A monthly subscription that unlocks the entire Gym Plan app and coach support on chat.', '1', 600, 'yes');
-- ----------------------------
-- Table structure for timetable
-- ----------------------------
DROP TABLE IF EXISTS `timetable`;
CREATE TABLE `timetable` (
`tid` int(12) NOT NULL AUTO_INCREMENT,
`tname` varchar(45) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
`day1` varchar(200) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
`day2` varchar(200) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
`day3` varchar(200) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
`day4` varchar(200) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
`day5` varchar(200) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
`day6` varchar(200) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
PRIMARY KEY (`tid`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for users
-- ----------------------------
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
`userid` varchar(20) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
`username` varchar(40) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
`gender` varchar(8) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
`mobile` varchar(20) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
`email` varchar(20) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
`dob` varchar(10) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
`joining_date` varchar(10) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
PRIMARY KEY (`userid`) USING BTREE,
UNIQUE INDEX `email`(`email`) USING BTREE,
INDEX `userid`(`userid`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of users
-- ----------------------------
INSERT INTO `users` VALUES ('1529336794', 'Christiana Mayberry', 'Male', '3362013747', '[email protected]', '1968-04-13', '2018-06-18');
SET FOREIGN_KEY_CHECKS = 1;