Skip to content

practise-select-sql#171

Open
DieselNiu wants to merge 1 commit into
masterfrom
111
Open

practise-select-sql#171
DieselNiu wants to merge 1 commit into
masterfrom
111

Conversation

@DieselNiu

Copy link
Copy Markdown
Contributor
  • 这个PR解答了当前仓库中的题目(机器人会自动判题并合并当前PR)
  • 这个PR修复了当前仓库中的一些代码缺陷(机器人不会判题,而是由管理员来处理当前PR)

@hcsp-bot

Copy link
Copy Markdown
Contributor

🎉 感谢提交Pull Request!请稍等片刻,我们已经将其提交到CI进行检查,一旦有结果会立即通知您!
不过,我们发现你在这个仓库中还打开了其他的Pull Request:

#169
#170
#168

我们不鼓励同时打开多个Pull Request,请集中精力于现在的这个Pull Request,谢谢!:pray:

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.*;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不应使用 '.*' 形式的导入 - java.sql.* 。

// +----+--------+------+
public static List<GoodsAndGmv> getGoodsAndGmv(Connection databaseConnection) throws SQLException {
return null;
try (PreparedStatement preparedStatement = databaseConnection.prepareStatement("select goods.id as id,name,sum(goods_num*goods_price) as gmv from goods\n" +

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'+' 应另起一行。

public static List<GoodsAndGmv> getGoodsAndGmv(Connection databaseConnection) throws SQLException {
return null;
try (PreparedStatement preparedStatement = databaseConnection.prepareStatement("select goods.id as id,name,sum(goods_num*goods_price) as gmv from goods\n" +
"join `order`\n" +

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'+' 应另起一行。

return null;
try (PreparedStatement preparedStatement = databaseConnection.prepareStatement("select goods.id as id,name,sum(goods_num*goods_price) as gmv from goods\n" +
"join `order`\n" +
"on goods.id = `order`.goods_id\n" +

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'+' 应另起一行。

try (PreparedStatement preparedStatement = databaseConnection.prepareStatement("select goods.id as id,name,sum(goods_num*goods_price) as gmv from goods\n" +
"join `order`\n" +
"on goods.id = `order`.goods_id\n" +
"group by goods.id\n" +

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'+' 应另起一行。

try (PreparedStatement preparedStatement = databaseConnection.prepareStatement("select `order`.id,user.name,goods.name,goods_price * goods_num as total_price from `order`\n" +
"join goods\n" +
"on goods.id = `order`.goods_id\n" +
"join user\n" +

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'+' 应另起一行。

// +----------+-----------+------------+-------------+
public static List<Order> getLeftJoinOrders(Connection databaseConnection) throws SQLException {
return null;
try (PreparedStatement preparedStatement = databaseConnection.prepareStatement("select `order`.id,user.name,goods.name,goods_price * goods_num as total_price from `order`\n" +

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'+' 应另起一行。

public static List<Order> getLeftJoinOrders(Connection databaseConnection) throws SQLException {
return null;
try (PreparedStatement preparedStatement = databaseConnection.prepareStatement("select `order`.id,user.name,goods.name,goods_price * goods_num as total_price from `order`\n" +
"left join goods\n" +

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'+' 应另起一行。

return null;
try (PreparedStatement preparedStatement = databaseConnection.prepareStatement("select `order`.id,user.name,goods.name,goods_price * goods_num as total_price from `order`\n" +
"left join goods\n" +
"on goods.id = `order`.goods_id\n" +

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'+' 应另起一行。

try (PreparedStatement preparedStatement = databaseConnection.prepareStatement("select `order`.id,user.name,goods.name,goods_price * goods_num as total_price from `order`\n" +
"left join goods\n" +
"on goods.id = `order`.goods_id\n" +
"left join user\n" +

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'+' 应另起一行。

@hcsp-bot

Copy link
Copy Markdown
Contributor

你的提交 f7d68b1 ,似乎失败了:Your tests failed on CircleCI

😅 请不要气馁,仔细分析原因,再接再厉!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants