|
| 1 | +Create table If Not Exists Actions (user_id int, post_id int, action_date date, action ENUM('view', 'like', 'reaction', 'comment', 'report', 'share'), extra varchar(10)); |
| 2 | +create table if not exists Removals (post_id int, remove_date date); |
| 3 | +Truncate table Actions; |
| 4 | +insert into Actions (user_id, post_id, action_date, action, extra) values ('1', '1', '2019-07-01', 'view', 'None'); |
| 5 | +insert into Actions (user_id, post_id, action_date, action, extra) values ('1', '1', '2019-07-01', 'reaction', 'love'); |
| 6 | +insert into Actions (user_id, post_id, action_date, action, extra) values ('1', '1', '2019-07-01', 'share', 'None'); |
| 7 | +insert into Actions (user_id, post_id, action_date, action, extra) values ('2', '2', '2019-07-04', 'view', 'None'); |
| 8 | +insert into Actions (user_id, post_id, action_date, action, extra) values ('2', '2', '2019-07-04', 'report', 'spam'); |
| 9 | +insert into Actions (user_id, post_id, action_date, action, extra) values ('3', '4', '2019-07-04', 'view', 'None'); |
| 10 | +insert into Actions (user_id, post_id, action_date, action, extra) values ('3', '4', '2019-07-04', 'report', 'spam'); |
| 11 | +insert into Actions (user_id, post_id, action_date, action, extra) values ('4', '3', '2019-07-02', 'view', 'None'); |
| 12 | +insert into Actions (user_id, post_id, action_date, action, extra) values ('4', '3', '2019-07-02', 'report', 'spam'); |
| 13 | +insert into Actions (user_id, post_id, action_date, action, extra) values ('5', '2', '2019-07-04', 'view', 'None'); |
| 14 | +insert into Actions (user_id, post_id, action_date, action, extra) values ('5', '2', '2019-07-04', 'report', 'racism'); |
| 15 | +insert into Actions (user_id, post_id, action_date, action, extra) values ('5', '5', '2019-07-04', 'view', 'None'); |
| 16 | +insert into Actions (user_id, post_id, action_date, action, extra) values ('5', '5', '2019-07-04', 'report', 'racism'); |
| 17 | +Truncate table Removals; |
| 18 | +insert into Removals (post_id, remove_date) values ('2', '2019-07-20'); |
| 19 | +insert into Removals (post_id, remove_date) values ('3', '2019-07-18'); |
0 commit comments