当前位置: 首页 > news >正文

永久免费wap自助建站可以做mv的视频网站

永久免费wap自助建站,可以做mv的视频网站,python基础教程免费,国家开发银行贷款学生在线系统----VQ29 验证刷题效果#xff0c;输出题目真实通过率 牛客刷题记录表done_questions_record#xff0c;为验证重复刷题率#xff0c;需要我们查找一些数据#xff1a; question_pass_rate 表示每个用户不同题目的通过率#xff08;同一用户同一题重复提交通过仅计算一次输出题目真实通过率 牛客刷题记录表done_questions_record为验证重复刷题率需要我们查找一些数据 question_pass_rate 表示每个用户不同题目的通过率同一用户同一题重复提交通过仅计算一次 pass_rate 表示每个用户的提交正确率只要有提交一次即计算一次 question_per_cnt表示平均每道不同的题目被提交的次数只要有一次提交即计算一次。 请你输出题目通过率 question_pass_rate 60% 的用户的提交正确率 pass_rate 与每题目平均提交次数 question_per_cnt。按照用户名升序排序。 result_info ‘是否通过1通过 0不通过’查询返回结果名称和顺序为 user_id|question_pass_rate|pass_rate|question_per_cnt 表的创建及数据添加 drop table if exists done_questions_record; create table done_questions_record (user_id int not null,question_id int not null,question_type varchar(24) not null,done_time datetime not null,result_info int not null );insert into done_questions_record values (101, 1, python, 2022-01-01 12:30:21, 0); insert into done_questions_record values (101, 1, python, 2022-01-01 12:30:22, 1); insert into done_questions_record values (102, 1, python, 2022-01-01 14:30:23, 1); insert into done_questions_record values (101, 2, sql, 2022-01-01 16:30:24, 1); insert into done_questions_record values (102, 2, sql, 2022-01-02 08:30:25, 1); insert into done_questions_record values (103, 1, python, 2022-01-03 10:30:26, 0); insert into done_questions_record values (104, 1, python, 2022-01-03 11:30:27, 0); insert into done_questions_record values (103, 2, sql, 2022-01-03 19:30:28, 1); insert into done_questions_record values (105, 1, python, 2022-01-03 12:30:29, 0); insert into done_questions_record values (103, 3, java, 2022-01-03 12:30:30, 0); insert into done_questions_record values (105, 3, java, 2022-01-03 12:30:31, 1); insert into done_questions_record values (105, 4, js, 2022-01-03 12:30:32, 0); insert into done_questions_record values (104, 5, c, 2022-01-03 12:30:33, 1); insert into done_questions_record values (106, 5, c, 2022-01-03 12:30:34, 0); insert into done_questions_record values (101, 5, c, 2022-01-03 12:30:35, 1); insert into done_questions_record values (106, 5, c, 2022-01-03 12:30:36, 1); insert into done_questions_record values (102, 5, c, 2022-01-03 12:30:37, 1); insert into done_questions_record values (103, 4, js, 2022-01-03 12:30:38, 1); insert into done_questions_record values (105, 3, java, 2022-01-03 12:30:39, 1); insert into done_questions_record values (103, 2, sql, 2022-01-03 12:30:40, 0); insert into done_questions_record values (105, 1, python, 2022-01-03 12:30:41, 0); insert into done_questions_record values (105, 1, python, 2022-01-03 12:30:42, 1); insert into done_questions_record values (104, 2, sql, 2022-01-03 12:30:43, 1);解题思路题目理解可能会有差异仅个人理解 question_pass_rate : 通过的题目种类数个数 / 总题目种类个数 --去重 pass_rate用户做题通过的个数 / 用户做题总个数 question_per_cnt用户做题总个数 / 用户做过的题目种类 --去重 1、通过的题目种类数个数 --去重 count(distinct iif(result_info 1, question_id, null)说明此处不能用SUM函数在去重时只会去重题目id不会去重结果用SUM函数会存在重复计算结果且SUM函数用法比较局限此题不推荐使用本人懒偷巧就用啦。 2、总题目种类个数 --去重 count(distinct question_id)3、用户做题通过的个数 sum(result_info) --or count(iif(result_info 1, question_id, null)说明应为结果只有1、0且不存在去重问题可直接相加结果就是通过的个数不推荐使用SUM函数可使用or下面查询当结果不为1、0时也可查询任何符合条件的总数。 4、用户做题总个数 用户的记录数 count(user_id)5、 用户做过的题目种类 --去重 count(distinct question_id)6、CONVERT函数 Convert(decimal(18,2),count(user_id)* 1.0 / count(distinct question_id)说明整数除法运算结果将被截断为整数部分0.75 01.75 1如果要将结果转换为其他数据类型如小数可以使用CONVERT函数。使用CONVERT函数将整数除法结果转换为DECIMAL(18, 2)数据类型该数据类型表示18位精度和2位小数。通过使用CONVERT函数可以将整数除法结果转换为所需的数据类型并保留适当的精度和小数位数。 注意 ① 1-5中所有函数都是在以user_id分组条件下实现的 ② sql sever中使用除法需要使用对应类型转换函数。 整理上述代码可得查询 查询如下 select * from (select user_id,--count(DISTINCT question_id) as 题数,Convert(decimal(18,2),count(distinct iif(result_info 1, question_id, null)) * 1.0 /count(distinct question_id)) as question_pass_rate,--cast( sum(result_info) * 1.0 /count(DISTINCT question_id) as decimal(18,4) ) question_pass_rate2Convert(decimal(18,2),sum(result_info) * 1.0 /count( question_id)) as pass_rate,Convert(decimal(18,2),count(user_id)* 1.0 / count(distinct question_id)) as question_per_cntfrom done_questions_recordgroup by user_id) twhere question_pass_rate0.6
http://www.zqtcl.cn/news/603778/

