Optional Relationships in SQL Server - How to Implement SSMS Schema Designer

I have two cases where I would like to establish an “optional” relationship within a single table or between two tables.

Firstly:

enter image description here

I want to set this relationship as optional, in other words: there will be categories and subcategories in the same table, so the subcategory column is optional.

Secondly:

enter image description here

Here I want to make sure that a House cannot exist without a member (mandatory relationship), but a member can be without any House (optional relationship).

I have no experience with Microsoft SQL Server, and I have no idea how I can change this relationship.

Here is the end result in an Oracle chart:

enter image description here

+4
source share
1

, (DB Diagram) SQL Management Studio, : -

  • digram, "Table View" → "Standard"

Right-clicking the table

  1. " " " "

Setting NULLable in designer

  1. Ctl + S, .

(, , FK ..) , "" ( ). , subcat :

subcat properties

+2

All Articles