lab requires you to use Oracle VIEW to implement a virtualdatabase on DBSEC schema, for example, on CUSTOMER table. Your taskis to develop a single SQL script that will perform all thefollowing tasks:
Table created for this assignment is listed below:
create table CUSTOMER_VPD(
SALES_REP_ID NUMBER(4),
CUSTOMER_ID NUMBER(8) NOT NULL,
CUSTOMER_SSN VARCHAR(9),
FIRST_NAME VARCHAR(20),
LAST_NAME VARCHAR(20),
ADDR_LINE VARCHAR(40),
CITY VARCHAR(30),
STATE VARCHAR(30),
ZIP_CODE VARCHAR(9),
PHONE VARCHAR(15),
EMAIL VARCHAR(80),
CC_NUMBER VARCHAR(20),
CREDIT_LIMIT NUMBER,
GENDER CHAR(1),
STATUS CHAR(1),
COMMENTS VARCHAR(1025),
USER_NAME VARCHAR(30)
);
Tasks:
Populate the CUSTOMER_VPD table withfour rows of records. Pay attention to the column CTL_UPD_USER,
Create a VIEW named as MY_VIEW todisplay only rows that belong to the logged in user
Grant SELECT and INSERT privilege onMY_VIEW to DBSEC_CLERK
Insert one row of data into MY_VIEW asDBSEC_CLERK by using the following data
Verify your data insertion by queryMY_VIEW. You (as DBSEC_CLERK) should only see one row of data youhave inserted. This signifies the success of yourimplementation.