Foreign keys

 < Day Day Up > 



There are six foreign keys in ORA_EMP database:

 ALTER TABLE ACCOUNTS   ADD CONSTRAINT fk_acc_dept_code   FOREIGN KEY (dept_code)   REFERENCES departments (dept_code); ALTER TABLE emp_photo   ADD CONSTRAINT fk_emp_photo_id   FOREIGN KEY (emp_id)   REFERENCES employees (emp_id)   ON DELETE CASCADE; ALTER TABLE emp_resume   ADD CONSTRAINT fk_emp_resume_id   FOREIGN KEY (emp_id)   REFERENCES employees (emp_id)   ON DELETE CASCADE; ALTER TABLE employees   ADD CONSTRAINT fk_emp_mgr_id   FOREIGN KEY (emp_mgr_id)   REFERENCES employees (emp_id); ALTER TABLE employees   ADD CONSTRAINT fk_emp_office_id   FOREIGN KEY (office_id)   REFERENCES offices (office_id); ALTER TABLE employees   ADD CONSTRAINT m_dept_code_acct_id   FOREIGN KEY (DEPT_CODE,ACCT_ID)   REFERENCES ACCOUNTS (DEPT_CODE,ACCT_ID); ALTER TABLE employees   ADD CONSTRAINT m_band   CHECK (band IN ('1', '2', '3', '4', '5')); 



 < Day Day Up > 



Oracle to DB2 UDB Conversion Guide2003
Oracle to DB2 UDB Conversion Guide2003
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 132

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net