diff --git a/Question1/db.txt b/Question1/db.txt index 31c0786..c5aa279 100644 --- a/Question1/db.txt +++ b/Question1/db.txt @@ -2,8 +2,38 @@ create table book_table( book_id INT, - boook__name VARCHAR(50), + book_name VARCHAR(50), author_name VARCHAR(50), price INT, sales_flag INT); +■練習問題 2 +Insert into book_table VALUES(10001,'TwoPeace','三田英一郎',420,1); +Insert into book_table VALUES(10002,'名探偵金田二','青山ふみや',460,1); +Insert into book_table VALUES(20001,'坊ちゃま','冬目漱岩',460,1); +Insert into book_table VALUES(30001,'西方見聞録','不明',1000,1); +Insert into book_table VALUES(40010,'吾輩は犬である','冬目漱岩',420,1); + + +■練習問題 3 +SELECT book_name FROM book_table; +SELECT author_name FROM book_table; + +■練習問題 4 +UPDATE book_table +SET author_name= 'マール=コー=ポロ' + where book_id = 30001; +UPDATE book_table +SET sales_flag = 0 + where book_id = 30001; + +■練習問題 5 +SELECT * FROM book_table where sales_flag= 1; + +■練習問題 6 +SELECT * FROM book_table where author_name ='冬目漱岩' AND price = 420; + +■練習問題 7 +DELETE FROM book_table where book_id = 20001; + +