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
In order to be a Mechanical Engineer, you need to:
djyliett [7]

Answer:

3

Explanation:

it is compulsory to have a bachelor's degree

4 0
3 years ago
Read 2 more answers
typedef struct bitNode { int data; struct bitNode *left; struct bstNode *right; } bstNode; int solve(bstNode* root) { if (root =
Sergio039 [100]

Answer:

The ten numbers to be filled in the blanks are: 18, 7, 7, 11, 18, 36, 3, 8, 13, 50.

Explanation:

keeps on going to the left node until node->left == NULL;

now at Node 18;

left = right = 0; hence condition is not satisfied

18 is printed first.

the value 18 is returned .

Then we reach at 4;

from there we move to 7;

just like 18, similar things happen with 7 and 7 is printed, the value 7 is returned.

Now coming to Node 4,

left = 0, right = 7 ; hence the condition is satisfied & res = 7; 7 is printed.

For Node 16, left = 7 ; right = 11(but for this we visit 11 first and 11 is printed)

for 16; condition is satisfied; res = 7 + 11 = 18 ; 18 is printed

Now for 5; left = right = 18; the condition is satisfied; so res = 18 + 18 = 36; 36 is printed

Next we visit Node 3; 3 is printed & 3 is returned

Then Node 8 ; 8 is printed & 8 is returned

for Node 13; left = 3, right = 8 ; condition is not satisfied, 13 is printed.

For Node 50; left = 36 right = 13 ; condition is not satisfied hence 50 is printed.

So the order of printing is  18 7 7 11 18 36 3 8 13 50.

4 0
3 years ago
Fatigue failure occurs under the condition of (a) High elastic stress (b) High corrosivity (c) High stress fluctuations (d) High
Harlamova29_29 [7]

Answer:

Fatigue occurs under conditions of high elastic stress, high stress fluctuations and high rate of loading

Explanation:

 According to many definition of fatigue failure the fatigue occurs when in an especifyc point of the object there is involved many forces and tensions.

 That tensions needs to be big in magnitud, de variations of the efforts it has to be with a lot of amplitude and the loading in the object it has to be with a lot of number of cycles.

 If in the all of these three conditions are present the fatigue failure it would appear.

8 0
3 years ago
Whats the difference between GeForce GTX 1060 and Geforce GTX 3060? Is there any big changes to FPS and other settings?
ZanzabumX [31]

Answer:

uhhhhh, are you kidding? a GTX 3060 is far better than a 1060 ding dong

Explanation:

7 0
3 years ago
Read 2 more answers
The inlet and exhaust flow processes are not included in the analysis of the Otto cycle. How do these processes affect the Otto
lara31 [8.8K]

Answer:

Suction and exhaust processes do not affect the performance of Otto cycle.

Explanation:

Step1

Inlet and exhaust flow processes are not including in the Otto cycle because the effect and nature of both the process are same in opposite direction.

Step2

Inlet process or the suction process is the process of suction of working fluid inside the cylinder. The suction process is the constant pressure process. The exhaust process is the process of exhaust out at constant pressure.

Step3

The suction and exhaust process have same work and heat in opposite direction. So, net effect of suction and exhaust processes cancels out. The suction and exhaust processes are shown below in P-V diagram of Otto cycle:

Process 0-1 is suction process and process 1-0 is exhaust process.

7 0
3 years ago
Other questions:
  • ¿Por qué creen que la Ingeniería Metalúrgica es una carrera estratégica para el desarrollo de nuestro país?
    9·1 answer
  • why HF (hydrogen fluoride) has higher boiling temperature than HCl (hydrogen chloride), even thought HF has lower molecular weig
    8·1 answer
  • Part A What is the correct expression of the internal torque in segment AB? A shaft is fixed at A. A clockwise distributed torqu
    6·1 answer
  • Problem: design the following rectangular floor beam for a building.
    15·2 answers
  • Ball joints on a vehicle equipped with MacPherson struts are being inspected for wear. Which of the following would be the corre
    11·1 answer
  • Using the technique of bitwise ANDing, find the IP address of the network # (this could be a network or subnet) on which the mac
    14·1 answer
  • A coil having a resistance of 10 ohms and an inductance of 4 H is switched across a 20W dc source. Calculate (a) time required b
    9·1 answer
  • QUESTION<br> Which of the following would assembler do an ideal automated assembly line?
    8·1 answer
  • in the multiple pipe system shown below, which of the following is true concerning the linear system?.
    14·1 answer
  • The ratio between the modulating signal voltage and the carrier voltage is called?.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!