Data being duplicated in the database

Sorry if this question is too obvious. But my problem is the following: I sent it, using a csv spreadsheet, to fill my Products database. I filled this database with products, to use that searchbox element to bring me the products from that table. When the user chooses the product, I create a new purchase, and associate the product with the user, too. But every time I do this, the product is registered again in my table. How can I solve my problem without registering the product that already exists in the table?

You may create new product instead of creating new purchase. You need a separate data type for the purchase.