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
Smartart and shapes are useful tools because they allow you to
charle [14.2K]
Organize data within a document..draw any shape you wants within a document... easily create manipulate shapes within a document. hope this helps
4 0
3 years ago
How many levels of full body protective clothing are there? A. Four B. Seven C. Six D. Two
Verdich [7]
The answer is A. Four
4 0
3 years ago
Read 2 more answers
Write a Python class that inputs a polynomial in standard algebraic notation and outputs the first derivative of that polynomial
Ivahew [28]

Answer:Python code: This will work for equations that have "+" symbol .If you want to change the code to work for "-" also then change the code accordingly. import re def readEquation(eq): terms = eq.s

Explanation:

3 0
2 years ago
Which of the following formats can algorithms NOT be written in:
Zina [86]
The answer is Flow chart
6 0
3 years ago
Siltstone is made mostly of _____.<br><br> A : silt<br> B : sand<br> C : shells<br> D : gravel
frez [133]
The best and most correct answer among the choices provided by the question is the second choice. <span>Siltstone is made mostly of silt. </span>I hope my answer has come to your help. God bless and have a nice day ahead!
6 0
3 years ago
Read 2 more answers
Other questions:
  • Write a program that accepts as input the mass, in grams, and density, in grams per cubic centimeters, and outputs the volume of
    14·1 answer
  • Write a program which can do a String Check if its Panagram or not!
    10·1 answer
  • Obtain a file name from the user, which will contain data pertaining to a 2D array Create a file for each of the following: aver
    5·1 answer
  • ​In addition to joint application development, another popular user-oriented method is _____, which resembles a condensed versio
    14·1 answer
  • All of the nested folders you created will carry the same permissions as the __________ until you make changes.
    10·1 answer
  • Write the definition of a method min that has two int parameters and returns the smaller.
    9·1 answer
  • A sequence of one or more characters is called
    14·1 answer
  • What is the effect of this program?
    5·1 answer
  • The use of Quick Styles is a great way to save
    15·1 answer
  • to provide for ecmascript compatibility in older browsers, you can use group of answer choices javascript shivs javascript shims
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!