I would like to know whether parent child relationship is supported by Cuba?
In a table (i.e. Salesmen) there are ID, Name and Supervisor and we want to make sure that supervisor exists.
If it is supported how can I implement it?
Thank you in advance.
CREATE TABLE [dbo].[Salesmen]
[ID] [int] IDENTITY(1,1) NOT NULL
, [Code] varchar NULL
, [Name] varchar NOT NULL
, [PID] [int] NULL
, CONSTRAINT [sm_PK] PRIMARY KEY CLUSTERED
( [ID] ASC )
) ON [USERDATA]
ALTER TABLE [dbo].[Salesmen] WITH CHECK
ADD CONSTRAINT [sm_FK_ID] FOREIGN KEY([PID])
REFERENCES [dbo].[Salesmen] ([ID])