SNO | BOARD | PLAYER_ID | SIGN
1 | xyz | 1 | X
2 | xxx | 1 | O
I have created a similar table for the game tic tac toe and I want to insert row based on another row with the same column value.
For example:
If I send BOARD = xyz and PLAYER_ID = 2 then MySQL should consider SIGN = O
I can use ENUM to only accept 2 values for the SIGN column to accept X or O values (Suggest me for better ideas).
XandO.UPDATErather thanINSERT.INSERTmakes a new row.UPDATE. When I am inserting a new row, it should toggle thesigncolumn value from the other rowsigncolumn value.