POSSIBLE HELPER BELOW: - MAY OR MAY NOT NEED B) Write and run the following quer
ID: 3906466 • Letter: P
Question
POSSIBLE HELPER BELOW: - MAY OR MAY NOT NEED
B) Write and run the following queries (50 points) 1. Print the player_ids and names of players of Point guards drafted after the year 2000 2. Print the name and city of arenas that hosted a team from LA. Do this query in two ways (i) as a flat select (ii) completely nested, i.e., using sub queries so as to avoid all JOIN clauses Print the names of arenas that hosted a team from Charlotte and hosted a Shooting guard 3. 4. Print the names of players who have the letters 'on' in their name 5. Print the names of arenas that hosted a team from Charlotte but did not host a Shooting guard 6. Print the player_id and average points scored of players who scored an average of points that is greater than the average of points scored in arena 1 7. Print the arena name & city of arenas that did not host the Bulls team 8. Print the names of all retired players 9. Print the names of arena cities that hosted a player whose name begins with a T'Explanation / Answer
1)select player_id,pname
from player
where position='Point guard' and Draft_year>2000
2)select Aname,city from
Arena A
inner join Team_player_arena TPA
on A.Arena_ID=TPA.Arena_ID
where TPA.Team_ID in (select team_id
from team
where city='LA')
ii)select A.Aname,A.city
from Arena A,Team T
where T.city='LA'
3)select Aname
from Team_player_Arena TPA
inner join Arena A
on A.Arena_ID=TPA.Arena_id
inner join Player P
on TPA.Player_id=P.Player_id
inner join Team T
on TPA.Team_id=T.Team_ID
where P.Position='Shooting guard' and T.city='charlotte'
4)select Pname
from Player
where Pname like '%on%'
5)select Aname
from Team_player_Arena TPA
inner join Arena A
on A.Arena_ID=TPA.Arena_id
inner join Player P
on TPA.Player_id=P.Player_id
inner join Team T
on TPA.Team_id=T.Team_ID
where P.Position<>'Shooting guard' and T.city='charlotte'
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.