1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
topjm [15]
3 years ago
9

Write a SELECT statement that returns these column names and data from the Products table: product_name The product_name column

list_price The list_price column discount_percent The discount_percent column discount_amount A column that’s calculated from the previous two columns discount_price A column that’s calculated from the previous three columns Round the discount_amount and discount_price columns to 2 decimal places. Sort the result set by the discount_price column in descending sequence. Use the LIMIT clause so the result set contains only the first 5 rows.
Engineering
1 answer:
I am Lyosha [343]3 years ago
5 0

Answer:

 SELECT  

   product_name, list_price, discount_percent,    

   ROUND(list_price * (discount_percent / 100), 2) AS discount_amount,

   ROUND(list_price - (discount_percent / 100 * list_price), 2)  AS discount_price  

FROM

Products

ORDER BY (list_price - (discount_percent / 100 * list_price)) DESC

LIMIT 5;

Explanation:

In the above SELECT statement is used to select columns from Products table.

The columns are  product_name,list_price and discount_percent

Next a column discount_amount is selected which is the calculated from previous two columns that are list_price and discount_percent. The discount amount is basically calculated by multiplying list_price with discount_percent/100 and the resultant column is named as discount_amount using Alias which is used to give a temporary name to set of columns or a table.

Next another column discount_price is obtained from previous three columns that are  list_price , discount_percent and discount_amount as: list_price - (discount_percent / 100 * list_price) This as a whole is given a column name discount_price.

FROM is used to refer to a table from which these columns are to be selected. The table name is Product.

The result set is sorted in descending order by discount_price so ORDER BY is used to order the resultant records and DESC is used to sort these records according to the discount_price in descending order.

LIMIT statement is used to extract the records from Product and limit the number of rows returned as a result based on a limit value which is 5 here.

You might be interested in
A video inspection snake is use
LekaFEV [45]

Answer:

very good thx

Explanation:

5 0
2 years ago
Which of the following is a possible consequence of poor measurement in construction as stated in the segment?
Kamila [148]

Answer:

Decreased risk of structure failure

6 0
2 years ago
All of these are true about GMA (MIG) welding EXCEPT that:
Hatshy [7]

Answer:

the welding gun liner regulates the shielding gas.

Explanation:

The purpose of the welding gun liner is to properly position the welding wire from the wire feeder till it gets to the nozzle or contact tip of the gun. <em>Regulation of the shielding gas depends on factors such as the speed, current, and type of gas being used. </em>In gas metal arc welding, an electric arc is used to generate heat which melts both the electrode and the workpiece or base metal.

The electric arc produced is shielded from contamination by the shielding gas. The heat generated by the short electric arc is low.

3 0
2 years ago
What happens when the arms of the milky move away from the center of the galaxy
Alina [70]
Well this question is though because we have never seen such a thing ! and to be quite frank when that happens , nothing good comes from it. Black Holes
6 0
3 years ago
What phenomenon allows water to reach the top of a building?
Artemon [7]

Answer:

Option C: water pressure.

Explanation:

Water pressure allows water to reach the top of a building.

6 0
3 years ago
Other questions:
  • A food-services company with a 480 V, three-phase service entrance has the following set of loads:  A 7 ton walk-in refrigerati
    13·1 answer
  • You are comparing distillation column designs at 1 atm and 3 atm total pressure for a particular separation. You have the same f
    5·1 answer
  • Estudio de caso Teorema de Bayes. Las historias de casos clínicos indican que diversas enfermedades producen sistemas similares.
    14·1 answer
  • In addition to bandages and gauze, it's recommended that a first aid kit also contain ___________. A) A finger splintB) Portable
    9·1 answer
  • Help me! Phone Phoebe on 07375410044.
    7·2 answers
  • Its an opinion!!!!
    8·1 answer
  • What steps might one take to make a decision or solve a problem
    10·2 answers
  • What's a disadvantage of highest MERV-rated filters?
    10·2 answers
  • The 40-ft-long A-36 steel rails on a train track are laid with a small gap between them to allow for thermal expansion. Determin
    8·1 answer
  • ما جمع كلمة القوة؟help please
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!