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
17
timofeeve [1]
A. The factor by which a machine multiplies a force
6 0
3 years ago
In digital communication technologies, what is an internal network also known as?
garri49 [273]
Intranet is a network that is internal and use internet technologies. It makes information of any company accessible to its employees and hence facilitates collaboration. Same methods can be used to get information, use resources, and update the data as that of the internet.
Hopefully this helped.
4 0
3 years ago
In one study the critical stress intensity factor for human bone was calculated to be 4.05 MN/m3/2. If the value of Y in Eq. (2.
Diano4ka-milaya [45]
Where is Eq.(28) ?? You should show it to find the result
6 0
3 years ago
Why do we study National studies
Gre4nikov [31]

Answer:

It’s so we can then understand other cultures and other ways that people do things or we can also be prepared for what a country that we have not been to yet is going to relatively be like. This can also help with vacation planning.

Explanation:

it can also help us understand different people from different cultures.

3 0
2 years ago
__________ affect(s) the amount of air conditioning required.
Grace [21]

Answer:

Option D

All the above

Explanation:

Depending with the number of occupants in a building, the number of air conditioners required can either be increased or reduced. For instance, if the building is to be a classroom of over 50 students, 1 air-conditioner can't serve effectively. Similarly, the activity of occupants also dictate the amount of air conditioners required since if it's a gym room where occupants exercise often then the air conditioners required is different from if the room was to serve as a  lounge. The appliances that also operate in a room require that air conditioners be installed as per the heat that may be generated by the appliances.

5 0
3 years ago
Other questions:
  • A curve with 0.3 m constant radius contains a bead that is moving on it such that its rotational velocity is 3t2 sec-1. If the b
    12·1 answer
  • 1- A square-wave inverter has a dc source of 96 V and an output frequency of 60 Hz. The load is a series RL load with R = 5 Ohm
    7·1 answer
  • Air in a rigid tank is initially at 320 K and 130 kPa. Heat is added until the final pressure is 438 kPa. What is the change in
    9·1 answer
  • What are example for mantle
    5·1 answer
  • Please help been stuck on this for a couple minutes
    5·1 answer
  • . H<br> Kijwhayhwbbwyhwbwbwgwwgbwbwhwh
    6·2 answers
  • In multi-grade oil what is W means?
    11·1 answer
  • Kyla has obtained a bachelor’s degree in electronics engineering. In her search for a job, she comes across an advertisement tha
    11·1 answer
  • Discuss importance of good communication system​
    8·1 answer
  • ceramics must be heated in order to harden the clay and make it durable. the equipment used to heat the clay
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!