#(7)比較演算子 where で使用 = > >= <= <> !=
# in not in is null is not null
# between ... and ...
-- 1)productsテーブルから全列を取得
select * from products;
-- 2)id=1の行だけを取得
select * from products where id=1;
-- 3)name='商品0003'の行だけを取得
select * from products where name='商品0003';
-- 4)price>1000の行だけを取得
select * from products where price>1000;
-- 5)price<1000の行だけを取得
select * from products where price<1000;
-- 6)price!=100の行だけを取得
select * from products where price!=100;
select * from products where price<>100;
-- 7)id=1,2,3の行を取得
select * from products where id in(1,2,3);
-- 8)id!=1,2,3の行を取得
select * from products where id not in(1,2,3);
-- 9)price!=nullの行を取得
select * from products where price is not null;
-- 10)price=nullの行を取得
select * from products where price is null;
-- 11)priceが1000から1900までの行を取得
select * from products where price>=1000 and price<=1900;
select * from products where price between 1000 and 1900;
-- 12)price=1000,2000の行を取得
select * from products where price=1000 or price=2000;