Lisa跳跃
Lisa跳跃
全部文章
分类
归档
标签
去牛客网
登录
/
注册
Lisa跳跃的博客
全部文章
(共10篇)
题解 | #返回产品名称和每一项产品的总订单数#
select Products.prod_name ,count(OrderItems.order_num) from OrderItems right join Products on OrderItems.prod_id = Products.prod_id group by Product...
2024-02-24
0
139
题解 | #确定最佳顾客的另一种方式(二)#
select Customers.cust_name ,sum(OrderItems.item_price*OrderItems.quantity)as sumcount from Customers join Orders on Customers.cust_id = Orders.cust_i...
2024-02-24
0
131
题解 | #返回顾客名称和相关订单号以及每个订单的总价#
select Customers.cust_name , OrderItems.order_num, sum(OrderItems.quantity*OrderItems.item_price) from OrderItems join Orders on OrderItems.order_nu...
2024-02-24
0
198
题解 |子查询,多表
#where查询 select o1.cust_id,o1.order_date from Orders as o1 ,OrderItems as o2 where o2.prod_id ="BR01" and o1.order_num = o2.order_num order ...
2024-02-24
0
156
题解 | #打折#
select prod_id, prod_price, round(prod_price * 0.9,3) as sale_price from Products 1、如果要控制小数点:round(prod_price * 0.9,3)3代表小数点后几位2、 as ...
2024-02-24
0
140
题解 | #质数因子#math.sqrt,while和if
import sys import math n = int(input()) for i in range(2, int(math.sqrt(n))+1): while n % i == 0: print(i,end=' ') n = n // i if ...
2024-02-24
0
169
题解 | #进制转换#int(s,16),int(s,8)
import sys """ python将16进制转为10进制可以用int('hex型',16) 八进制转十进制int('八进制型',8) 八进制或十六进制或10进制装二进制直接调用 bin(任意进制) """ while True:...
2024-02-24
0
199
题解 | #字符串分隔# 切片,递归,填充函数ljust
import sys def splitStr(strs): if len(strs) >= 8: print(strs[0:8]) splitStr(strs[8:]) elif len(strs) != 0: print(s...
2024-02-24
0
161
题解 | #明明的随机数#
import sys n = input() num1 = int(n) lst = [] for i in range(0,num1): number = int(input()) lst.append(number) # #方法1 # lst = set(lst) # lst...
2024-02-24
0
155
题解 | #检索并列出已订购产品的清单#
select distinct prod_id from OrderItems; distinct 是对选中的列表去重。可针对多行去重。
2024-01-14
0
142