Find the products with the highest price.

Write a SQL query to find the products with the highest price from a given table.

Problem

Given a table of products, write a SQL query to find the products with the highest price.
Example input:
| product_id | name       | price |
|------------|------------|-------|
| 1          | Product A  | 10.00 |
| 2          | Product B  | 20.00 |
| 3          | Product C  | 30.00 |
Example output:
| product_id | name       | price |
|------------|------------|-------|
| 3          | Product C  | 30.00 |

Solution

This solution is in SQL. Our A.I. can create solutions in multiple languages.
by WizardSql
Select TOP (1) * FROM products
ORDER BY price desc

A.I. Evaluation of the Solution

The candidate's solution is correct and solves the problem. The approach is straightforward and easy to understand.

Evaluated at: 2022-10-27 06:16:14