有这样一个产品进出货表,product是产品名,qty为数量,type表示进或出货:
product    qty    type
-------------------------
phone      20     in
computer   22     in
phone      15     in
dc         15     in
computer   20     out
dc         30     in
phone      10     out
-------------------------要求编写SQL语句输出如下结构:产品      进货数    库存
-------------------------
phone     35        25
computer  22        2
dc        45        45
-------------------------请教各位大神该怎么写这条SQL?谢谢!