Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write some SQL queries. The database contains the following six tables: Not allowed to reference any other tables in your SQL queries. Schema: Your goal
Write some SQL queries. The database contains the following six tables:
Not allowed to reference any other tables in your SQL queries. Schema: Your goal for this project will be to write 5 SELECT queries to answer the 5 questions below. Note that you should use the cid, ilkid, and tid fields to identify coaches, players, and teams, as there may be coaches, players, and teams that share the same name.
COACHES SEASON cid ear r order firstname lastname season_win season_loss playoff_win playoff_loss tid TEAMS tid location name league PLAYERS ilkid firstname lastname position first season last season h feet h inches weight college birthday PLAYER RS ilkid re PLAYER RS CAREER lastnametid blk league pts oreb firstname stl ear minutes asts turnoverp ga ftm im firstname lastname league blk ilkid minutes pts dreb oreb reb asts turnoverp ga pm DRAFI draft vear draft round selection tid firstname lastname ilkid draft from league 6. Find the coaches (first name, last name, and cid) who have coached in every league. 7. Find everyone who was a coach and player in the same season, but for different teams. List their first name, last name, the season, and both teams every time this happened. Order the results from oldest to most recent, 8. Find all players who scored more points than Michael Jordan. Print their first name, last name, and 9. Find the second most successful coach (first name and last name) in the database, where success is 10. Find the 3 schools that sent the most players to the NBA draft. Print the name of each school and how many more points they scored than Michael. measured as season-win / (season-win + seasonss) across all of the seasons they coached. how many players they sent, in decreasing order COACHES SEASON cid ear r order firstname lastname season_win season_loss playoff_win playoff_loss tid TEAMS tid location name league PLAYERS ilkid firstname lastname position first season last season h feet h inches weight college birthday PLAYER RS ilkid re PLAYER RS CAREER lastnametid blk league pts oreb firstname stl ear minutes asts turnoverp ga ftm im firstname lastname league blk ilkid minutes pts dreb oreb reb asts turnoverp ga pm DRAFI draft vear draft round selection tid firstname lastname ilkid draft from league 6. Find the coaches (first name, last name, and cid) who have coached in every league. 7. Find everyone who was a coach and player in the same season, but for different teams. List their first name, last name, the season, and both teams every time this happened. Order the results from oldest to most recent, 8. Find all players who scored more points than Michael Jordan. Print their first name, last name, and 9. Find the second most successful coach (first name and last name) in the database, where success is 10. Find the 3 schools that sent the most players to the NBA draft. Print the name of each school and how many more points they scored than Michael. measured as season-win / (season-win + seasonss) across all of the seasons they coached. how many players they sent, in decreasing orderStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started