Lincy(dot)Lin(at)LinuxInBox(dot)Com wrote:
>HI !
>
> Does anyone know what's my problem and how to resolve it ? Thanks.
>...
>> Create Table DepartmentInfo
>> (
>>...
>> Department Char(40) Default ''
>> );
>>...
>> Create Table EmployeeInfo
>> (
>>...
>> Department Char(40) References
>> DepartmentInfo (Department)
>>...
>> ERROR: UNIQUE constraint matching given keys for referenced table
>> "departmentinfo" not found
Make DepartmentInfo.Department a primary key. If not possible, make a
unique constraint on it. If it isn't unique, you shouldn't be referencing
it as a foreign key from EmployeeInfo.