Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question.
Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise.

### Tables ###
TABLE: CREATE TABLE table_6943 ( "Country" text, "Total population (millions)" real, "Total Foreign-born (millions)" real, "Born in other EU state (millions)" real, "Born in a non EU state (millions)" real )

### Question ###
What was the average number of people born in other EU states in millions, when the number of people born in a non EU state in millions was 31.368, and when the total population in millions was higher than 501.098?

### Accurate SQL ###

SELECT AVG("Born in other EU state (millions)") FROM table_6943 WHERE "Born in a non EU state (millions)" = '31.368' AND "Total population (millions)" > '501.098'