Assignment_2
Assignment_2
ipl_schema;
-- 2. Display all the New Zealand players whose age is greater then 30?
select * from player_info
where NATIONALITY ilike '%New Zealand%' and (current_date - date_of_birth::DATE) >
30;
-- 3. Display all the names of players who has Patel as their last name ?
select player_name from player_info
where PLAYER_NAME ilike '% patel%';
--7. Display the matches who scored more than 50 runs in powerplay playing first
innings
select distinct(match_id) from team_performance
where powerplay_scores > 50 and toss_decision = 'bat';
--8. Display players who are right hand batsmen and a left arm bowler
select * from player_info
where BATTING_STYLE ilike '%right%' and BOWLING_STYLE ilike '%left%';
--9. What was the score on the 50th ball when KKR played RCB in 2007/08 season
select score from ipl_ballbyball
where ball_number = 8.2 and season = '2007/08' and( batting_team in ('Kolkata
Knight Riders', 'Royal Challengers Bangalore') and bowling_team in ('Kolkata Knight
Riders', 'Royal Challengers Bangalore'));
--10. How many players has their DOB in the month of January
select count(*) as num_jan_dob from player_info
where DATE_OF_BIRTH ilike '%jan%';