SQL基础教程(第2版)第2章 查询基础:练习题

 

SELECT product_name, regist_date
  FROM Product
 WHERE regist_date > '2009-04-28';
View Code

~ ③中的 SQL 语句都无法选取出任何一条记录。
View Code

-- SELECT语句①
SELECT product_name, sale_price, purchase_price
  FROM Product
 WHERE sale_price >= purchase_price + 500;


-- SELECT语句②
SELECT product_name, sale_price, purchase_price
  FROM Product
 WHERE sale_price - 500 >= purchase_price;

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 = '厨房用具');
View Code

==========================================

参考资料:

https://www.cnblogs.com/MarlonKang/p/12222429.html

end

posted @ 2020-01-21 19:30  Marlon康  阅读(227)  评论(0编辑  收藏  举报