simple sql query -- 2

Job ID: 30786694

Budget: $10 – $30 USD

Im looking for a simple sql query that can auto create this 2 functions:

function 1:
DATABASENAME1
TABLE 1, TABLE 2,
id_product, id_shop,

right now it is:
1, 1
2, 1
3, 1

We want:
1,1
1,2
1,3
1,4
2,1
2,2
2,3
2,4
3,1
3,2
3,3
3,4

function 2:
DATABASENAME2
TABLE 1, TABLE 2, TABLE 3,
id_product, id_shop, id_lang

right now it is:
1, 1,1
1, 1,2
1,1, 3

We want:
1, 1,1
1, 1,2
1,1, 3
1,1,4
1,2,1
1,2,2
1,2,3
1,2,4


Right now, we have 3 languages, we just add 1 extra language
So the id_lang 4 is new
from the old database we have 3 language (task2.jpg)
the new we have 4 language
We want to just copy the input from the lang 1 or 2 and place them in id_lang 4 as a new line
See task3.jpg