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]
4 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]4 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 distribution center is used in which of the following applications?
FrozenT [24]

both b and c are the right

5 0
3 years ago
Name the seven physical qualities for which standards have been developed.
SIZIF [17.4K]

Answer:

HUMAN DEVELOPMENT

MOTOR BEHAVIOR

EXERCISE SCIENCE

MEASUREMENT AND EVALUATION

HISTORY AND PHILOSOPHY

UNIQUE ATTRIBUTES OF LEARNERS

CURRICULUM THEORY AND DEVELOPMENT

Explanation:

6 0
4 years ago
Sk the first 3D printed house
quester [9]
2,000 the answer __________im Shayla_________I like food _________do you________the crunch for me_______km not fat tho______are u no worrys________is u are u still pretty
8 0
3 years ago
Design a fundamental mode asynchronous finite state machine that accepts input pair, A and B. The AB input sequence 00, 01,11, 1
dybincka [34]

Answer:

See explaination

Explanation:

A Finite state machines can be synchronous or asynchronous. The operation of asynchronous state machines does not require a clock signal. An Asynchronous state machine is classified basically on their operating mode, such as the fundamental mode, pulse mode or burst mode. An asynchronous state machine can have stable and transient states.

Please kindly refer to attachment for a step by step solution.

5 0
3 years ago
1. A four-lane freeway (two lanes in each direction) is located on rolling terrain and has 12-ft lanes, no lateral obstructions
otez555 [7]

Answer:

Maximum number of vehicle = 308

Explanation:

See the attached file for the calculation.

6 0
4 years ago
Other questions:
  • 5. Assume that you and your best friend ench have $1000 to invest. You invest your money
    8·1 answer
  • It is not a practical proposition to take direct measurements in nanoscale, but we can estimate variations in position and momen
    15·1 answer
  • What is the magnitude of the maximum stress that exists at the tip of an internal crack having a radius of curvature of 2.5×10-4
    13·1 answer
  • A liquid's viscosity increases with increasing temperature. a)-True b)-False
    6·1 answer
  • 214Bi83 --> 214Po84 + eBismuth-214 undergoes first-order radioactive decay to polonium-214 by the release of a beta particle,
    15·2 answers
  • Which metal is used in planes.
    5·2 answers
  • PLEASE HELP!!! ILL GIVE BRANLIEST *EXTRA POINTS* dont skip :((
    11·2 answers
  • This is hard please help me you will give brainlist
    5·2 answers
  • Which of the following describes what a manufacturing engineer does
    9·2 answers
  • What are the best collages for architectural learning?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!