Question: Questions & Tasks 1. Create a table named DEPT based on the following chart. Column Name ID NAME Primary key Key Type Nulls/Unique FK Table



Questions & Tasks 1. Create a table named DEPT based on the following chart. Column Name ID NAME Primary key Key Type Nulls/Unique FK Table FK Column Data type NUMBER VARCHAR2 Length 25 Name Null Type ID NAME NOT NULL NUMBER (7) VARCHAR2(25) 2) Create a table named EMP based on the following chart below. LAST_NAME FIRST_NAME DEPT_ID Column Name ID Key Type Nulls/Unique FK Table FK Column Data type NUMBER Length DEPT ID VARCHAR2 VARCHAR2 NUMBER 7 25 7 Nane Null Type ID LAST_NAME FIRST_NAME DEPT_ID NUMBER (7) VARCHAR2 (25) VARCHAR2 (25) NUMBER (7) 3. Create the new table name EMPLOYEE2 based on our existing Employees table. Use Clone / Copy techniques from another table by using SELECT statement Include only EMPLOYEE_ID, FIRST_NAME, LAST_NAME, SALARY and DEPARTMENT_ID columns Name the columns in your new table as ID, FIRST_NAME, LAST_NAME, SALARY, and DEPT_ID respectively. 4. Alter table EMPLOYEE2 ( that you created in Question 3) and set this table as READ ONLY mode. 5. a) Try to Insert these two records into EMPLOYEE2 table INSERT INTO EMPLOYEEZ (ID, FIRST_NAME,LAST_NAME, SALARY,DEPT_ID) VALUES (34, "Grant', Marcia', 5678,10); P.S: Make sure you rewrite this INSERT statement in SQL Developer or if you copy paste fix single quote This INSERT will cause error message like below. Explain why you get this error and how can you fix. Run the fix command and place here your command and screen shot Error starting at line 1 in command: INSERT INTO employees2 VALUES (34, "Grant', 'Harcie', 5678,10) Error at Command Line:1 Column: 12 Error report: SQL Error: ORA-12081: update operation not allowed on table "ORA16". "EMPLOYEES2" 12001. 00000 - "update operation not allowed on table "s\"."" *Cause: An attempt was made to update a read-only materialized vieu. *Action: No action required. Only Oracle is allowed to update a read-only materialized wie emy b) INSERT new record to table DEPT (the table you created in Question 1) INSERT INTO DEPTID, NAME) VALUES (40, 'Sales'); Explain if this insert run successfully and added record. YES or NO c) Run another insert statement/Command INSERT INTO DEPT (ID, NAME) VALUES 40, Accounting): Explain if this insert run successfully and added record. YES or NO If not WHY? P.S: Make sure you rewrite these INSERT statements in SQL Developer or if you copy paste fix single quote
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
