I need to build a table for some new components that will keep track of available and used inventory. It will be something like this:
CREATE TABLE components
(
component_Id int NOT NULL PRIMARY KEY,
workOrder_Id int FOREIGN KEY,
componentSerial varchar(25) NOT NULL,
foo varchar(50),
bar int,
information nvarchar(250)
date DateTime
)
What advantages are there for having the FOREIGN KEY workOrderID be nullable when it hasn't been used yet as opposed to being NOT NULL and having a default value of 0?
To me letting it be nullable makes more sense.
I looked at some similar situations but I'm not sure why someone would choose one over the other.