-- HR
select * from EMPLOYEES;
-- 테이블 생성
create table c_emp (
id number(5),
name varchar2(25),
salary number(7,2),
phone varchar2(15),
dept_id number(7) constraint c_emp_dept_id_fk
REFERENCES departments(department_id)
);
-- foreign key 지정 방법 : references 테이블 (참조할 키)
select * from DEPARTMENTS;
insert into c_emp (id, name, dept_id) values (1, 'kim', 10);
COMMIT;
댓글 ( 4)
댓글 남기기