SQL9 查找除复旦大学的用户信息
select device_id,gender,age,university from user_profile where university not like '复旦大学)#模糊查询
select device_id,gender,age,university from user_profile where university not in ('复旦大学')#不取复旦大学那一列
#在mysql中两种不等于的写法:<> !=
select device_id,gender,age,university from user_profile where university<>'复旦大学'
select device_id,gender,age,university from user_profile where university !='复旦大学'
SQL10 用where过滤空值练习
传送门
不能直接用 != 或者 <>来判断该属性是否为空,但是可以用判断是否为空串 !=”“来判断
也可以用,is not null 常用的判空语句来判断
#select device_id,gender,age,university from user_profile where age!='null'
select device_id,gender,age,university from user_profile where age is not null and age!="" and age <>""