· 6 years ago · Oct 24, 2019, 03:08 PM
1drop database if exists lamp1_survey;
2create database lamp1_survey;
3
4grant all privileges on lamp1_survey.* to 'lamp1_survey'@'localhost' identified by '!Survey9!';
5
6use lamp1_survey
7
8CREATE TABLE `participants` (
9 `part_id` int(11) NOT NULL AUTO_INCREMENT,
10 `part_fullname` varchar(128) NOT NULL,
11 `part_age` int(11) NOT NULL,
12 `part_student` char(1) NOT NULL,
13 PRIMARY KEY (`part_id`)
14);
15
16
17CREATE TABLE `responses` (
18 `resp_id` int(11) NOT NULL AUTO_INCREMENT,
19 `resp_part_id` int(11) NOT NULL,
20 `resp_product` varchar(100) NOT NULL,
21 `resp_how_purchased` varchar(50) NOT NULL,
22 `resp_satisfied` int(11) NOT NULL,
23 `resp_recommend` varchar(10) NOT NULL,
24 PRIMARY KEY (`resp_id`)
25)