Question

In: Computer Science

Determine the extended price for each row in the alp_orderline table. Display Order_id, inv_id, and Extended...

  • Determine the extended price for each row in the alp_orderline table. Display Order_id, inv_id, and Extended Price

CREATE TABLE alp_orderline

(order_id int not null,

inv_id int not null,

order_price decimal(6,2) not null,

qty smallint not null,

primary key(order_id, inv_id));

  

INSERT into alp_orderline

VALUES(1, 1, 274.99, 1);

INSERT into alp_orderline

VALUES(1, 6, 32.95, 2);

INSERT into alp_orderline

VALUES(2, 10, 64.95, 1);

INSERT into alp_orderline

VALUES(3, 16, 15.99, 1);

INSERT into alp_orderline

VALUES(3, 18, 15.99, 1);

INSERT into alp_orderline

VALUES(4, 23, 199.95, 1);

INSERT into alp_orderline

VALUES(5, 21, 15.99, 2);

INSERT into alp_orderline

VALUES(5, 7, 32.95, 1);

INSERT into alp_orderline

VALUES(6, 10, 64.95, 1);

INSERT into alp_orderline

VALUES(6, 26, 209.95, 1);

  

Solutions

Expert Solution

Answer:

formula :

extended price = order_Unit_Price * order_Quantity * ( 1 - order_discount).

In our case we don't have a discount (discount = 0).

According to given table ,

query for extended price = select (order_price * qty * (1 - 0 ) ); = select ( order_price * qty );

final Query:

select Order_id,inv_id, (order_price * qty) as extended_price from alp_orderline;

here 'as' is used to naming column.

Query Output:


Related Solutions

The first row of the table below shows the number of individuals of each of three...
The first row of the table below shows the number of individuals of each of three genotypes in a given population in the summer of 2015. The second row shows the relative probability that each of these genotypes survives over the winter (the relative fitness based on survival). If you resurvey the population in the spring of 2016, how many SS individuals would you expect to find? Genotype TT TS SS Number of individuals (Fall) 582 400 1645 Probability of...
Write the DML code to add the first row of each table to the database.
Write the DML code to add the first row of each table to the database.
Create a 15 row and 4 column table with each column of the data so that...
Create a 15 row and 4 column table with each column of the data so that it goes 1A 1B 1C 1D across using this code as a base void PrintSeatingChart(seat seats[15][4], int numRows, int numColumns) {    int i;    int j;    for (i = 0; i < numRows; i++) {        cout << i + 1 << " ";        for (j = 0; j < numColumns; j++) {            cout << seats[i][j].seatLetter...
La Extended, S.A. sold specialized equipment at a price of $ 900,000 each, with a unit...
La Extended, S.A. sold specialized equipment at a price of $ 900,000 each, with a unit cost of $ 400,000. On March 1, 2020, it sold 2 pieces of equipment on credit that include a one-year warranty for defects in their components, with the commitment to replace those that present failures. It is estimated that $ 120,000 could be claimed for defects in these components. Both clients took the extended warranty offered and handed in $ 30,000 in cash each...
The table below depicts the revenues and costs for some firm. Each row depicts a given...
The table below depicts the revenues and costs for some firm. Each row depicts a given level of sales and the associated total revenues and costs. Units Sold Total Revenues Total Costs 0 0 200 1 600 650 2 780 710 3 850 780 4 890 870 5 910 980 what is the value of fixed costs? what is the marginal cost of the 5th unit? what is the marginal revenue of the 5th unit what level of sales maximizes...
A. Determine the issue price of the debt. B. Prepare the amortization table for the bond...
A. Determine the issue price of the debt. B. Prepare the amortization table for the bond issue through January 1, 2021, assuming that Jones Road uses the effective interest rate method of amortization. C. Prepare the journal entries to record the bond issue, the first interest entry, and payment of the bonds at maturity. Assume the company uses a premium or discount account if needed. On January 1, 2018, the Jones Road Corporation issued $800,000 par value, 3%, 5-year bonds....
The element nitrogen is found in the second row of the periodic table and has an...
The element nitrogen is found in the second row of the periodic table and has an atomic number of 7. how many electrons must nitrogen gain in order for its valence shell to be full? The answer is 3 but what's the concept behind this?
Using Ruby Your extended Text Based Music Application must add the following functionality: Display a menu...
Using Ruby Your extended Text Based Music Application must add the following functionality: Display a menu that offers the user the following options: 1. Read in Albums 2. Display Albums 3. Select an Album to play 4. Update an existing Album 5. Exit the application Menu option 1 should prompt the user to enter a filename of a file that contains the following information: ·The number of albums ·The first album name ·The first artist name ·The genre of the...
IN C++: Write a program to display the following table. MUST use for-loop Enter the table...
IN C++: Write a program to display the following table. MUST use for-loop Enter the table size: 10 N N^2 Square root of N --------------------------------------------- 1 1 1.00 2 4 1.41 3 9 1.73 ….. 10 100 3.16
Determine the profit table and draw the profit diagram for each of the following portfolios. For...
Determine the profit table and draw the profit diagram for each of the following portfolios. For what range of values is the portfolio profitable and what is the maximum loss or profit? Assume that all options have a maturity of one year. a. Long one European put option with strike price K=$90 which costs $6. b. Long one European call option with strike price K=$100 which costs $4. c. Long one share and short two European call options with strike...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT