Icon

07 Join and Concatenate - Solution

Solution to an exercise for joining and concatenating data.

Join tables with different information for the same ID. Concatenate tables with the same information for different IDs.

CHECK YOUR ANSWERS:
1. The joined table contains 174 rows. Some rows were discarded in the joining operation. This is because not all countries are present or spelled equally in all tables. After editing the names of three countries manually, the joined table contains 177 rows.
2. The Rank column is populated with missing values in the concatenated table when "Use union of columns" is selected



Exercise: Concatenate1) Read the life expectancy data from two sources: an Excel sheet that contains the data for countries and adatabase table that contains the data for continents.2) Concatenate them into one table. Use union of columns. What happens to the Rank column that ismissing in the top table? Exercise: Join1) Read the population, life expectancy, geo coordinates, and travel advisories data by executing the readernodes below2) Join all tables based on the names of the countries. Use inner join. How many rows are there in the finaljoined table? Were any rows discarded during the joining operation?3) OPTIONAL: The names of the following countries are written differently in the travel advisories tablecompared to the other tables. The spelling in the other tables is shown in brackets:- The Gambia (Gambia)- Guinea Bissau (Guinea-Bissau)- The Bahamas (Bahamas)Edit the country names in the travel advisories table manually with the Table Editor node. Join the edited tablewith the other tables. How many rows are there in the joined table now? Demographics.sqliteLifeExpectancyManual manipulationLE for countriesand continentsdemographics.xlsx(life_expectancy)demographics.xlsx(population)demographics.xlsx(life_expectancy)geo_coordinates.tabletravel_advidories.csvInner join on country nameInner join on country nameInner join on country name SQLite Connector DB Table Selector DB Reader Table Editor Concatenate Excel Reader Excel Reader Excel Reader Table Reader CSV Reader Joiner Joiner Joiner Exercise: Concatenate1) Read the life expectancy data from two sources: an Excel sheet that contains the data for countries and adatabase table that contains the data for continents.2) Concatenate them into one table. Use union of columns. What happens to the Rank column that ismissing in the top table? Exercise: Join1) Read the population, life expectancy, geo coordinates, and travel advisories data by executing the readernodes below2) Join all tables based on the names of the countries. Use inner join. How many rows are there in the finaljoined table? Were any rows discarded during the joining operation?3) OPTIONAL: The names of the following countries are written differently in the travel advisories tablecompared to the other tables. The spelling in the other tables is shown in brackets:- The Gambia (Gambia)- Guinea Bissau (Guinea-Bissau)- The Bahamas (Bahamas)Edit the country names in the travel advisories table manually with the Table Editor node. Join the edited tablewith the other tables. How many rows are there in the joined table now? Demographics.sqliteLifeExpectancyManual manipulationLE for countriesand continentsdemographics.xlsx(life_expectancy)demographics.xlsx(population)demographics.xlsx(life_expectancy)geo_coordinates.tabletravel_advidories.csvInner join on country nameInner join on country nameInner join on country nameSQLite Connector DB Table Selector DB Reader Table Editor Concatenate Excel Reader Excel Reader Excel Reader Table Reader CSV Reader Joiner Joiner Joiner

Nodes

Extensions

Links