Question: Create a database for wiki (site that allows collaborative modification of its content and structure directly from the web browser). We need to keep a

Create a database for wiki (site that allows collaborative modification of its content and structure directly from the web browser). We need 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 show only the latest version of each page.

b)Create a view 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 PageRevision table)

c)Explain what the next trigger is performing:

CREATE TRIGGER DeletePage INSTEAD OF DELETE ON Pages

FOR EACH ROW

DELETE FROM Pagerevision WHERE name=OLD.name;

INSERT INTO deletelog VALUES (old.name, NOW ());

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!