Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

T Sql Fundamentals

Authors: Itzik Ben Gan

4th Edition

0138102104, 978-0138102104

More Books

Students also viewed these Databases questions