database – How / when to normalize during ETL?

Let's say you're loading a de-normalized flat file of purchase transactions that looks like this:

| location_name | location_zip | product | product_price |
| --------------- | -------------- | --------- | -------- ------- |
| downtown 90001 | french fries 2,99 |
| west side | 90048 | burger 5.99 |
etc ....

in a SQL database. In a normalized star schema database, you would have tables for the locations where the zip file is stored and for the products where the price is stored.

So what should be loading in the shopping table is this:

| location_id | product_id |
| ------------- | ------------ |
| 01 | 01 |
| 02 | 02 |
etc ....

My question is, how can we normalize the data in this way during the ETL process, before they enter the database? The process is complicated by the fact that it is possible that some locations already exist in the database with assigned IDs and others do not. It would be very inefficient to consult the database before inserting each purchase row to determine (or insert a new) location and product identification.

Any general advice on how to approach this problem would be greatly appreciated!