0% found this document useful (0 votes)
18 views1 page

Assignment_2

Uploaded by

lizzmc
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views1 page

Assignment_2

Uploaded by

lizzmc
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

use IPL_DATABASE.

ipl_schema;

-- 1. How many players debuted in the year 2010 ?


select count(*) as debut_in_2010 from player_info
where IPL_DEBUT_YEAR = '2010'

-- 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%';

-- 4.Display the Indian Bowler who debuted in 2023


select player_name from player_info
where nationality ilike '%indian%' and ipl_debut_year = '2023' and player_role
ilike '%bowler%';

-- 5. Display players who is known for their explosive batting style


select * from player_info
where about ilike '%explosive%' and about ilike '%batting style%';

-- 6. Display number of boundaries scored by Deccan chargers


select sum( case when (runs_scored = 4 or runs_scored = 6) then 1 else 0 end) as
number_of_boundaries from ipl_ballbyball
where BATTING_TEAM ilike '%Deccan chargers%';

--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%';

You might also like