I have table call reviewbook table. Users need to assign 3 different review members to a bookid. They can be any reviewmemberid as long as they are 3 different ones to one bookid. Below is the result that I want. Right now, what i can think of is doing a multiple insert in a query however, the reviewmemberid can be duplicated, which is not what I want. I heard that trigger can be a way of doing this but I have no idea how to apply that. Can someone be kind enough to guide me or maybe if there is a better way of doing this.
Reviewbook
-reviewid
-reviewmemberid
-bookid
reviewid reviewmemberid bookid
1 2 1
2 3 1
3 5 1
4 1 2
5 2 2
6 5 2
7 1 3
8 2 3
9 4 3
//My current insert code, but this insert code can insert duplicate reviewmemberid.
INSERT ALL INTO REVIEW (REVIEWID,REVIEWMEMBERID,BOOKID)VALUES
(?.?,?) INTO REVIEW
(REVIEWID,REVIEWMEMBERID,BOOKID)VALUES
(?.?,?) INTO REVIEW
(REVIEWID,REVIEWMEMBERID,BOOKID)VALUES
(?.?,?) SELECT * FROM DUAL;