Create a script file that performs the following in SQL developer. Insert a stat
ID: 3722136 • Letter: C
Question
Create a script file that performs the following in SQL developer.
Insert a statement to drop the "CustomerView"
Insert a statement to create an updatable view, "CustomerView" based on the "Customer" table that retrieves all fields of the customer table.
COLUMN NAME DATA TYPE 1 CUSTID 2 NAME 3 ADDRESS 4 CITY 5 STATE 6 ZIP 7 AREA 8 PHONE 9 REPID NUMBER (6,0) VARCHAR2 (45 BYTE) Yes VARCHAR2 (40 BYTE) Yes VARCHAR2 (30 BYTE) Yes VARCHAR2 (2 BYTE) Yes VARCHAR2 (9 BYTE) Yes NUMBER (3,0) VARCHAR2 (9 BYTE) Yes NUMBER (4,0) NUMBER (9,2) LONG NULLABLE DATA-DEFAULT | COLUMN-ID C 1 (nu 2 (nu 3 (nu 4 (nu 5 (nu 6 (nu 7(nu 8 (nu 9 (nu 10 (nu 11 (nu (null) (null) (null) (null) (null) (null) (null) (null) (null) (nul (null) No Tes 10 CREDITLIMIT 11 CoMMENTS No Tes TesExplanation / Answer
The script for performing the given operations is given below.
-- Drop the view named 'CustomerView'.
DROP VIEW CustomerView;
-- Creating an updatable view CustomerView to display all records from Customer table.
-- WITH CHECK OPTION is used to make the view updatable.
CREATE VIEW CustomerView
AS
SELECT CUSTID, NAME, ADDRESS, CITY, STATE, ZIP, AREA, PHONE,
REPID, CREDITLIMIT, COMMENTS
FROM Customers
WITH CHECK OPTION;
-- Inserting 5 records to the customer table.
INSERT INTO Customer VALUES (1,'John', '9th Street', 'Dallas', 'Texas', '56007',
'Carls Colony', '99999999', 24, 300.00, 'Nice job');
INSERT INTO Customer VALUES (2,'James', '6th Street', 'Dallas', 'Texas', '56007',
'Carls Colony', '99999889', 25, 400.00, 'Nice job');
INSERT INTO Customer VALUES (3,'Mathew', '10th Street', 'Dallas', 'Texas', '56007',
'Carls Colony', '99779999', 26, 700.00, 'Nice job');
INSERT INTO Customer VALUES (4,'Jacob', 'Mall road', 'Dallas', 'Texas', '56007',
'Carls Colony', '99994499', 27, 100.00, 'Nice job');
INSERT INTO Customer VALUES (5,'Coral', 'Star Street', 'Dallas', 'Texas', '56007',
'Carls Colony', '93999999', 29, 560.00, 'Nice job');
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.