Write a SQL query to find the products with the highest price from a given table.
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 |
Select TOP (1) * FROM products ORDER BY price desc
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