alter table coaches add month_salary decimal; alter table coaches add hour_salary decimal; UPDATE `school_sport_clubs`.`coaches` SET `month_salary`='1200', `hour_salary`='24' WHERE `id`='1'; UPDATE `school_sport_clubs`.`coaches` SET `month_salary`='1300', `hour_salary`='25' WHERE `id`='2'; UPDATE `school_sport_clubs`.`coaches` SET `month_salary`='1800', `hour_salary`='28' WHERE `id`='3'; UPDATE `school_sport_clubs`.`coaches` SET `month_salary`='2000', `hour_salary`='30' WHERE `id`='4'; UPDATE `school_sport_clubs`.`coaches` SET `month_salary`='1450', `hour_salary`='26' WHERE `id`='5'; create table coach_work( id int auto_increment primary key, coach_id int not null, group_id int not null, number_of_hours int not null default 1, date Datetime not null, foreign key (coach_id) references coaches(id), foreign key (group_id) references sportgroups(id) ); INSERT INTO `school_sport_clubs`.`coach_work` (`coach_id`, `group_id`, `number_of_hours`, `date`) VALUES ('1', '1', '2', '2016-03-07 08:45:55'); INSERT INTO `school_sport_clubs`.`coach_work` (`coach_id`, `group_id`, `number_of_hours`, `date`) VALUES ('1', '1', '2', '2016-03-14 08:45:55'); INSERT INTO `school_sport_clubs`.`coach_work` (`coach_id`, `group_id`, `number_of_hours`, `date`) VALUES ('1', '1', '2', '2016-03-21 08:45:55'); INSERT INTO `school_sport_clubs`.`coach_work` (`coach_id`, `group_id`, `number_of_hours`, `date`) VALUES ('1', '1', '2', '2016-03-28 08:45:55'); INSERT INTO `school_sport_clubs`.`coach_work` (`coach_id`, `group_id`, `number_of_hours`, `date`) VALUES ('1', '1', '2', '2016-04-04 08:45:55'); INSERT INTO `school_sport_clubs`.`coach_work` (`coach_id`, `group_id`, `number_of_hours`, `date`) VALUES ('1', '1', '2', '2016-04-11 08:45:55'); INSERT INTO `school_sport_clubs`.`coach_work` (`coach_id`, `group_id`, `number_of_hours`, `date`) VALUES ('2', '2', '2', '2016-03-07 08:45:55'); INSERT INTO `school_sport_clubs`.`coach_work` (`coach_id`, `group_id`, `number_of_hours`, `date`) VALUES ('2', '2', '2', '2016-03-14 08:45:55'); INSERT INTO `school_sport_clubs`.`coach_work` (`coach_id`, `group_id`, `number_of_hours`, `date`) VALUES ('2', '2', '2', '2016-03-21 08:45:55'); INSERT INTO `school_sport_clubs`.`coach_work` (`coach_id`, `group_id`, `number_of_hours`, `date`) VALUES ('2', '2', '2', '2016-03-28 08:45:55'); INSERT INTO `school_sport_clubs`.`coach_work` (`coach_id`, `group_id`, `number_of_hours`, `date`) VALUES ('2', '2', '2', '2016-04-04 08:45:55'); INSERT INTO `school_sport_clubs`.`coach_work` (`coach_id`, `group_id`, `number_of_hours`, `date`) VALUES ('2', '2', '2', '2016-04-11 08:45:55'); INSERT INTO `school_sport_clubs`.`coach_work` (`coach_id`, `group_id`, `number_of_hours`, `date`) VALUES ('2', '3', '2', '2016-04-02 08:45:55'); INSERT INTO `school_sport_clubs`.`coach_work` (`coach_id`, `group_id`, `number_of_hours`, `date`) VALUES ('2', '3', '2', '2016-04-09 08:45:55'); ALTER TABLE coach_work ADD isPayed BOOLEAN NOT NULL DEFAULT 0;