Here is my table ..and i want this output:
pid | pname | custname | quantity | total base price | sale price | profit
schema:
create table customers
(
cid int,
cname varchar(1000),
cg varchar(1000)
)
create table prod
(
pid int,
pname varchar(1000),
baseprice int,
saleprice int
)
create table orders
(
oid int,
custid int,
pid int,
quantity int,
odate date
)
How do I write a query for this?