Consider the following relations about NBA: P LAY ER(pid, pname, nation). Each tuple describes a player with pid being the player’s id, pname his name, and nation his nationality. The table has a primary key pid. T EAM(tid, tname). Each tuple describes a team with tid being the team’s id, and tname
Consider the following relations about NBA:
P LAY ER(pid, pname, nation). Each tuple describes a player with pid being the player’s
id, pname his name, and nation his nationality. The table has a primary key pid.
T EAM(tid, tname). Each tuple describes a team with tid being the team’s id, and tname
its name. The table has a primary key tid.
REGIST ER(pid, tid, salary, year). Each tuple records the fact that a certain player (indicated by pid) played for a certain team (indicated by tid) in a specific year with an annual income given in salary. The table has a primary key (pid,year ). Note that a player may belong to different teams in different years.
(a) Find the names of the teams and the corresponding year that “Michael Jordan” ever played
for.
(b) Find the names of all players of the team “Heat” in year 2020.
(c) For each player, display his pid, and the first and last years in which he played.
(d) Find the pids of all players that played from 2010 through 2020 (i.e., such a player played
in all the years through 2010, 2011, 2012, ..., 2020).
Trending now
This is a popular solution!
Step by step
Solved in 2 steps