Compare commits
3 Commits
a47540a9c3
...
21f2bdd9a4
| Author | SHA1 | Date | |
|---|---|---|---|
| 21f2bdd9a4 | |||
| 6238ffb7d7 | |||
| 568ec683d7 |
38
Question1/db.txt
Normal file
38
Question1/db.txt
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
■練習問題1
|
||||||
|
create table
|
||||||
|
book_table(
|
||||||
|
book_id INT,
|
||||||
|
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;
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user