课程地址:GitHub - datawhalechina/wonderful-sql: Follow me,从 0 到 1 掌握 SQL,决胜秋招。
一、练习题
2.1
select product_name,regist_date
from product
where regist_date >'2009-04-28';
2.2
得到的结果都是空
2.3
select product_name,sale_price,purchase_price from product where (sale_price-purchase_price)>=500;
select product_name,sale_price,purchase_price from product where not sale_price -purchase_price <500;
2.4
select product_name,product_type,(sale_price*0.9-purchase_price) as profit
from product
where (sale_price*0.9-purchase_price)>100
and (product_type='办公用品' or product_type='厨房用具');
2.5
1.sum只能用于数值类型的列
2.顺序错误,应该是select、from、where、group by
3.