147k views
4 votes
Write the following queries in SQL..

#prods whose name begins with a 'p' and are less than $300.00.

User Logan H
by
7.4k points

1 Answer

2 votes

Final answer:

To select products whose name begins with a 'p' and are less than $300.00 in SQL, use the LIKE keyword with the pattern 'p%' in the WHERE clause.

Step-by-step explanation:

To write a query in SQL to select products whose name begins with a 'p' and are less than $300.00, you can use the following statement:

SELECT * FROM products WHERE name LIKE 'p%' AND price < 300.00;

This query uses the LIKE keyword to match the name column with the pattern 'p%', where '%' represents any number of characters after the 'p'.

User Benoit Marilleau
by
7.6k points