Analysis of International IQ using SQL

Amruha AhmedAmruha Ahmed
3 min read

Intelligence Quotient, popularly known as IQ, is a standard test tailored to evaluate the intelligence of a person. It serves as an indication of how well a person applies their skills to solve a problem.

In this blog post, I have analyzed the ranking of various countries based on the average IQ and the number of participants using SQL.

About the Dataset:

I have used the following dataset to gather insights:

https://www.kaggle.com/datasets/zsinghrahulk/international-iq-by-countries

The columns in this dataset are as follows:

  1. Ranking of the country

  2. Name of the Country

  3. Average IQ of the Country

  4. Number of Participants(i.e. test-takers) of each Country.

These rows and columns have been stored in a table which I have named ‘iqtable’.

Data Cleaning:

Finding the count of records in the table:

select count(*) from iqtable;

The result is:

125

Checking for any Null values in the table:

select * from iqtable where Ranking is NULL or Country is NULL or Average_IQ is NULL or Participants is NULL;

The result is:

53| |97.37|3816

In this record, the value of Country is null, hence we will drop this record.

Dropping the record where Null value is present:

delete from iqtable where Country is NULL;

The record containing null value has been dropped using the above query. In order to check whether the change has been made to the iqtable or not, the following query is written:

select count(*) from iqtable;

The result is:

124

The change has successfully been made and one record has been deleted. You may also execute the following query to check for any null values persisting in the iqtable:

select * from iqtable where Ranking is NULL or Country is NULL or Average_IQ is NULL or Participants is NULL;

No output is given, hence the record containing null value is successfully removed.

Analysing the Average IQ Attribute:

Checking the average IQ of all countries under consideration:

select avg(Average_IQ) from iqtable;

The result is:

95.8275806451613

Determining the top 5 countries with the highest IQ:

select Country from iqtable order by Average_IQ desc limit 5;

The output is:

Japan

South Korea

China

Iran (Islamic Republic of)

Singapore

Japan takes the spot for the country with the highest average IQ.

Finding the count of countries having IQ greater than or equal to the average IQ of all countries:

select count(*) from iqtable where Average_IQ>=(select avg(Average_IQ) from iqtable);

The result is:

69

Finding the count of countries having IQ less than the average IQ of all countries:

select count(*) from iqtable where Average_IQ<(select avg(Average_IQ) from iqtable);

The result is:

55

Analysing the Participants Attribute:

The Participants attribute indicates the number of people who have attempted the IQ test in that particular country.

Determining the average number of participants from all countries in the table:

select avg(Participants) from iqtable;

The output is:

12598.1209677419

This can be rounded off to about 12598 participants on average for each country.

Finding the count of countries having the number of participants less than the average number of participants of all countries:

select count(*) from iqtable where Participants<(select avg(Participants) from iqtable);

The result is :

95

Finding the count of countries having the number of participants greater than or equal to the average number of participants of all countries:

select count(*) from iqtable where Participants>=(select avg(Participants) from iqtable);

The result is:

29

Determining the top 5 countries with the most participants:

select Country from iqtable order by Participants desc limit 5;

The output is:

China

Indonesia

Japan

South Korea

Ukraine

China has the highest number of people taking the IQ test.


Found this article interesting? Give it a like and share it with your friends !!

#datascience #data #dataanalysis #datanalytics #insight #insights #sql #iq #intelligence #iqtest

1
Subscribe to my newsletter

Read articles from Amruha Ahmed directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Amruha Ahmed
Amruha Ahmed