首页
题库
公司真题
专项练习
面试题库
在线编程
面试
面试经验
AI 模拟面试
简历
求职
学习
基础学习课
实战项目课
求职辅导课
专栏&文章
竞赛
我要招人
发布职位
发布职位、邀约牛人
更多企业解决方案
AI面试、笔试、校招、雇品
HR免费试用AI面试
最新面试提效必备
登录
/
注册
响咚咚耶
获赞
0
粉丝
0
关注
0
看过 TA
3
深圳大学
2024
算法工程师
IP属地:广东
暂未填写个人简介
私信
关注
拉黑
举报
举报
确定要拉黑响咚咚耶吗?
发布(10)
评论
刷题
收藏
响咚咚耶
关注TA,不错过内容更新
关注
2024-01-17 21:07
深圳大学 算法工程师
题解 | #密码游戏#
num = int(input()) part = [] part.append(num//1000) part.append(num//100-num//1000*10) part.append(num//10- num//100*10) part.append(num- num//10*10) box = [] box.append(str((part[2]+3)%9)) box.append(str((part[3]+3)%9)) box.append(str((part[0]+3)%9)) box.append(str((part[1]+3)%9)) # 注意join方法的参数不...
0
点赞
评论
收藏
分享
2023-10-16 23:39
深圳大学 算法工程师
题解 | #列出供应商及其可供产品的数量#
/*使用外部联结时,count()若没有对应行会显示0 若不用外部联结,当没有对应行时会不显示 */ select v.vend_id, count(p.prod_id) prod_id from Vendors v left outer join Products p on v.vend_id = p.vend_id group by v.vend_id order by v.vend_id;
0
点赞
评论
收藏
分享
2023-10-16 20:15
深圳大学 算法工程师
题解 | #确定最佳顾客的另一种方式(二)#
select c.cust_name, t.total_price from Customers c inner join Orders o on c.cust_id = o.cust_id inner join (select order_num, sum(quantity * item_price) total_price from OrderItems group by order_num having total_price>=1000 ) t on t.order_num = o.order_num order by total_price;
0
点赞
评论
收藏
分享
2023-10-16 19:48
深圳大学 算法工程师
题解 | #返回顾客名称和相关订单号以及每个订单的总价#
/*多表联结,分别通过相同的列将表关联起来,当中的select子句 相当于另外创建了一张表oo。 在不影响速度情况下,join可以多次使用 */ select c.cust_name, oo.order_num, oo.OrderTotal from Orders o join (select order_num, sum(quantity * item_price) OrderTotal from OrderItems group by order_num) oo on oo.order_num = o.order_num join Customers c on c.cust_id = o...
0
点赞
评论
收藏
分享
2023-10-13 17:21
深圳大学 算法工程师
题解 | #返回每个订单号各有多少行数#
/*算法顺序是先group by 再 select ,按order_num分组后 count(order_num)就是计算相同order_num出现的次数。*/ select order_num, count(order_num) order_lines from OrderItems group by order_num order by order_lines;
0
点赞
评论
收藏
分享
2023-10-13 17:07
深圳大学 算法工程师
题解 | #返回指定日的所有订单的订单号和订单日期#
select order_num, order_date from Orders where year(order_date) like '2020' and month(order_date) like '1' order by order_date; 使用日期函数month(date),获得指定date的月份时不能写‘01’。
0
点赞
评论
收藏
分享
2023-10-13 16:59
深圳大学 算法工程师
题解 | #顾客登录名#
select cust_id, cust_name, upper(concat(substring(cust_name,1,2),substring(cust_city,1,3))) user_login from Customers;
0
点赞
评论
收藏
分享
2023-09-26 15:13
深圳大学 算法工程师
题解 | #计算用户的平均次日留存率#
select round(count(q2.device_id)/count(q1.device_id),4) as avg_ret from ( (select distinct device_id, date from question_practice_detail as qpd1) as q1 left join ( select distinct device_id, date from question_practice_detail as qpd2 ) as q2 ...
0
点赞
评论
收藏
分享
2023-09-24 22:54
深圳大学 算法工程师
题解 | #浙江大学用户题目回答情况#
select device_id, question_id, result from question_practice_detail where device_id=(select device_id from user_profile where university = '浙江大学');
0
点赞
评论
收藏
分享
2023-09-24 12:16
深圳大学 算法工程师
题解 | #分组计算练习题#
select gender,university,count(*) as user_num, avg(active_days_within_30) as avg_active_day, avg(question_cnt) as avg_question_cnt from user_profile group by gender , university;
0
点赞
评论
收藏
分享
1
创作者周榜
更多
关注他的用户也关注了:
牛客网
牛客企业服务