Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

SQL! For the following schema, please help me with these 2 queries in SQL: 1. Fi

ID: 3724490 • Letter: S

Question

SQL!

For the following schema, please help me with these 2 queries in SQL:

1. Find the coach(es) (first name and last name) who have coached the largest number of players in year 2003

2. List the name(s) of school(s) that sent the second largest number of drafts to NBA. List the name of each school and the number of drafts sent.

COACHES SEASON cid ear r_ orderfirstname lastnameseason win season loss playoff win playoff loss tid TEAMS tid location name league PLAYERS ilkid firstname lastname position first season last seasonh feet hinches weigh college birthday PLAYER RS ilkid firstname lastname stl tid league minutes pts dreb oreb asts blk turnoverP Im PLAYER RS CAREER ilkid firstname lastname eague blk minutes pts dreb oreb reb asts turnover p fgm DRAFT draft year draft round selection tid firstname lastname ilkid draftfrom league

Explanation / Answer

Hi.. Please check below.

SQL!

For the following schema, please help me with these 2 queries in SQL:

1. Find the coach(es) (first name and last name) who have coached the largest number of players in year 2003.

Ans:
select a.firstname,a.lastname from COACHES_SEASON a, PLAYER_RS c where a.tid = c.tid and a.year = c.year and a.year=2013 HAVIING MAX(COUNT(ilkid));

2. List the name(s) of school(s) that sent the second largest number of drafts to NBA. List the name of each school
and the number of drafts sent.

Ans:

From the below data i didnt find any school name in the tables but any way i am assuming written the below querries.

select firstname,lastname from DRAFT where tid in (Select min(tid) from ( select top2 tid from DRAFT where draft_from='NBA' order by desc ) as tid)


Please check the above and let me know any issues. Thank you. All the best.