6 | 207 | (SQL문 마지막에 ;(세미콜론) 추가) 207쪽
SELECT * FROM BookTable;
208쪽
SELECT title, price, author, pubdate FROM BookTable;
SELECT title_id, title, price FROM BookTable WHERE price<=30000;
SELECT title_id, title, price, author, section_part FROM BookTable WHERE section_part=‘공학’;
209쪽
SELECT title_id, title, price, author, section_part FROM BookTable ORDER BY price;
SELECT title_id, title, price, author, section_part FROM BookTable ORDER BY price DESC;
210쪽
SELECT BookTable.title_id, PubTable.pub_no, BookTable.title, BookTable.price, BookTable.author FROM BookTable JOIN PubTable ON BookTable.title_id=PubTable.title_id;
211쪽
INSERT INTO BookTable(title_id, title, ISBN, price, author) VALUES (‘K301’, ‘전자공학개론’, ‘123-456’, 23000, ‘박창순’);
SELECT * FROM BookTable;
212쪽
INSERT INTO ScienceTable(title_id, title, ISBN, price, pubdate, section_part, author) SELECT title_id, title, ISBN, price, pubdate, section_part, author FROM BookTable WHERE section_part = ‘자연과학’;
213쪽
SELECT * FROM ScienceTable;
DELETE FROM BookTable WHERE title_id=‘K301’;
SELECT * FROM BookTable;
214쪽
UPDATE BookTable SET price=price-500 WHERE section_part=‘공학’;
215쪽
SELECT * FROM BookTable;
| 2012-03-19 | 1 |