1)每件商品的单件利润是多少?
select name 商品名称,( outprice - inprice ) 商品单件利润
from
tb1_commodity
2)查询进价大于等于10的商品信息
select name
,
inprice
from
tb1_commodity
where
inprice > 10
3)查询进价小于10的商品信息
select name
,
inprice
from
tb1_commodity
where
inprice < 10
4)查询进价小于10并且商品类型为1的商品信息
select
name,
inprice,
type
from
tb1_commodity
where
inprice < 10
and type =1
5)查询进价小于10或商品类型为1的商品信息
select
name,
inprice,
type
from
tb1_commodity
where
inprice < 10
or type =1
6)查询进价在10-20之间
select name as
inprice,
type
from
tb1_commodity
where
inprice between 10
and 20
7)查询商品售价为空的商品信息
select name
from
tb1_commodity
where
outprice is null
8)查询商品进价为10或20或30的商品信息
select
name,
inprice
from
tb1_commodity
where
inprice in (
10,
20,
30)