给定 sales 与 cars_info 两张表,查询每个品牌的最高成交价(max price),请写 SQL。
Find the maximum selling price for each car brand (write SQL).
题目类型: 技术面试题
这是一道技术面试题,常见于澳洲IT公司面试中。
难度: medium
分类: Carsales Interview, SQL
标签: JOIN, MAX
目标公司: carsales
参考答案摘要
答案 思路:sales 与 cars_info 按 car_id 连接,然后按 brand 分组取 MAX(price)。注意价格字段可能是字符串,需要先转成数值。 参考 SQL SELECT c.brand, MAX(s.price) AS max_price FROM sales s JOIN cars_info c ON s.car_id = c.car_id GROUP BY c.bran...
本题提供 STAR 原则详细解答和技术解析,登录匠人学院学习中心即可查看完整答案。