2. Display the item number and total cost for each order
line (total cost = no of items X item cost). Name the
calculated column TOTAL COST.
Answers were Sorted based on User's Feedback
Answer / girija.112
ANS:
SELECT ITEM_NO , NO_OF_ITEMS*INDIVIDUAL_ITEM_COST AS "TOTAL COST"
FROM ITEM_TABLE
ITEM_NO TOTAL COST
1001 30000
1002 40000
1003 72000
1004 100000
1006 40000
1007 60000
1008 80000
1009 -
1010 56000
I have assumed that ITEM_NO, NO_OF_ITEMS &
INDIVIDUAL_ITEM_COST columns are in a single table ITEM_TABLE
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / ajit
select itemnum,totalcost
from <tab name>
group by cube(itemnum, totalcost);
| Is This Answer Correct ? | 0 Yes | 0 No |
what is the scenario where you take the database to NoArchivelog mode?
Compare and contrast between sql and sql server and explain its various functions?
how to get count of tables in particular database in Oracle?
Why do I get java.lang.abstractmethoderror when trying to load a blob in the db?
Why packages are used in oracle?
What are the advantages of oracle?
How would you change old and new values in an insert, delete and update triggers?
Can group functions be used in the order by clause in oracle?
how to join query for one source type is oracle another source type is sql server ?
how to we delete a row using varray
What are the different types of databases?
What is difference between UNIQUE constraint and PRIMARY KEY constraint ?