Introduction to our sample database structure
Through the sample we will be using the basic structure of 2 tables to explain all the scenarios
Employee table
Mentor table
SQL DML Queries
DROP VIEW EMP_VIEW;
DROP TRIGGER EMP_TRIG;
DROP SEQUENCE EMP_SEQ;
DROP SEQUENCE MENT_SEQ;
DROP TABLE MENTOR;
DROP TABLE EMP;
COMMIT;
-- Create table for Session 4
CREATE TABLE EMP(
EMP_ID INTEGER NOT NULL PRIMARY KEY,
NAME VARCHAR(20) NOT NULL,
DEPARTMENT VARCHAR(10) NOT NULL,
PHONE VARCHAR(10) CHECK (PHONE not like '%[^0-9]%'),
SALARY INTEGER)
IN SHRDB6.SHRTS6;