create database LOLtrainingsystem;
use LOLtrainingsystem;
create table player(
play_id int not null unique,
account varchar(255) not null unique,
account_password varchar(255) not null,
phonenumber varchar(20) not null,
gamelevel varchar(255),
gamerank varchar(255),
primary key (play_id)
);
create table proxy_trainer(
ptid int not null unique,
self_introduction varchar(255),
gameservice varchar(255) not null,
price decimal(10,2) not null,
primary key (ptid)
);
create table customer_service(
csid int not null unique,
csname varchar(255) not null unique,
contact varchar(255) not null,
work_status enum('online', 'offline', 'busy') not null default 'online',
primary key (csid)
);
create table order_(
orderid int not null unique,
play_id int not null ,
ptid int not null ,
csid int not null ,
ordertime datetime not null,
expected_duration int,
order_status enum('complete', 'incomplete', 'processing') not null default 'processing',
primary key (orderid),
foreign key (play_id) references player(play_id),
foreign key (ptid) references proxy_trainer(ptid),
foreign key (csid) references customer_service(csid)
);
insert into player (play_id, account, account_password, phonenumber, gamelevel, gamerank)
values
(1,'123456','123456','13368888456',50,'Silver'),
(2,'234567','123456','13368888654',150,'Master'),
(3,'345678','123456','13368888774',300,'Challenger');
insert into proxy_trainer (ptid,self_introduction, gameservice, price)
values
(1,'宗师段位辅助专精,锤石泰坦绝活', '下路双排上分', 120.50),
(2,'峡谷之巅王者中单,90%胜率妖姬', '中单位置代练', 200.00),
(3,'全能补位选手,精通所有位置', '全段位代打', 180.75),
(4,'拳打theshy,脚踢rookie', '演员', 250.00);
insert into customer_service (csid,csname, contact, work_status)
values
(1,'客服001','13369987452','online'),
(2,'客服002','13369987952','offline'),
(3,'客服003','13364687452','busy');
insert into order_ (orderid,play_id, ptid, csid, ordertime, expected_duration, order_status)
values
(1,1, 2, 1, '2025-07-02 10:45:36', 12, 'processing'),
(2,2, 1, 2, '2025-07-01 09:15:27', 36, 'complete'),
(3,2, 2, 2, '2025-07-03 18:45:00', 72, 'incomplete');
select * from order_;
select * from player;
update player
set gamerank='master', gamelevel='70'
where play_id=1;
select * from player;
select * from proxy_trainer;
delete from proxy_trainer
where ptid =4;
select * from proxy_trainer;
alter table player
drop column gamelevel;
select * from player;
drop table order_;
drop table player;