MySQL年龄在25或30或35_MySQL0902作业(待巩固)

1)每件商品的单件利润是多少?

select name 商品名称,( outprice - inprice ) 商品单件利润

from

tb1_commodity

9e7277b90aef21223a8e5f53ae4ed6cc.png

2)查询进价大于等于10的商品信息

select name

,

inprice

from

tb1_commodity

where

inprice > 10

fba5b9056125aac19e56db4cf941ba29.png

3)查询进价小于10的商品信息

select name

,

inprice

from

tb1_commodity

where

inprice < 10

0ea2b00526957999e0f5ce769043c552.png

4)查询进价小于10并且商品类型为1的商品信息

select

name,

inprice,

type

from

tb1_commodity

where

inprice < 10

and type =1

b3e7c4b5797bae7fde605600f60c74cb.png

5)查询进价小于10或商品类型为1的商品信息

select

name,

inprice,

type

from

tb1_commodity

where

inprice < 10

or type =1

76e3da8d3195bde312255b5560cda1a0.png

6)查询进价在10-20之间

select name as

inprice,

type

from

tb1_commodity

where

inprice between 10

and 20

7625e4d1c67be51b7869cbd87713c5db.png

7)查询商品售价为空的商品信息

select name

from

tb1_commodity

where

outprice is null

9795642554d53726e85883b53e0a69b0.png

8)查询商品进价为10或20或30的商品信息

select

name,

inprice

from

tb1_commodity

where

inprice in (

10,

20,

30)

29af73992bd69ea13029472b97f7f802.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值