Q:

Interesting SQL structure: part of primary key could be NULL

Here is my table:
PRODUCT_ID (pk) | GROUP_ID (pk) | PRICE

with this, I would set different prices for products with different users. If a price applies to every group, GROUP_ID would be NULL. But this is a PK - it cant be NULL. PRODUCT_ID cant be PK standallone, since there can be more products with different prices. Then how to dodge it?

A:

As you said, it is not possible to have primary key of a table as NULL. I'd suggest that you have some 'special' value (much like NULL just something else that is valid) that would indicate that said price applies to all groups (for example ~0 if you are using INT UNSIGNED as your type for GROUP_ID).

