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
Which option identifies why Ethan’s skills are valuable to his team in the following scenario?
larisa [96]

Answer:

Explanation:

The options are:

- In an isometric drawing, multiple angles and axes can be shown in one sketch.

- There is no room for detail in an isometric drawing, so the detail is shown in the orthographic projection.

- Only one sketch will be needed since all other previous designs will no longer be necessary.

- Computer programs will not be necessary to create the exact dimensions of the design.

Orthographic projections are in either the First or Third Angles but the angles are fixed and do not provide perspective view.  Isometric drawings are perspective views from different angles.

So Ethan's skill is valuable because "In an isometric drawing, multiple angles and axes can be shown in one sketch."

4 0
3 years ago
Add the following vector given in rectangular form and illustrated the process graphically A = 16+j12, B= 6+j10.4
MariettaO [177]

Answer:

A=16+j12…'B=6+j10.4

Explanation:

add the following vector given in

3 0
1 year ago
Which option distinguishes the members of a software deployment process team most likely involved in the following scenario?
Alchen [17]

Answer:

A local bank, with several branches in three cities, requests changes to its mortgage calculation software.

5 0
3 years ago
A fair die is thrown, What is the probability gained if you are told that 4 will
Semmy [17]

Answer:

1/6

Explanation:

A dice has 6 sides, the probability of 4 appearing is 1/6.

7 0
2 years ago
If angle A is a complement of angle B, angle B and angle C are vertical angles, and the supplement of C has a measure of 140°. F
Over [174]

Answer:

50°

Explanation:

Complementary angles add up to 90°.

Supplementary angles add up to 180°.

Vertical angles are equal.

A + B = 90°

B = C

C = 180° − 140°

C = 40°

B = 40°

A = 50°

7 0
3 years ago
Other questions:
  • How much work does the electric field do in moving a proton from a point with a potential of +V1 = +185 V to a point where it is
    15·1 answer
  • A heat engine does 210 J of work per cycle while exhausting 440 J of waste heat. Part A What is the engine's thermal efficiency?
    6·1 answer
  • The assembly consists of two blocks A and B, which have a mass of 20 kg and 30 kg, respectively. Determine the distance B must d
    14·2 answers
  • Air at 2.5 bar, 400 K is extracted from a main jet engine compressor for cabin cooling. The extracted air enters a heat exchange
    14·2 answers
  • At the inlet to the combustor of a supersonic combustion ramjet (or scramjet), the flow Mach number is supersonic. For a fuel-ai
    12·1 answer
  • How to solve circuit theory using mesh analysis<br>​
    11·1 answer
  • By using a book of the OHS Act, Act 85 of 1993, find the act or regulation where the following extraction comes from "every empl
    12·1 answer
  • A wing generates a lift L when moving through sea-level air with a velocity U. How fast must the wing move through the air at an
    7·1 answer
  • PLEASE HELP WITH THIS ASAP! Thanks
    6·1 answer
  • What is valve overlap?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!