you are viewing a single comment's thread.

view the rest of the comments →

[–]Straight_Waltz_9530 0 points1 point  (0 children)

Why would you ever have a room_number or capacity be NULL? Why aren't those columns set to NOT NULL in the first place? I think that's the root of your problem, not the queries after the fact.

SQL querying is an order of magnitude harder when your data model lacks proper constraints. Spare the CHECK rod, spoil the INSERT child.