牛客297995581号
牛客297995581号
全部文章
题解
归档
标签
去牛客网
登录
/
注册
牛客297995581号的博客
全部文章
/ 题解
(共40篇)
题解 | #顾客登录名#
select cust_id,cust_name, // 1.转大写2.字符串拼接3.字符串截取:substring(列,起始位置,结束位置),起始位置下标为1 upper(concat(substring(cust_contact,1,2),substring(cust_city...
Mysql
2022-03-25
0
311
题解 | #纠错2#
select prod_name,prod_desc from Products # where prod_desc like '%toy%' and prod_desc like '%carrots%';#行 # where prod_desc like '%toy%' and '%carrots...
Mysql
2022-03-25
163
4661
题解 | #返回所有价格在 3美元到 6美元之间的产品的名称和价格#
select prod_name,prod_price from Products where prod_price between 3 and 6 order by prod_price;//默认升序
Mysql
2022-03-25
0
309
题解 | #检索并列出已订购产品的清单#
select order_num,prod_id,quantity from OrderItems where prod_id in('BR01','BR02','BR03') and quantity >= 100; 注意:prod_id 是字符串类型
Mysql
2022-03-25
0
345
题解 | #按照数量和价格排序#
select quantity,item_price from OrderItems order by quantity desc,item_price desc; //多列排序时,注意:1.注意列的顺序 2.注意格式:列1 asc/desc,列2 asc/desc...... //3.没有注明升降...
Mysql
2022-03-23
32
1002
题解 | #对顾客ID和日期排序#
select cust_id,order_num from Orders # 注意审题: 订单日期倒序排列 order by cust_id asc,order_date desc; // order by + 列(select 后可以没有)
Mysql
2022-03-23
10
775
题解 | #21年8月份练题总数#
select count(distinct device_id) as did_cnt,//总用户数:用户可以登录多次同一台设备 count(question_id) as question_cnt//总次数 from question_practice_detail qpd where year...
Mysql
2022-03-23
4
330
题解 | #统计复旦用户8月练题情况#
select difficult_level, //正确率:正确数/总题数 sum(if(qpd.result = 'right', 1, 0)) / count(qpd.question_id) as correct_rate from question_practice_de...
Mysql
2022-03-23
6
500
题解 | #统计复旦用户8月练题情况#
select up.device_id, university, //是八月份计数+1(从0开始),不是计数+0 sum(if(month(qpd.date) = 8,1,0)) as question_cnt, //答题结果正确计数+1,错误+0(同上)...
Mysql
2022-03-22
0
318
题解 | #找出每个学校GPA最低的同学#
select device_id, university, gpa from ( //*是为了提供select的列数据 //窗口函数:先根据university分组,然后在分组内部按gpa升序排列,这里取到的是不同学校升序排列的gpa数据们...
Mysql
2022-03-21
5
362
首页
上一页
1
2
3
4
下一页
末页