MySQL SQL練習問題20261027
This commit is contained in:
14
MYSQL_Question2_5-.txt
Normal file
14
MYSQL_Question2_5-.txt
Normal file
@@ -0,0 +1,14 @@
|
||||
--問5
|
||||
select * from items inner join item_category using(category_id) where category_name = '家具';
|
||||
|
||||
--問6
|
||||
select * from items inner join item_category using(category_id) where price between 1000 and 50000;
|
||||
|
||||
--問7
|
||||
select count(*) as data_count from items;
|
||||
|
||||
--問8
|
||||
select * from items inner join item_category using(category_id) where price = (select max(price) from items);
|
||||
|
||||
--問9
|
||||
select * from items inner join item_category using(category_id) where name like '%の%';
|
||||
10
Question2+α.txt
Normal file
10
Question2+α.txt
Normal file
@@ -0,0 +1,10 @@
|
||||
--問1
|
||||
select items.item_id as 商品ID, items.name as 商品名, items.price as 価格,
|
||||
item_category.name as カテゴリ名 from items inner join item_category using(category_id);
|
||||
|
||||
--問2
|
||||
select orders.order_id as 注文ID, orders.order_time as 注文日時, users.name as ユーザー名,
|
||||
items.name as 商品名, items.price as 価格, order_items.quantity as 数量 from order_items
|
||||
inner join orders using(order_id)
|
||||
inner join items using(item_id)
|
||||
inner join users using(user_id) order by orders.order_time;
|
||||
Reference in New Issue
Block a user