风飞飞飞
风飞飞飞
全部文章
题解
归档
标签
去牛客网
登录
/
注册
风飞飞飞的博客
全部文章
/ 题解
(共57篇)
题解 | SQL27#返回每个订单号各有多少行数#
分析 关键词:group by ---分组统计 代码 select order_num,count(order_num) as order_lines from OrderItems group by order_num order by order_lines
Mysql
2022-03-04
0
534
题解 | SQL26#确定 Products 表中价格不超过 10 美元的最贵产品的价格#
分析 关键词:max 用法: 最大值---max() 最小值---min() 平均值---avg() 总值 ---sum() 总数 ---count() 代码 select max(prod_price) as max_price from Products where prod_price&l...
Mysql
2022-03-04
29
2035
题解 | SQL25#确定已售出产品项 BR01 的总数#
分析 关键词:sum--汇总和函数 代码 select sum(quantity) as items_ordered from OrderItems where prod_id='BR01'
Mysql
2022-03-04
0
407
题解 | SQL24#确定已售出产品的总数#
分析 关键词:sum--汇总和函数 代码 select sum(quantity) as items_ordered from OrderItems
Mysql
2022-03-04
3
762
题解 | SQL23#返回 2020 年 1 月的所有订单的订单号和订单日期#
分析 关键词:date_format 用法: 返回日期的一部分---date_format(日期,'%Y%m%d) 代码 select order_num,order_date from Orders where date_format(order_date,'%Y-%m')='2020-01'...
Mysql
2022-03-04
34
1585
题解 | SQL22#顾客登录名#
分析 关键词:substing,concat,upper 用法: 字符串的截取:substring(字符串,起始位置,截取字符数) 字符串的拼接:concat(字符串1,字符串2,字符串3,...) 字母大写:upper(字符串) 代码 select cust_id,cust_name, upp...
Mysql
2022-03-04
236
4222
题解 | SQL21#打折#
分析 关键词:别名---as 用法:[列名] as [新列名] 代码 select prod_id,prod_price, prod_price*0.9 as sale_price from Products
Mysql
2022-03-04
0
645
题解 | SQL20#别名#
分析 关键词:别名---as 用法:[列名] as [新列名] 代码 select vend_id,vend_name as vname,vend_address as vaddress,vend_city as vcity from Vendors order by vname
Mysql
2022-03-04
1
675
题解 | SQL19#检索产品名称和描述(四)#
分析 关键词:like 用法:[字符] like '%_[]字符' %表示任何字符出现任意次数 _表示单个字符 []表示一个字符集 代码 select prod_name,prod_desc from Products where prod_desc like '%toy%carrots%'
Mysql
2022-03-04
1
504
题解 | SQL18#检索产品名称和描述(三)#
分析 关键词:like 用法:[字符] like '%_[]字符' %表示任何字符出现任意次数 _表示单个字符 []表示一个字符集 代码 select prod_name,prod_desc from Products where prod_desc like '%toy%' and prod_...
Mysql
2022-03-04
19
932
首页
上一页
1
2
3
4
5
6
下一页
末页