create database forum;
use forum;
create table post
(
    pID bigint auto_increment primary key,
    pTitle char(100),
    pCont   text,
    pTime datetime default now(),
    uID char(20),
    constraint fk_post foreign key(uID) references user(uID)
);
create table reply
(
    rID bigint auto_increment primary key,
    rTitle char(100),
    rCont   text,
    rTime datetime default now(),
    uID char(20),
    pID bigint,
    constraint fk_reply_uID foreign key(uID) references user(uID),
    constraint fk_reply_pID foreign key(pID) references post(pID)
);
insert into post(pTitle, pCont, uID) values('2020 Election', 'Trump wins.', 'user1');
select sleep(3);
insert into post(ptitle, pCont, uid) values('iPhone 12 released', 'Apple iPhone 12 Pro max released today', 'user1');
select sleep(2);
insert into reply(rTitle, rCont, uID, pID) values('Re: 2020 Election', 'Very Good!', 'user1', 1);
select sleep(1);
insert into post(pTitle, pCont, uID) values('4 Best CS University', 'CMU, Stanford, UCB, MIT', 'user1');
select sleep(2);
insert into reply(rTitle, rCont, uID, pID) values ('Re: 2020 Election', 'It is a lie!!', 'user1', 1);
select sleep(1);
insert into reply(rTitle, rCont, uID, pID) values ('Re: 2020 Election', 'The winner is Biden!','user1', 1);
select sleep(2);
insert into reply(rTitle, rCont, uID, pID) values ('Re: 4 Best CS University', 'MIT is the best.', 'user1', 3);
select sleep(3);
insert into reply(rTitle, rCont, uID, pID) values ('Re: 4 Best CS University', 'I think CMU is the best.', 'user1', 3);
select sleep(1);
insert into post(pTitle, pCont, uID) values('Exam results.', 'I am No. 1', 'user3');