landf31
landf31
全部文章
分类
题解(71)
归档
标签
去牛客网
登录
/
注册
landf31的博客
TA的专栏
1篇文章
0人订阅
刷题笔记
1篇文章
592人学习
全部文章
(共56篇)
题解 | #返回购买价格为 10 美元或以上产品的顾客列表#
select cust_email from Customers where cust_id in (select cust_id from Orders where order_num in (select order_num from OrderItems...
Mysql
2022-04-05
0
264
题解 | #返回购买价格为 10 美元或以上产品的顾客列表#
select cust_id from Orders where order_num in (select order_num from OrderItems where item_price>=10);
Mysql
2022-04-05
0
314
题解 | #纠错3#
SELECT order_num, COUNT(*) AS items FROM OrderItems GROUP BY order_num HAVING COUNT(*) >= 3 ORDER BY items, order_num;
Mysql
2022-04-05
0
261
题解 | #每个供应商成本最低的产品#
select vend_id,min(prod_price) as cheapest_item from Products group by vend_id having cheapest_item order by cheapest_item;
Mysql
2022-04-05
0
343
题解 | #返回每个订单号各有多少行数#
select order_num, count(order_num) as order_lines from OrderItems group by order_num order by order_lines asc; /*group by 去重,count 统计*/
Mysql
2022-04-05
1
507
题解 | #确定已售出产品项 BR01 的总数#
select sum(quantity) as items_ordered from OrderItems where prod_id='BR01'; select sum(quantity) as items_odered from OrderItems group by prod_id hav...
Mysql
2022-04-05
15
1083
题解 | #返回 2020 年 1 月的所有订单的订单号和订单日期#
select order_num,order_date from Orders where date_format(order_date,'%Y-%m')='2020-01' order by order_date; /*利用date_format,格式化数据*/ select *from Ord...
Mysql
2022-04-04
3
405
题解 | #顾客登录名#
concat(s1,s2,s3...)字符连接 upper(s)转大写 substr(s,i,length),i为第i个字符,i>=1 select cust_id,cust_name, upper(concat(substr(cust_contact,1,2),substr(cust_ci...
Mysql
2022-04-04
0
317
题解 | #别名#
select vend_id,vend_name vname,vend_address vaddress,vend_city vcity from Vendors order by vname;
Mysql
2022-04-04
0
277
题解 | #检索产品名称和描述(四)#
select prod_name,prod_desc from Products where prod_desc like '%toy%carrots%';
Mysql
2022-04-04
0
320
首页
上一页
1
2
3
4
5
6
下一页
末页