Q.. How many olympics games have been held?
 SELECT COUNT(DISTINCT noc) FROM olympics_history;

 SELECT COUNT(games) FROM olympics_history;


SELECT COUNT(DISTINCT games) FROM olympics_history;

Q..List down all Olympics games held so far.
SELECT COUNT(DISTINCT Year,Season) FROM olympics_history order by Year;

Q1..how many olympic games have been held
SELECT DISTINCT(games) from olympics_history;

Q.. List down all Olympics games held so far.
select distinct oh.year,oh.season,oh.city from olympics_history oh order by year;


Q2..List down all Olympics games held so far.
select distinct year,season,city from olympics_history order by year;

Q6..Identify the sport which was played in all summer olympics.
select distinct games,sport from olympics_history where season = 'Summer' ; 
Select count(distinct games)as total_games FROM olympics_history where Season ='Summer' ;
select distinct games,count(1) as no_of_sports from olympics_history;

Q3..Mention the total no of nations who participated in each olympics game?
select games,count(noc) as no_of_Nations from olympics_history group by games;
select a.games count(a.noc)from (select games, noc from 'olympic_history'group by ganes.noc)a

Q19..In which Sport/event, India has won highest medals??
select team, sport,count(1) as total_medals from olympics_history where team = 'India' group by sport order by total_medals desc limit 1;

Q3..Mention the total no of nations who participated in each olympics game?
select games,count(noc) as no_of_Nations from olympics_history group by games ;

Q4..Which year saw the highest and lowest no of countries participating in olympics?
select year , count(distinct noc) nations from olympics_history group by year order by nations asc limit 1 ;

Q20..Break down all olympic games where india won medal for Hockey and how many medals in each olympic games.
 select e.team, e.sport, e.games, COUNT(*)as total_medals from olympics_history e where e.team = 'India' AND e.sport = 'Hockey' group by e.team,e.sport,e.games ;

Q8..Fetch the total no of sports played in each olympic games.
select games, count(distinct(sport))as no_of_sports from olympics_history group by games order by no_of_sports desc;