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
Alekssandra [29.7K]
3 years ago
14

Write a SELECT statement that returns these column names and data from the Order_Items table:

Computers and Technology
1 answer:
valentina_108 [34]3 years ago
7 0

Answer:

SELECT

item_ID, item_price,

discount_amount, quantity,

item_price * quantity AS price_total,

discount_amount * quantity AS discount_total,

(item_price - discount_amount) * quantity AS item_total

FROM Order_Items

WHERE (item_price - discount_amount) * quantity > 500

ORDER BY item_total DESC;

Explanation:

SELECT statement is used to select  set of records data or from one or more tables.

So here SELECT statement selects data from the following columns:

item_ID

item_price

discount_amount

quantity

item_price * quantity AS price_total,

Here AS is used and it refers to alias which gives a name to a column or table. This name is temporary. Here the column which is the product of two columns item_price and quantity is given the name of price_total.

discount_amount

this is the product of discount_amount and quantity columns.

item_total

this column is obtained by subtracting the discount_amount from the item_price and then multiplying by the quantity.

These columns are selected from table named Order_Items using SELECT statement.

WHERE clause is used here to put a condition in order to filter the data. It allows to retrieve only those records which satisfies the condition given in this clause. Here only those records are fetched where the item_total is greater than 500. item_total is calculated by

(item_price - discount_amount) * quantity

ORDER BY specifies that the resultant records will be arranged in the specified order. Here DESC keyword is used to sort the resultant data in descending order. So the data will be returned in descending order.

You might be interested in
2. Kabel yang digunakan pada jangan wireline, sebagai
Mumz [18]
It’s b ........................................
7 0
3 years ago
Find the gear ratio of the gear in the picture. <br><br> 25 points+brainliest
ankoles [38]

The gear ratios would look like A:B=1:9 and C:D=1:32 if you are just needing the gear teeth ratio. Not a lot of information to go off of from the question though

8 0
3 years ago
Write a loop that subtracts 1 from each element in lowerScores. If the element was already 0 or negative, assign 0 to the elemen
Verdich [7]

Answer:

Replace <STUDENT CODE> with

for (i = 0; i < SCORES_SIZE; ++i) {

       if(lowerScores.at(i)<=0){

           lowerScores.at(i) = 0;

       }

       else{

           lowerScores.at(i) = lowerScores.at(i) - 1;

       }  

   }

Explanation:

To do this, we simply iterate through the vector.

For each item in the vector, we run a check if it is less than 1 (i.e. 0 or negative).

If yes, the vector item is set to 0

If otherwise, 1 is subtracted from that vector item

This line iterates through the vector

for (i = 0; i < SCORES_SIZE; ++i) {

This checks if vector item is less than 1

       if(lowerScores.at(i)<1){

If yes, the vector item is set to 0

           lowerScores.at(i) = 0;

       }

       else{

If otherwise, 1 is subtracted from the vector item

           lowerScores.at(i) = lowerScores.at(i) - 1;

       }  

   }

Also, include the following at the beginning of the program:

<em>#include <vector></em>

8 0
3 years ago
What is the depth of the following tree?
atroni [7]

Answer:

the answer for the question is D.

4 0
2 years ago
What year did bill gates form traf-o-data?
alexgriva [62]

In 1972 Bill Gates formed Traf-O-Data.

8 0
3 years ago
Other questions:
  • When you make taffy (a pliable candy), you must heat the candy mixture to 270 degrees Fahrenheit. Write a program that will help
    6·1 answer
  • A type TW cable containing two No. 12 copper conductors has a maximum overcurrent protection of
    7·2 answers
  • A company decides to reduce its IT labor force by hiring an external company to manage various aspects of IT administration, suc
    6·1 answer
  • Which should you use to find a saved file?
    15·2 answers
  • ________ gives its approval to U.S. e-commerce websites that follow strict privacy standards, such as explaining to visitors how
    6·1 answer
  • When might be the best time to start saving for retirement?
    11·2 answers
  • the technique of blocking some parts of a photograph to emphasize (or draw attention to) another part of the same photograph is
    8·1 answer
  • Huh? translate this please. (jk, I know what it says I just want to test everyone.)
    13·1 answer
  • 1. Write a 400-500 word research report about Burke High School.
    6·1 answer
  • Read the following scenario. How might Sarah correct successfully complete her task?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!