I want to create a table with the values ‚name‘ and ‚immobilien-id‘. Both are the primary key. But there should be a restricition That i can only Save a ‚name‘ with a value That already exists in my other table ‚immobilienmakler‘. In ‚immobilienmakler‘ i already created a ‚name‘.
My try
CREATE TABLE verwalten (
name STRING CHECK(Select name from immobilienmakler WHERE immobilienmakler.name = name),
immobilien-id INTEGER NOT NULL,
PRIMARY KEY(name, immobilien-id)
);
How can i put a IF EXIST into this Statement?