Rodzaj
Cupon - is bound to -> Order;
Order - has active -> Cupon;
Cupon (
Id PK,
orderId FK Order.Id,
Unique ( Id, orderId) -- any superset of PK is unique
);
Order (
Id PK
ActiveCuponId,
(Id, ActiveCuponId) FK Cupon( OrderId, Id)
);
Zobacz skrzypce https://dbfiddle.uk/?rdbms=sqlserver_996ab5b30905afiddle=596b30905d02a9e5c799b16da5fff5ab">