Implementing one-to-zero-or-one relation in SQL Server

The 1-0..1 relation in your database is directly visible. It is built between Course and OnlineCourse tables where Course is principal in relation (1) and OnlineCourse is dependent with FK configured on CourseID. FK is also PK of the OnlineCourse = it must be unique and because of that it is 0..1.

Database “always” uses 1 – 0..1 because real 1 – 1 cannot be effectively used for data insertion. 1 – 1 means that left must be inserted after right but right must be inserted after left = impossible. Because of that 1 – 0..1 is used where left is principal and must be inserted before right and right is dependent and must be inserted after left.

Leave a Comment