# Analysing CIA Factbook Data In SQL

Hello, I am looking for some feedback on this SQL project.
I mostly explored outside of the suggestions.
Also I need someone to double check the code for the last lines as it seems to suggest more people are migrating than there are alive.

Basics (3).ipynb (61.6 KB)

Also in GitHub format for those who prefer it:

1 Like

Thank you for sharing your project and welcome to the Community!

Answering your question about the last lines: since the `migration_rate` is in % here, you just need to divide the product of `population` and `migration_rate` by 100. Then you will have 9.62 mln, not bln people. By the way, in that code cell (and in some others around your project, for example in [20], [123]-[125]) there is no need to use CAST, since itâ€™s a multiplication here, not a division.

Below are some other comments from my side about your project:

• Itâ€™s a good practice to re-run the project when itâ€™s already finished. Then you will have all the code cells starting from 1 and all in order, without â€śjumpsâ€ť.
• Itâ€™s important to maintain a clear structure of the project: to have an introduction, a conclusion, enough markdown cells explaining the intermediate results (ideally, after each code cell there should be a markdown explanation of its results), project sections with proper subheadings.

Interestingly seems to be no negative growths on the factbook, this seems unlikely.

Well, totally agree, I was surprised about it as well

• The code cell [60]. Iâ€™m just curious how the numbers in the WHERE condition were estimated. Probably, you should add some markdown comments on them.
• The code cell [123] and some subsequent ones. Remember that `birth_rate` and `death_rate` are actually not in % (like it was with `migration_rate`) but in â€śnumber of births per 1,000 personsâ€ť and â€śnumber of deaths per 1,000 personsâ€ť correspondingly. So you cannot just multiply their difference by `population`. If you want to find a so-called natural increase here, you should just find the difference `birth_rate` - `death_rate`. This value will be exactly a â€śnatural increase per 1,000 personsâ€ť (or a natural decrease, if negative).

For the rest, good job and nice project.
Hope my feedback was helpful. Happy learning!

2 Likes

Thank you so much for the feedback. Very helpful!
Thank you for spotting those errors, I will get them fixed.
I hard coded certain WHERE conditions to get the right rows that I thought look visually nice.

1 Like