Manual database of all world countries, cities, and populations. This project focuses on data manipulation and query implementation with functions, classes, and tests.
- paises.csv
- cidades.csv
- populacao.csv
These are the CSV (comma-separated value) files used in the project, located in the "test-files" folder. The files are obtained from public datasets:
https://stefangabos.github.io/world_countries/
https://www.kaggle.com/datasets/max-mind/world-cities-database
https://www.kaggle.com/datasets/joebeachcapital/world-population-data
-
Copy the "src" folder and paste it into the root directory of your IntelliJ workspace.
-
Copy the "test-files" folder (note that these files are large, containing thousands of lines) and paste it into the root directory of your IntelliJ workspace.
Optional: you can add three small files with the exact name (under explained) in "test-files" folder, the basic structure of the files are:
file_name: "paises.csv"
alfa2,cidade,regiao,populacao,latitude,longitude
ad,andorra la vella,07,20430.0,42.5,1.5166667
ad,canillo,02,3292.0,42.5666667,1.6
ad,encamp,03,11224.0,42.533333299999995,1.5833333
ad,la massana,04,7211.0,42.55,1.5166667
ao,binga,06,,-10.399486,14.76953
ao,bissadi,15,,-6.331073,16.15173
ao,caala,08,21205.0,-12.8525,15.560556
ao,cabinda,03,66020.0,-5.55,12.2
ao,caconda,09,10551.0,-13.733332999999998,15.066667
ao,calonda quarto,17,,-8.51248,20.549670000000003
ao,caluquembe,09,30305.0,-13.783332999999999,14.683333
ao,camabatela,05,12839.0,-8.18812,15.37495
----------------------Separator----------------
file_name: "cidades.csv"
id,alfa2,alfa3,nome
4,af,afg,Afeganistão
710,za,zaf,África do Sul
8,al,alb,Albânia
276,de,deu,Alemanha
20,ad,and,Andorra
24,ao,ago,Angola
----------------------Separator----------------
file_name: "populacao.csv"
id,ano,populacao masculina,populacao feminina,densidade
108,1950,1079773,1174340,86.8637
108,1951,1104544,1198705,88.7571
108,1952,1128810,1222726,90.6179
108,1953,1152736,1246363,92.4508
108,1954,1176706,1270051,94.2874
232,2017,1673563,1723370,28.0405
232,2018,1697963,1747412,28.4403
232,2019,1724860,1773958,28.8815
232,2020,1753513,1802355,29.3524
232,2021,1785840,1834472,29.8844
232,2022,1817878,1866154,30.4104
232,2023,1850523,1898379,30.9458
232,2024,1885109,1932542,31.5133
-
In case of a compilation error, ensure that all the necessary Java utilities are included in the project. Example:
- If there are no errors, you are ready to run the project. Locate the Main class and click the run button.
The program will display a list of commands that you can choose from to interact with the information, such as adding a new "imaginary" city or removing a country.