It sounds like you are at the beginning of creating a complete tracking system, so your company can tell who they sold each IEMI to. Otherwise, why track individual IEMI numbers?
If that is the case, you will probably want to break your tables apart to fully normalize them. In this case, from your description, you will want something like the following tables:
- Category: ID, CategoryName
- Barcode: ID, BarcodeType
- MaterialsProduct: ID, ProductName, CategoryID, BarcodeID (of the barcode used for that product)
- Purchases: ID, SupplierID [ID from another table], PurchaseDate, MaterialID, Quantity, Price
- IEMIs: ID, PurchaseID, IEMI
- Sales: ID, IEMI_ID, Date, SalesPrice
...
You will also probably have a Customers table.
From the above, you could track a final IEMI back to the original purchase, unless I've missed anything.
Putting everything in one table, as you appear to have done based on your question phrasing, is a good learning experience, but quickly becomes totally unmanageable as you are realizing. It will lead to headache for you. Even though the above seems like a lot of work and learning, it is best to do so as soon as possible, to eliminate a ton of work in the end.
Good luck with it!
(PS - I renamed 'Materials' to 'Products,' as that better describes your meaning (unless I missed something else))