I am confused with how to do the following. I have
Table A
datetime AsOfDate PK
varchar Id PK
other irrelevant fields
Table B
datetime AsOfDate PK
varchar Id PK
other irrelevant fields
The relationship from A to B is (AsOfDate, Id) -> (AsOfDate, Id)
Every A has one or none B. Every B has one A.
Is this the right way to model a scenario where an A might be an X, and if it is the details about X are in B and if it is not an X it doesn’t have an entry in B?
If I’m understanding correctly, B can be thought of as an sub-type of A or as a group of optionally related information about A?
If so, your model is correct. B needs to keep the key of A as its own key. Entities of A can exist on their own, and you’d want to enforce referential integrity using whatever RDBMS product you choose to go with so that all B must have a matching entity A.