Let me give an example. There are two tables:
Tbl1which has columnsa(primary key),b,c(foreign key toTbl2primary key(columnx))Tbl2which has columnsx(primary key),y.
Is it possible to do backup all data of Tbl1 and also include only the necessary data from Tbl2 so it satisfies the Foreign key constraint, and not a full backup of data for Tbl2.
Tbl1
| a | b | c |
|---|---|---|
| 1 | x11111 | 2 |
| 2 | x22222 | 3 |
| 3 | x33333 | 4 |
Tbl2
| x | y |
|---|---|
| 1 | k11111 |
| 2 | k22222 |
| 3 | k33333 |
| 4 | k44444 |
| 5 | k55555 |
What I want to be included in the backup is the following:
Tbl1
| a | b | c |
|---|---|---|
| 1 | x11111 | 2 |
| 2 | x22222 | 3 |
| 3 | x33333 | 4 |
Tbl2
| x | y |
|---|---|
| 2 | k22222 |
| 3 | k33333 |
| 4 | k44444 |
From Tbl2 the following rows are not included:
| 1| k11111 | => NOT INCLUDED!
| 5 | k55555 | => NOT INCLUDED!