Posts

Showing posts from March, 2020

SQL - Constraints • Foreign Key

--==================================================== SQL - Constraints   •     Foreign Key --==================================================== DROP TABLE XX_EMP_TL DROP TABLE XX_LOC_TL ----------   DEPT Table ------------ CREATE TABLE XX_LOC_TL (   LOC_CODE   NUMBER ( 2 ) PRIMARY KEY,   NAME    VARCHAR2 ( 100 BYTE)   ) Insert into XX_LOC_TL ( LOC_CODE , NAME) Values ( 01 , 'DL' ); Insert into XX_LOC_TL ( LOC_CODE , NAME) Values ( 02 , 'UP' ); Insert into XX_LOC_TL ( LOC_CODE , NAME) Values ( 03 , 'MP' ); COMMIT; select * from XX_LOC_TL LOC_CODE NAME 1 DL 2 UP 3 MP ----------------------   EMP Table ----------------------- CREATE TABLE XX_EMP_TL (   EMPNO      NUMBER ( 4 ) PRIMARY KEY, -- Column Level Constraints -- ...