Dear Learner,

Hope you are doing great.

Please have a look on the below details for your reference.

Create table in hive for colours in flag

CREATE EXTERNAL TABLE country_flagcolour_count(

colourname string,

colourcount int

)


ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t'


LOCATION '/tmp/project/country/flagcolourcount';


--Find most common colour among flags from all countries.


SELECT colourname, colourcount FROM country_flagcolour_count JOIN (SELECT max(colourcount) AS maxcolourcount FROM country_flagcolour_count) maxcount WHERE maxcount.maxcolourcount = colourcount;


If you have any further query,please let us know.