Create an empty table called SECTION2 with the same structure as the SECTION table. Create a view on the SECTION2 table that will be used for updating the table and restricts updates to sections with capacities that are less than 25. Write two INSERT statements – one that succeeds and one that fails and that uses the view to insert into the SECTION2 table.

What will be an ideal response?

```
CREATE TABLE section2 AS
SELECT *
FROM section
WHERE 1=2

CREATE VIEW v_section2 AS
SELECT *
FROM section2
WHERE capacity < 25
WITH CHECK OPTION

-- should succeed
INSERT INTO v_section2
VALUES (1,1,1,sysdate,NULL,102,15,user,sysdate,user,sysdate)

--should fail
INSERT INTO v_section2
VALUES (1,1,1,sysdate,NULL,102,30,user,sysdate,user,sysdate)
```

Computer Science & Information Technology

You might also like to view...

The tar utility was designed to store files conveniently on ____.

A. disk B. magnetic tape C. platters D. memory sticks

Computer Science & Information Technology

The slide with the Section Header layout should have characteristics similar to the title slide to give the presentation continuity.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology