I have this code for MySql language:
A representator can be either a county or a person.Is this MySql code valid (the foreign key part)?
Code:
create table representator
(
id int not null,
nameOrAddress text not null
primary key(id)
foreign key(nameOrAddress) references (county(name) union person(address))
)
create table county(
name text not null,
)
create table person(
address text not null,
primary key(address)
)