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]
4 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]4 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. Suppose you want to write a method that prints a heading on a new output page, along with a page number that is 1 in the firs
Ilia_Sergeevich [38]

Answer:

This can be done in both Java and C#, using a static (or class) data member for the page number.

Explanation:

7 0
3 years ago
How to recover permanently deleted files from drive
HACTEHA [7]
Go into your trash bin in your computer.
7 0
3 years ago
In the game of economics, producers look to technological improvements to increase which of the following?
Vaselesa [24]
They're looking to increase productivity 
7 0
3 years ago
Read 2 more answers
Why doesn't the ad load ?
baherus [9]
Try refreshing the page, if not restart your device check your internet etc.
3 0
2 years ago
Read 2 more answers
Where can the container code be found in Google Tag Manager? (select all answers that apply) a. In a pop-up window after you cre
saveliy_v [14]

Answer:

Option A and C.

Explanation:

The container code can be located in Google Tag Manager inside a pop-up window when they set up an account as well as container and Under "Admin" through choosing that container and clicking Installing Google Tag Manager.

The main advantage for Google Tag Manager, ever though, would be that it create it in much easier manner for marketing companies to execute identifiers without depends on developers to use it. Developers tend to also be preoccupied with some other high-priority initiatives so tagging mostly finishes up on the other side burner

7 0
3 years ago
Other questions:
  • Bob's Assembly is a hardware manufacturer. It specializes in builders' hardware for doors, cabinets, windows, and bathrooms. Bob
    10·1 answer
  • The Internet and World Wide Web allow almost any business to be global. What are two important results of this process?
    8·1 answer
  • The amount of ram that is actually on the memory modules in your computer is the ________ memory.
    11·1 answer
  • How to share pictures on brainy ​
    8·1 answer
  • What is the georgia connections academy administrative password? i want to install something.
    5·1 answer
  • 11. You tried to turn on your desktop computer, but your desktop computer would not even turn on. You pressed the power button,
    8·1 answer
  • 20. Describe the steps that transform a program written in a high-level language such as C into a representation that is directl
    9·1 answer
  • How many times is the body of the loop executed?
    8·1 answer
  • THE DIFFERENCE BETWEEN COPY AND PASTE AND CUT AND PASTE IS: *
    5·2 answers
  • A social service agency hires accenture to improve training and experiences for caseworkers. What is one way accenture can use v
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!