bcxp
bcxp
全部文章
分类
题解(72)
归档
标签
去牛客网
登录
/
注册
bcxp的博客
TA的专栏
5篇文章
0人订阅
算法刷题笔记Java
5篇文章
437人学习
全部文章
(共154篇)
题解 | #列出供应商及其可供产品的数量#
select v.vend_id, count(p.prod_id) as prod_id from Vendors v left join Products p on v.vend_id = p.vend_id group by v.vend_id order by v.vend_id; 使用左外...
2024-03-26
0
198
题解 | #纠错4#
SELECT cust_name, cust_contact, cust_email FROM Customers Order BY cust_name; 直接使用一个select
2024-03-26
0
171
题解 | #组合 Products 表中的产品名称#
select prod_name from Products union all select cust_name as prod_name from Customers order by prod_name; 使用union all拼接两个查询结果
2024-03-26
0
160
题解 | #没有重复项数字的全排列#
import java.util.*; public class Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param num int整型一维数组 * @re...
2024-03-26
0
169
题解 | #将两个 SELECT 语句结合起来(二)#
select prod_id, quantity from OrderItems where quantity = 100 or prod_id like 'BNBG%' order by prod_id; 只使用一个select,但是是多条件,使用or连接
2024-03-22
0
142
题解 | #将两个 SELECT 语句结合起来(一)#
select prod_id, quantity from OrderItems where quantity = 100 union all select prod_id, quantity from OrderItems where prod_id like 'BNBG%' order by p...
2024-03-22
0
157
题解 | #返回产品名称和与之相关的订单号#
select p.prod_name, o.order_num from Products p left join OrderItems o on p.prod_id = o.prod_id order by p.prod_name; MySQL中的outer join分为left join、ri...
2024-03-21
0
174
题解 | #检索每个顾客的名称和所有的订单号(二)#
select c.cust_name, o.order_num from Customers c left join Orders o on c.cust_id = o.cust_id order by c.cust_name; 使用left join,保留左表所有数据,如果右表没有对应的数据则以N...
2024-03-21
0
139
题解 | #二叉树的后序遍历#
import java.util.*; /* * public class TreeNode { * int val = 0; * TreeNode left = null; * TreeNode right = null; * public TreeNode(int v...
2024-03-21
0
149
题解 | #二叉树的中序遍历#
import java.util.*; /* * public class TreeNode { * int val = 0; * TreeNode left = null; * TreeNode right = null; * public TreeNode(int v...
2024-03-21
0
183
首页
上一页
1
2
3
4
5
6
7
8
9
10
下一页
末页