Master_zx
Master_zx
全部文章
分类
题解(16)
归档
标签
去牛客网
登录
/
注册
Master_zx的博客
全部文章
(共87篇)
题解 | #返回 2020 年 1 月的订单号和订单日期#
本题要点主要是日期提取函数,给定日期提取年月日时分别采用Year()、Month()、Day()函数 select order_num,order_date from Orders where Year(order_date) = 20...
Mysql
2022-09-02
0
223
题解 | #顾客登录名#
本题要点如下:1.字符串的截取:本题我采用的left函数;2.字符串拼接函数concat;3.小写字母转大写字母UPPER select cust_id,cust_name,upper(concat(left(cust_contact,2),left(cust_city,3)))&nb...
Mysql
2022-09-02
0
435
题解 | #打折#
这一题思路就比较简单,主要是将已有的 prod_price 生成 sale_price,具体代码如下: select prod_id,prod_price,prod_price*0.9 sale_price from Products
Mysql
2022-09-02
0
295
题解 | #别名#
修改变量名即在查询结果时将新变量名赋值在原变量名之后: select vend_id,vend_name vname,vend_address vaddress,vend_city vcity from Vendors order&nb...
Mysql
2022-09-02
0
319
题解 | #检索产品名称和描述(四)#
本题思路题目已经给出了思路:使用三个"%"以及like,由此可得如下代码: select prod_name,prod_desc from Products where prod_desc like "%toy%carrots%"
Mysql
2022-09-02
0
278
题解 | #检索产品名称和描述(三)#
本题思路较为清晰,要使prod_desc中同时包含"toy","carrots",题目又提示使用两个like 和 and,那么代码就较为好写 select prod_name,prod_desc from Products where prod_desc&...
Mysql
2022-09-02
1
242
题解 | #检索产品名称和描述(二)#
# 本题的思路与上题恰恰相反,因此解题的思路几乎一样,同样可以采用三种方式 # 1.locate函数:Locate(str,sub) > 0,表示sub字符串包含str字符串;Locate(str,sub) = 0,表示sub字符串不包含str字符串。 select prod_nam...
Mysql
2022-09-02
118
570
题解 | #纠错2#
本题意在考察MySQL的执行顺序,where 在 order前执行 select vend_name from Vendors where vend_country = 'USA' and vend_state ...
Mysql
2022-08-31
12
347
题解 | #返回所有价格在3到6美元之间的产品的名称和价格#
select prod_name,prod_price from Products where prod_price between 3 and 6 // 常见的范围设置是使用数学符号,但题目要求使用and连接,则需要考...
Mysql
2022-08-31
0
349
题解 | #检索并列出已订购产品的清单#
select order_num,prod_id,quantity from OrderItems // 选择需要查询的对象 where quantity >= 100 and prod_id in&n...
Mysql
2022-08-31
0
268
首页
上一页
1
2
3
4
5
6
7
8
9
下一页
末页