Question

In: Computer Science

List the product name and description of every product with a list price higher than $500...

List the product name and description of every product with a list price higher than $500 that has either the word “humbuck” or “fret” in the description. Use a regular expression to do this.


my guitar shop

Solutions

Expert Solution

The SQL query with regular expression can be given as follows

SELECT productname , description FROM myguitarshop WHERE listprice > '$500' AND ( description REGEXP [[:<:]] humback OR description REGEXP [[:<]] fret) ;

The above SQL query can show all the products from the table myguitarshop with product name and description with price above 500 dollars. And with the condition which the description should have words "humback" or "fret".

The explanation for each part of the query is as follows:

SELECT productname, description from myguitarshop

From syntax

SELECT columnname1, columnname2 from TABLE

This part of the query selects the two columns productname and description from the table myguitarshop.

WHERE listprice > '$500'

WHERE condition

It selects the contents from the table where the listprice mentioned in the table is above the value $100

AND ( )

The AND is a SQL query that is used to join or make more than one condition to work in the query. Here the AND is used to join the two part of the query

description REGEXP [[:<:]] humback OR description REGEXP [[:<:]] fret

This part of the query contains the regular expression

WHERE columnname REGEXP [[:<]] characters

The above part of query from this syntax used by REGEXP returns the contents where the description has the words humback or fret. The OR SQL operator is used to select the description with either of these words.


Related Solutions

A price floor (or a price support) is a government regulated price that is higher than...
A price floor (or a price support) is a government regulated price that is higher than the equilibrium price. This regulation is meant to help the supplier. Under what conditions (comment on the price elasticity of demand and supply) will this result in a net decrease of producer surplus?
Suppose that in a market the current price is P1, a price higher than the equilibrium...
Suppose that in a market the current price is P1, a price higher than the equilibrium price, Pe. Is this market in equilibrium or in a disequilibrium state? Please explain by answering the following questions. ( Word answers only ) 1. Is Qd=Qs, Qd>Qs or Qd<Qs at P1? Why? 2. Is there any excess (Xss) -- excess demand or excess supply in this market at P1? Why? 3. Will P1 stay the same or will there be a price adjustment?...
If the price is less than the average total cost but higher than the average variable...
If the price is less than the average total cost but higher than the average variable cost, then the firm is making a _________. a. loss and is making a negative contribution to fixed costs b. loss but will continue to produce in the short-run c. loss and will shut down in the short-run d. profit What two types of market scopes did Michael Porter use in developing his generic strategies model? Broad and narrow. Cost leadership and focus. Benefit...
(a) Explain the welfare impact of agricultural price supports if the support price is higher than...
(a) Explain the welfare impact of agricultural price supports if the support price is higher than the world (import) price, but the support price is below the price that would make the quantity demanded equal to the quantity supplied if there were no international trade in the commodity. (b) Explain the welfare impact of agricultural price supports if the support price is higher than the world (export) price, and the export price is above the price that would make the...
If a bond is currently trading for a price higher than par, then which of the...
If a bond is currently trading for a price higher than par, then which of the following must be true? Answer: The coupon rate is greater than its yield-to-maturity I have the answer, by why is this?
Under competitive competitions, why can a market price not be higher or lower than the price...
Under competitive competitions, why can a market price not be higher or lower than the price established by the free market forces of demand and supply?
If the present value of the forward price of 1 barrel of oil is higher than...
If the present value of the forward price of 1 barrel of oil is higher than today's price of oil, an arbitrageur should: If the present value of the forward price of 1 barrel of oil is higher than today's price of oil, an arbitrageur should: If the present value of the forward price of bushel of wheat is lower than today's price of wheat, an arbitrageur should: Short wheat in the spot market, and long in the forward market...
1. If price is higher than ATC then profits are: negative, positive, normal? a. If this...
1. If price is higher than ATC then profits are: negative, positive, normal? a. If this high price prevails then companies start to exit, enter or neither? b. If price equals ATC then profits are: negative, positive, normal? 2. If this equal price prevails then companies start to exit, enter or neither? a. If price is less than ATC then profits are: negative, positive, normal? b. If this low price prevails then companies start to exit, enter or neither? 3....
Every year, Super Bowl tickets are sold in the black market at a significantly higher price....
Every year, Super Bowl tickets are sold in the black market at a significantly higher price. This indicates, these tickets are priced below free market price resulting creating demand or shortage. Refer to the graph on shortage in Chapter 3 and explain the scalping of Super Bowl ticket with such a graph. You can use straight line demand and supply curves.
If we find a mutual fund with a higher Sharpe ratio than the S&P 500 Index...
If we find a mutual fund with a higher Sharpe ratio than the S&P 500 Index we should discard the CAPM. Agree or Disagree? Explain
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT