特斯拉技术⽀持⼯程师实习笔试题⽬录
1.Task1
建表语句
create table tasks (
xzj
id integer not null,
name varchar(40)not null, unique(id)
);
create table reports (
id integer not null,
task_id integer not null,
candidate varchar(40)not null,    score integer not null, unique(id)花冠报价图片
);
测试数据插⼊语句:
insert into tasks values(101,'MinDist');
insert into tasks values(123,'Equi');
insert into tasks values(142,'Median');
insert into tasks values(300,'Tricoloring');
奥迪a5价格insert into reports values(13,101,'John Smith',100);
insert into reports values(24,123,'Delaney Lloyd',34);
insert into reports values(37,300,'Monroe Jimenez',50);
insert into reports values(49,101,'Stanley Price',45);
insert into reports values(51,142,'Tanner Sears',37);
insert into reports values(68,142,'Lara Fraser',3);
insert into reports values(83,300,'Tanner Sears',0);
题解:
SELECT reports.task_id,tasks.name AS task_name,
(case
when AVG(reports.score)<=20THEN'Hard'
when AVG(reports.score)>20and AVG(reports.score)<=60THEN'Medium' when AVG(reports.score)>60THEN'Easy'
end)as difficulty
FROM tasks
宝马316
LEFT JOIN reports
ON tasks.id=reports.task_id
GROUP BY reports.task_id,tasks.name威然
ORDER BY reports.task_id ASC;
2.Task2
>subaru xv