Answered step by step
Verified Expert Solution
Question
1 Approved Answer
ALTER SESSION SET NLS_DATE_FORMAT = 'MM/DD/YYYY'; SET ESCAPE ON; CREATE TABLE EMP ( EMP_NUM integer, EMP_TITLE varchar2(4), EMP_LNAME varchar2(15), EMP_FNAME varchar2(15), EMP_INITIAL varchar2(1), EMP_DOB date,
ALTER SESSION SET NLS_DATE_FORMAT = 'MM/DD/YYYY'; SET ESCAPE ON; CREATE TABLE EMP ( EMP_NUM integer, EMP_TITLE varchar2(4), EMP_LNAME varchar2(15), EMP_FNAME varchar2(15), EMP_INITIAL varchar2(1), EMP_DOB date, EMP_HIRE_DATE date, EMP_AREACODE varchar2(3), EMP_PHONE varchar2(8), EMP_MGR integer ); INSERT INTO EMP VALUES('100','Mr.','Kolmycz','George','D','6/15/1942','3/15/1985','615','324-5456',''); INSERT INTO EMP VALUES('101','Ms.','Lewis','Rhonda','G','3/19/1965','4/25/1986','615','324-4472','100'); INSERT INTO EMP VALUES('102','Mr.','VanDam','Rhett','','11/14/1958','12/20/1990','901','675-8993','100'); INSERT INTO EMP VALUES('103','Ms.','Jones','Anne','M','10/16/1974','8/28/1994','615','898-3456','100'); INSERT INTO EMP VALUES('104','Mr.','Lange','John','P','11/8/1971','10/20/1994','901','504-4430','105'); INSERT INTO EMP VALUES('105','Mr.','Williams','Robert','D','3/14/1975','11/8/1998','615','890-3220',''); INSERT INTO EMP VALUES('106','Mrs.','Smith','Jeanine','K','2/12/1968','1/5/1989','615','324-7883','105'); INSERT INTO EMP VALUES('107','Mr.','Diante','Jorge','D','8/21/1974','7/2/1994','615','890-4567','105'); INSERT INTO EMP VALUES('108','Mr.','Wiesenbach','Paul','R','2/14/1966','11/18/1992','615','897-4358',''); INSERT INTO EMP VALUES('109','Mr.','Smith','George','K','6/18/1961','4/14/1989','901','504-3339','108'); INSERT INTO EMP VALUES('110','Mrs.','Genkazi','Leighla','W','5/19/1970','12/1/1990','901','569-0093','108'); INSERT INTO EMP VALUES('111','Mr.','Washington','Rupert','E','1/3/1966','6/21/1993','615','890-4925','105'); INSERT INTO EMP VALUES('112','Mr.','Johnson','Edward','E','5/14/1961','12/1/1983','615','898-4387','100'); INSERT INTO EMP VALUES('113','Ms.','Smythe','Melanie','P','9/15/1970','5/11/1999','615','324-9006','105'); INSERT INTO EMP VALUES('114','Ms.','Brandon','Marie','G','11/2/1956','11/15/1979','901','882-0845','108'); INSERT INTO EMP VALUES('115','Mrs.','Saranda','Hermine','R','7/25/1972','4/23/1993','615','324-5505','105'); INSERT INTO EMP VALUES('116','Mr.','Smith','George','A','11/8/1965','12/10/1988','615','890-2984','108');
Question Use the data given with this question. First rename the table name and prefix your assignment group number with the table name. If your group number is 5, the table name should be EMP_G5 Insert the given rows into the table. Now write scripts for the following: 1) Write a script using table to demonstrate implicit cursor using any 3 DML statement including INSERT, DELETE and UPDATE statement. 2) Your script should accept an input for a DML statement: Example : if option 1 is entered You should execute INSERT statement if option 2 is entered You should execute DELETE statement if option 3 is entered You should execute UPDATE statement 3) Use where clause to filter required rows
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started