美文网首页
SQL语句21天打卡,第10天0406

SQL语句21天打卡,第10天0406

作者: 没有昵称呀丫丫 | 来源:发表于2020-04-07 18:28 被阅读0次

    2020年04月06日软件测试圈「每日进阶」

    第10天作业 ,

    -- 1)  找出istester表,sex为空的的数据;

    select * from istester where sex is null

    -- 2)更新istester表,把sex为空的,设置为0(性别未知)

    update istester set sex=0 where id in (select id from istester where sex is null  )---错误

    update istester set sex = 0 where sex is null ;--√

    -- 3)找出idoxu表,grade小于60分的同学

    select * from idoxu where grade<60

    -- 4)更新idoxu表,把grade小于60分的同学,一律改为59分

    update idoxu set grade=59 where id in (select id from idoxu where grade<60)--错误

    update idoxu set grade = 59 where grade < 60 ;---正确

    空判断

    is null

    修改

    格式:update 表名 set 列1=值1,列2=值2... where 条件

    相关文章

      网友评论

          本文标题:SQL语句21天打卡,第10天0406

          本文链接:https://www.haomeiwen.com/subject/beqbphtx.html