Any databse admins around?

Associate
Joined
26 Jan 2006
Posts
1,502
Hello,

I want to set a constrain in my database, however due to the situation I find it difficult.

I have a M:N relationship between customer and order and would like to constrain the maximum number of orders of the customer to 5.

This is obviously not a matter to add a check under the customer or order table creation since everything is going on in the junction table.

I appreciate your thoughts.

Thanks.

PS: DBMS is postgreSQL
 
Back
Top Bottom