Question: Create a database for a wiki (site that allows collaborative modification of its content and structure directly from the web browser). We needs to keep
Create a database for a wiki (site that allows collaborative modification of its content and structure directly from the web browser). We needs to keep a history of the modifications of each page by keeping each version of each page as a separate row: PageRevision(name, date, author, text) a) Create a view called Page(name, last_author, text). This view should shows only the latest version of each page. b) Create a trigger called EditPage on your newly created view Page. When a user tries to update (this should be understood as an insertion or update) a given page, a new revision is created instead (new line into the PageRevision Table). c) Explain what the next trigger is performing: CREATE TRIGGER DeletePage INSTEAD OF DELETE ON Pages FOR EACH ROW DELETE FROM PageRevisions WHERE name = OLD.name; INSERT INTO deletelog VALUES (old.name, NOW());
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
