Alina_0229
Alina_0229
全部文章
分类
题解(129)
归档
标签
去牛客网
登录
/
注册
Alina_0229的博客
全部文章
(共98篇)
题解 | #每个供应商成本最低的产品#
select vend_id,min(prod_price) as cheapest_item from Products group by vend_id order by cheapest_item asc 题目要求:编写 SQL 语句,返回名为 cheapest_item 的字段,该字段包含每...
2023-01-18
0
333
题解 | 确定 Products 表中价格不超过 10 美元
#select prod_price as max_price from Products where prod_price <=10 order by prod_price desc limit 1 # select max(prod_price) as max_price from Pr...
2023-01-18
0
323
题解 | #顾客登录名#
select cust_id,cust_name,upper(concat(substr(cust_contact,1,2),substr(cust_city,1,3))) as user_login from Customers 这是我能想到的,可能不是最简单的,不是最好的upper()转大写,c...
2023-01-18
0
222
题解 | #计算用户8月每天的练题数量#
select day(date) as day,count(question_id) as question_cnt from question_practice_detail where date like'2021-08%' group by date 日期函数 day(date):获取到dat...
2023-01-16
0
220
题解 | #计算25岁以上和以下的用户数量#
select (case when age >=25 then '25岁及以上' else '25岁以下' end) as age_cnt,count(*) as number from user_profile group by age_cnt case when 字段条件 then ...
2023-01-15
0
260
题解 | #查找山东大学或者性别为男生的信息#
select device_id,gender,age,gpa from user_profile where university = '山东大学' union all select device_id,gender,age,gpa from user_profile where gender =...
2023-01-15
0
236
题解 | #牛牛最喜欢的语言#
print('Python is the best language!')
2023-01-03
0
183
题解 | #查询所有列#
select * from 表名
2022-11-11
0
221
题解 | #得分不小于平均分的最低分#
select min(score) from exam_record r, examination_info i where r.exam_id = i.exam_id and i.tag = 'SQL' and r.score >= ( select avg(er.score) from e...
Mysql
2022-03-25
0
249
题解 | #按照dept_no进行汇总#
select dept_no,group_concat(emp_no) from dept_emp group by dept_no 聚合函数中的拼接函数:group_concat() 拼接数据 参考了如下相关的用法: https://www.cnblogs.com/lixinjun8080/p/1...
Mysql
2022-03-23
0
241
首页
上一页
1
2
3
4
5
6
7
8
9
10
下一页
末页