由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Database版 - 请教Beijing大牛一道SQL题,多谢
相关主题
F家DS,analytics电面面经,贡献一个sql相关 (转载)In MySQL, 如何在procedure里create trigger?谢谢了?
Oracle新手请教一个问题check time table created in IBM SQL Aginity workbench ? (转载)
MySQL table either insert or drop/truncate table running forever请教一个SQL 面试题
SQL, recruiter发过来的面试题 (转载)Re: How to answer these questions? Thanks
[转载] JDBC 处理日期的问题(日期插入数据库)面试回来发考题3
plsql 求救--速度太慢了, 咋办呢不要啥都往大数据上扯
MS T-SQL 问题视频:国内财会本科到米国大公司挣八万的真实体验
求帮忙recover deleted rows in oracleQuestions on SQL
相关话题的讨论汇总
话题: answer话题: question话题: null话题: skip话题: beijing
进入Database版参与讨论
1 (共1页)
d***e
发帖数: 193
1
考古出来的一道题,多谢beijing大牛及各位大牛:
Survey_log (uid, action, question_id, answer_id, q_num, timestamp)
action = 'show', 'answer', 'skip'
answer_id = when action=answer, null for skip and show
q_num is the numeral/order of the question in the session
uid, eventtype, quid, aid, qorder, timestamp
5, 'show', 285, null, 1, 141425411
5, 'answer', 285, 124124, 1, 141425415
5, 'show', 369, null, 2, 141425416
5, 'skip', 369, null, 2, 141425417
1. write a sql query to identify the one question that has the highest
answer rate
2.Supposer an user has answered question with qid = 1. What question should
be presented to this user next?
B*****g
发帖数: 34098
2
1 找出每道题的answer rate,然后排序,然后取最大的。(别问我,我也不知道啥是
answer rate)
2 没看懂题,纯属胡猜。找出所有答了Q1的人(uid,qorder),按(uid,qorder+1(
也需要跳过skip的题))找出quid,然后看哪个quid出现的次数多。
补充:这题见过,应该没作答。理由很简单,上下column都对不上。出题人打屁屁

【在 d***e 的大作中提到】
: 考古出来的一道题,多谢beijing大牛及各位大牛:
: Survey_log (uid, action, question_id, answer_id, q_num, timestamp)
: action = 'show', 'answer', 'skip'
: answer_id = when action=answer, null for skip and show
: q_num is the numeral/order of the question in the session
: uid, eventtype, quid, aid, qorder, timestamp
: 5, 'show', 285, null, 1, 141425411
: 5, 'answer', 285, 124124, 1, 141425415
: 5, 'show', 369, null, 2, 141425416
: 5, 'skip', 369, null, 2, 141425417

d***e
发帖数: 193
3
谢谢beijing大牛牛!
我也觉得这题挺奇怪的

【在 B*****g 的大作中提到】
: 1 找出每道题的answer rate,然后排序,然后取最大的。(别问我,我也不知道啥是
: answer rate)
: 2 没看懂题,纯属胡猜。找出所有答了Q1的人(uid,qorder),按(uid,qorder+1(
: 也需要跳过skip的题))找出quid,然后看哪个quid出现的次数多。
: 补充:这题见过,应该没作答。理由很简单,上下column都对不上。出题人打屁屁

1 (共1页)
进入Database版参与讨论
相关主题
Questions on SQL[转载] JDBC 处理日期的问题(日期插入数据库)
where can I download SQL Sever? thanks (null)plsql 求救--速度太慢了, 咋办呢
Re: How to concatenate NULL value with a string in SQL Server?MS T-SQL 问题
in DBMS, is NULL=NULL valid?求帮忙recover deleted rows in oracle
F家DS,analytics电面面经,贡献一个sql相关 (转载)In MySQL, 如何在procedure里create trigger?谢谢了?
Oracle新手请教一个问题check time table created in IBM SQL Aginity workbench ? (转载)
MySQL table either insert or drop/truncate table running forever请教一个SQL 面试题
SQL, recruiter发过来的面试题 (转载)Re: How to answer these questions? Thanks
相关话题的讨论汇总
话题: answer话题: question话题: null话题: skip话题: beijing