建设网站上海市,开通小程序流程,微信的微网站,wordpress 批量插件https://leetcode.cn/study-plan/sql/?progressxhqm4sjh 目录选择595. 大的国家1757. 可回收且低脂的产品584. 寻找用户推荐人183. 从不订购的客户排序 修改1873. 计算特殊奖金627. 变更性别196. 删除重复的电子邮箱选择
595. 大的国家 # Write your MySQL query state… https://leetcode.cn/study-plan/sql/?progressxhqm4sjh 目录选择595. 大的国家1757. 可回收且低脂的产品584. 寻找用户推荐人183. 从不订购的客户排序 修改1873. 计算特殊奖金627. 变更性别196. 删除重复的电子邮箱选择
595. 大的国家 # Write your MySQL query statement below
select name,population,area
from World
where area3000000 or population25000000;# Write your MySQL query statement below
select name,population,area
from World
where area3000000
union
select name,population,area
from World
where population25000000;1757. 可回收且低脂的产品 # Write your MySQL query statement below
select product_id
from Products
where low_fatsY and recyclableY;584. 寻找用户推荐人 # Write your MySQL query statement below
select name
from customer
where referee_id2 or referee_id is NULL;183. 从不订购的客户 # Write your MySQL query statement below
select Name Customers
from Customers
where Customers.Id not in(select CustomerIdfrom Orders
);排序 修改
1873. 计算特殊奖金 SQL中IF函数的使用: IF(expr1,expr2,expr3)
expr1 的值为 TRUE则返回值为 expr2expr1 的值为FALSE则返回值为 expr3
# Write your MySQL query statement below
select employee_id,if(employee_id%21 and name not like M%,salary,0) bonus
from Employees
order by employee_id; 627. 变更性别 case when的使用方法:
case 列名when 条件值1 then 选项1when 条件值2 then 选项2.......else 默认值 end# Write your MySQL query statement below
update Salary
set sexcase sexwhen f then melse f end
;# Write your MySQL query statement below
update Salary
set sexcase when sexfthen melse f end
;196. 删除重复的电子邮箱 # Please write a DELETE statement and DO NOT write a SELECT statement.
# Write your MySQL query statement below
delete p1
from Person p1,Person p2
where p1.emailp2.email and p1.idp2.id;