Insert double entry in DB

Simple – if you do not want duplicate information then before you insert anything check if such data is already present. Just query for it and see if there is a match.

From WP perspective however, you seem to be looking at technique (database table) that you will rarely need in practice. WordPress offers wealth of storage options and your time is likely better spent exploring theme, before rolling your own custom storage.