SQL>
SQL>
SQL> CREATE TABLE employee (
2 id number,
3 name varchar(100),
4 birth_date date,
5 gender varchar2(30) );
Table created.
SQL>
SQL> CREATE TABLE employee_evaluation (
2 id number,
3 title varchar2(100),
4 written_date date );
Table created.
SQL>
SQL>
SQL>
SQL>
SQL>
SQL> ALTER TABLE employee_evaluation ADD
2 CONSTRAINT employee_evaluation_fk1
3 FOREIGN KEY (id)
4 REFERENCES employee (id);
REFERENCES employee (id)
*
ERROR at line 4:
ORA-02270: no matching unique or primary key for this column-list
SQL>
SQL>
SQL> drop table employee cascade constraint;
Table dropped.
SQL>
SQL> drop table employee_evaluation cascade constraint;
Table dropped.
SQL>
|