"SQL Query to Find Products with Prices Between $10 and $20"

This technical problem involves writing a SQL query to find products with prices between $10 and $20 from a given table. An example input and output is provided.

Problem

Given a table of products with columns for id, name, and price, write a SQL query to find the products with prices between $10 and $20.
Example input:
id | name | price
1 | product1 | 15
2 | product2 | 10
3 | product3 | 20
Example output:
id | name | price
1 | product1 | 15
2 | product2 | 10

Solution

This solution is in SQL. Our A.I. can create solutions in multiple languages.
by sarastevens
SELECT * FROM products WHERE price BETWEEN 10 AND 20;

/*

The BETWEEN operator is used to filter the result set within a certain range. The values can be numbers, text or dates.

*/

A.I. Evaluation of the Solution

The candidate's solution is complete and solves the problem. The approach is straightforward and uses the BETWEEN operator to filter the result set.

Evaluated at: 2022-11-10 10:15:15