相关文章:

  • 网站开发用什么图片格式最好网络营销名词解释是什么
  • 做柜子网站老电脑做网站服务器
  • 域名购买网站网店装修是什么
  • wordpress 网站备份为什么企业要建设自己的企业文化
  • 想做一个部门的网站怎么做潍坊网站建设价
  • 网站建设公司的公司哪家好什么行业必须做网站
  • 电子商务网站前台设计wordpress 上传文件大小
  • 深圳市住房和城乡建设局网站非常好的资讯网站设计
  • 长春作网站建设的公司国家建设环保局网站
  • 网站开发的有哪些好的软件wordpress菜单栏的函数调用
  • 家庭清洁东莞网站建设技术支持建筑模板厂投资多少钱
  • 郑州企业建站详情网站开发和网页开发有什么区别
  • 山西古建筑网站个人网站可以做自媒体吗
  • 腾讯云服务器可以做网站wordpress中文正式版
  • 做相亲网站赚钱吗vultr部署wordpress
  • 网站被挂马原因做网站较好的框架
  • 网站开发毕业设计参考文献自考大型网站开发工具
  • p2p网站建设方案策划书黄山旅游攻略冬季
  • 最世网络建设网站可以吗小说网站制作开源
  • 广州网站建设知名 乐云践新网页界面制作
  • 沈阳网站哪家公司做的好招标信息发布
  • 兰州企业网站h5页面用什么软件
  • 东莞自助建站软件ppt怎么做 pc下载网站
  • 兴化网站建设价格怎样用自己的电脑,做网站
  • 东莞网站建设企慕网站名称 注册
  • 佛山网站建设服务商百度推广客户端手机版下载
  • 做网站找个人还是找公司wordpress jiathis
  • 淘宝客推广网站建设百度云wordpress转服务器
  • 网站构建代码模板怎么在云服务器上建设网站
  • 国内产品网站建设游戏创造器