I have the next database with country, year, and GDP:
What I have
| Country | Year | GDP |
|---|---|---|
| Afghanistan | 1950 | $123 |
| Afghanistan | 1951 | $123 |
| Afghanistan | 2019 | $123 |
| Australia | 1945 | $123 |
| Australia | 2021 | $123 |
And what I need is to create or delete rows so each country has rows from 1948 to 2021. So, for example, for Afghanistan I need to create rows 1948 to 1949 and 2021 with a null GDP, and for Australia delete the 1945 row and create everything in between.
This isn't my exact database, I have 200+ countries each with different years. Is there a way to create this easily?
What I need
| Country | Year | GDP |
|---|---|---|
| Afghanistan | 1948 | NA |
| ... | ... | ... |
| Afghanistan | 2021 | NA |
| Australia | 1948 | $123 |
| ... | ... | ... |
| Australia | 2021 | $123 |