JoKerhhh
JoKerhhh
全部文章
分类
归档
标签
去牛客网
登录
/
注册
JoKerhhh的博客
全部文章
(共34篇)
题解 | #修改表#
ALTER TABLE user_info add column school varchar(15) after level, #在level后新增列 change column job profession varchar(10), #把job改为profession modify column...
2024-01-22
0
141
题解 | #创建一张新表#
CREATE TABLE IF NOT EXISTS user_info_vip( id int primary key auto_increment comment '自增ID', uid int unique NOT NULL comment '用户ID', nick_n...
2024-01-22
0
137
题解 | #删除记录(二)#
delete from exam_record WHERE timestampdiff(MINUTE,start_time,submit_time) < 5 OR submit_time is NULL ORDER BY start_time LIMIT 3; 时间差:TIMESTAMPDI...
2024-01-22
0
146
题解 | #列出供应商及其可供产品的数量#
SELECT vd.vend_id, COALESCE(COUNT(prod_id),0) AS prod_id FROM Vendors AS vd LEFT JOIN Products AS p ON vd.vend_id = p.vend_id GROUP BY vend_id ORDER ...
2024-01-21
0
126
题解 | #确定最佳顾客的另一种方式(二)#
select ct.cust_name, SUM(ot.item_price * ot.quantity) AS total_price FROM OrderItems AS ot JOIN Orders AS od ON od.order_num = ot.order_num JOIN Custo...
2024-01-21
0
278
题解 prod_id 为 BR01 的产品顾客的电子邮件
select ct.cust_email FROM Customers AS ct JOIN Orders AS od ON od.cust_id = ct.cust_id JOIN OrderItems AS ot ON ot.order_num = od.order_num AND ot.pro...
2024-01-21
0
190
题解 | # prod_id 为 BR01 的产品
select cust_id, order_date FROM OrderItems AS ot JOIN Orders AS od ON ot.order_num = od.order_num AND ot.prod_id = 'BR01' ORDER BY order_date
2024-01-21
0
176
题解 | #返回顾客名称和相关订单号以及每个订单的总价#
select ct.cust_name, od.order_num, ot.quantity * ot.item_price AS OrderTotal FROM Customers AS ct JOIN Orders AS od ON ct.cust_id = od.cust_id JOIN O...
2024-01-21
0
124
题解 | #返回顾客名称和相关订单号#
select cust_name, ( select order_num FROM Orders AS b WHERE b.cust_id = a.cust_id ) order_num FROM Customers AS a ORDER BY cust_name,order_n...
2024-01-21
0
172
题解 | Products 表中检索所有的产品名称及数量
select prod_name, ( select SUM(quantity) FROM OrderItems AS a WHERE a.prod_id = b.prod_id ) AS quant_sold FROM Products AS b 描述 Products ...
2024-01-21
0
550
首页
上一页
1
2
3
4
下一页
末页