Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. create a FICTION table with structure shown in figure 6-29 2. Insert into the

ID: 3643031 • Letter: 1

Question



1. create a FICTION table with structure shown in figure 6-29
2. Insert into the FICTION table the book code, book title, publisher code, and price from the BOOK table for only those books having type FIC
3. The publisher with code LB has decreased the price of its fiction books by four percent. update the prices in the FICTION table accordingly
4. insert a new book into the FICTION table. The book code is 9946, the title is cannery row, the publisher is PE, and the price is 11.95
5.delete the book in the FICTION table having the book code 9883
6. The price of the book entitled TO Kill a Mockingbird has been increased to an unknown amount. Change the value in the FICTION table to reflect this change.
7.add to the FICTION table a new character column named BEST_SELLER that is one character in length. then set the default value for all column to N
8.Change the BEST_SELLER column in the fiction table to y for the book entitled Song for Solomon
9.Change the length of the TITLE column in the FICTION table to 50 characters
10.change the BEST_SELLER column in the FICTION table to reject nulls.
11.Delete the FICTION table from the database

Explanation / Answer

2. Insert into FICTION( book code, book title, publisher code, price ) Select book code, book title, publisher code, price from BOOK where type="FIC" 3. Update FICTION SET price= price-(price*4/100) where Publisher="LB" 4.Insert into FICTION values("9946","Cannery","PE",11.95) 5.Delete From FICTION where bookcode=9883 7.ALTER TABLE FICTION ADD BEST_SELLER char(1) default 'N' 8. Update FICTION set BEST_SELLER='Y' where book title=="SOng For Solomon" 9.ALTER TABLE FICTION ALTER COLUMN TITLE char(50) 10. ALTER TABLE FICTION ALTER COLUMN BEST_SELLER NOT NULL; 11.DROP TABLE FICTION;