HW4 - ON Book(Book.Type,Book.Price DESC 5 DROP INDEX...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
INTRO TO DATABASES HW4 SOLUTIONS HW.4 1. CREATE VIEW PenguinBooks AS SELECT BookCode, Title,Type, Price, PublisherCode FROM Book WHERE PublisherCode= ‘PE’ ; 2. CREATE VIEW PaperBack AS SELECT BookCode, Title, PublisherName, Price, PaperBack FROM Book, Publisher WHERE PaperBack = ‘1’ ; 3. CREATE VIEW BookInventory AS SELECT BookCode, OnHand FROM Book, Inventory WHERE * ; 4.a CREATE INDEX BookIndex1 ON Publisher (PublisherName) ; .b CREATE INDEX BookIndex2 ON Book (Type) ; c. CREATE INDEX BookIndex3
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ON Book (Book.Type,Book.Price DESC) ; 5. DROP INDEX Book.BookIndex3 ; 7.a ALTER TABLE Book FOREIGN KEY Book.PublisherCode ; .b ALTER TABLE Inventory FOREIGN KEY Inventory.BranchNum ; .c ALTER TABLE Wrote FOREIGN KEY Wrote.AuthorNum ; 8. ALTER TABLE Book ADD Classic bit ; 9. UPDATE Book SET Classic = ‘Y’ WHERE Book.BookName= ‘The Grapes of Wrath’ ; 10. ALTER TABLE Book CHANGE COLUMN Book.Title TO CHAR(60) ; 11. DROP TABLE “Books”...
View Full Document

{[ snackBarMessage ]}

Page1 / 2

HW4 - ON Book(Book.Type,Book.Price DESC 5 DROP INDEX...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online