So I have three tables which I want to create with a disjoint Connection. These are person, Tenant and employee. So every person must either be a Tenant or an employee, never both. I create a Person table with the PersonID primary key, and tenant and Employee as two separate tables whose Primary Keys are both Foreign Keys linking back to the Person(PersonID). How do i create a Disjoint here where every Person can only be either a Tenant or an Employee? Thanks
相关问题
- SQL join to get the cartesian product of 2 columns
- sql execution latency when assign to a variable
- Difference between Types.INTEGER and Types.NULL in
- php PDO::FETCH_ASSOC doesnt detect select after ba
- Bulk update SQL Server C#
You can try this, which will pick out every person who is EITHER a person OR an employee:
Make sure that the id columns are all indexed.