Prepare data:
CREATE TABLE fruit
( "ID" NUMBER(4,0),
"NAME" VARCHAR2(50 BYTE),
"PRICE" NUMBER(4,2)
)
Insert into fruit (ID,NAME,PRICE) values (1,'Apple',1);
Insert into fruit (ID,NAME,PRICE) values (2,'Banana',2);
Insert into fruit (ID,NAME,PRICE) values (3,'Pear',3);
Insert into fruit (ID,NAME,PRICE) values (4,'Orange',4);
commit;
select * from fruit;
The output is:
ID NAME PRICE
1 Apple 1
2 Banana 2
3 Pear 3
4 Orange 4
Now suppose that you want to give a 10% discount to all the fruits, so that these fruits can be sold faster.
so you want to see the discounted price as well, you can select constant as a column, to display what you want:
select id, name , price, 0.10 as "Discount", price * (1- 0.10) as "Discounted Price" from fruit;
The output is:
ID NAME PRICE Discount Discounted Price
1 Apple 1 0.1 0.9
2 Banana 2 0.1 1.8
3 Pear 3 0.1 2.7
4 Orange 4 0.1 3.6