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
Why are agorithms important?
Dafna11 [192]

They sort out patterns.

They find numbers that cannot be found any other way.

They repeat the task a thousand times and never get tired of doing it. They will keep doing that until some condition is met.

7 0
4 years ago
Suppose that you have created a program with only the following variables.int age = 34;int weight = 180;double height = 5.9;Supp
Yuri [45]

Answer:

a. calculate(age, weight); // This is legal

b. calculate(age, height); // This is legal

c. calculate(weight, height); // This is legal

d. calculate(height, age); // This is not legal

e. calculate(45.5, 120); // This is not legal

f. calculate(12, 120.2); // This is legal

g. calculate(age, size); // This is not legal

h. calculate(2, 3); // This is legal

i. calculate(age); // This is not legal

j. calculate(weight, weight); // This is legal

Explanation:

a. This is legal because the argument passed are two in numbers and they are integers but the integer for the second parameter can be cast to double.

b. This is legal because the method requires two parameter and two are passed. The method requires integer and double. The passed parameter are integer and double.

c. This is legal because the method requires two parameter and two are passed. The method requires integer and double. The passed parameter are integer and double.

d. This is not legal because even though two parameters were passed. The first one should be int but double was supplied and double cannot be downgraded to int. There is a possible lossy conversion from double to int.

e. This is not legal because even though two parameters were passed. The first one should be int but double was supplied and double cannot be downgraded to int. There is a possible lossy conversion from double to int.

f. This is legal because the method requires two parameter and two are passed. The method requires integer and double. The passed parameter are integer and double.

g. This is not legal because even though two parameters were passed. The first one should be int but the second parameter is not defined before been passed to the calculate method.

h. This is legal because the argument passed are two in numbers and they are integers but the integer for the second parameter can be cast to double.

i. This is not legal because only one parameter was passed instead of two.

j. This is legal because the argument passed are two in numbers and they are integers but the integer for the second parameter can be cast to double.

3 0
3 years ago
recursive function that accepts a stack of integers as a parameter and replaces every even value in the stack with two occurrenc
slega [8]

The solution is to keep all values in the Function Call Stack until the stack is empty. When the stack is empty, place all held items at the bottom of the stack one by one.

What is Recursive Function?

Recursive functions in code frequently rely on loop setups, in which the initial variable is called on multiple times while the loop is changing it. The factorial is a simple example of a recursive function in which an integer is multiplied by itself while being incrementally lowered. Many other self-referencing functions in a loop, for example, where n = n + 1 given an operating range, could be called recursive functions.

In addition to simpler recursive functions, programmers and others have created much more complex functions that also use recursion principles. Some, such as the Fibonacci sequence, have applications in finance and other fields, while others are esoteric and largely restricted to the IT community.

To learn more about Recursive Function, visit: brainly.com/question/28540529

#SPJ4

3 0
2 years ago
Who designed the apple i computer in 1976?
guajiro [1.7K]

Steve jobs designed the first apple computer


6 0
3 years ago
Read 2 more answers
____________ is the ability to stand up for your own interests and to ask for what you want. A. Discipline B. Arrogance C. Asser
devlian [24]
C. Assertiveness. Assertiveness is defined as confident and forceful behavior, so it is the only one that makes sense.
8 0
3 years ago
Read 2 more answers
Other questions:
  • Edhesive silly questionsj
    8·1 answer
  • Ron wants to install an energy efficient and long lasting device for lighting in his new home. Which device should he use?
    11·2 answers
  • On the Internet, you can use a(n)______to look for information on any topic, such as books, movies, scholarly articles, news, an
    6·2 answers
  • Software project management is the process planning, organizing, and monitoring of the development of a software project from it
    15·1 answer
  • What is the Best IPTV service provider in the USA?
    9·1 answer
  • Which of these is not a valid form<br>layout in Microsoft Access?​
    11·1 answer
  • an early type of GUI is created, which includes windows, pop-ups, icons, and menus. What year did this happen? Please help!!! qu
    12·1 answer
  • To input lenth in meter and convert in to centimeter​
    6·1 answer
  • A web application's code prevents the output of any type of information when an error occurs during a request. The development t
    12·1 answer
  • what is the reason for assigning the management of file sharing, security, and quotas to administrators . why would it be pruden
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!