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

**Write SQL INSERT commands to populate the tables with the following data:** Co

ID: 3680977 • Letter: #

Question

**Write SQL INSERT commands to populate the tables with the following data:**

Consider the following relational database for the Super Baseball League. It keeps track of teams in the league, coaches and players on the teams, work experience of the coaches, bats belonging to each team, and which players have played on which teams. Note the following facts about this environment:

? The database keeps track of the history of all of the teams that each player has played on and all of the
players who have played on each team.
? The database only keeps track of the current team that a coach works for.
? Team number, team name, and player number are each unique attributes across the league.
? Coach name is only unique within a team (and we assume that a team cannot have two coaches of the
same name.)
? Serial number (for bats) is only unique within a team.
? In the Affiliation table, the Years attribute indicates that number of years that a player played on a team;
the batting average is for the years that a player played on a team.

TABLES:

DATA TO INSERT:

AFFILIATION PLAYER Column Name Data Type Allow Nulls Column Name Data Type Allow Nulls int AFFILIATION PLAYERNLM FK PLAYERNUM BATTINGAVERAGE TEAMNUNM PLAYERNUM int varchan 20) int PLAYERNAME int AGE int WORKEXPERIENCE Column Name Data Type Allow Nulls AFFILIATION TENMINIM FK EXPERIENCETYP YEARS EXPERIENCE TEAMNUM COACHNAME varchan(20) int int varchan(20) TEAM Column Name Data Type Allow Nulls TEAMNUM TEAMNAME CITY MANAGER WORKEXPERI COACH TENMUM FK BATS TEANNUM FK COACH BATS Column Name Data Type Allow Nulls Coumn Name Data Type Allow Nulls SERIALNUM MANUFACTURER TEAMNUM COACHNAME TELEPHONE TEAMNUNM varcharí20) varchar(10) int varchar 20) varchar(20

Explanation / Answer

Hi, Please find below insert scripts for tables.

AFFILIATION TABLE:

insert into Affiliation(years, Battingaverage, teamnum, playernum) values('2','321','1','10');
insert into Affiliation(years, Battingaverage, teamnum, playernum) values('3','322','2','11');
insert into Affiliation(years, Battingaverage, teamnum, playernum) values('2','323','3','12');
insert into Affiliation(years, Battingaverage, teamnum, playernum) values('3','324','4','13');
insert into Affiliation(years, Battingaverage, teamnum, playernum) values('1','325','5','14');
insert into Affiliation(years, Battingaverage, teamnum, playernum) values('4','326','6','15');
insert into Affiliation(years, Battingaverage, teamnum, playernum) values('3','327','7','16');

BATS TABLE:

insert into bats(serialnum, manufacturer, teamnum) values('1','WBA','1');
insert into bats(serialnum, manufacturer, teamnum) values('2','WBB','2');
insert into bats(serialnum, manufacturer, teamnum) values('3','WBC','3');
insert into bats(serialnum, manufacturer, teamnum) values('4','WBD','4');
insert into bats(serialnum, manufacturer, teamnum) values('5','WBF','5');
insert into bats(serialnum, manufacturer, teamnum) values('6','WBG','6');
insert into bats(serialnum, manufacturer, teamnum) values('7','WBH','7');

COACH TABLE:

insert into coach(coachname, telephone, teamnum) values('BINGO','5551217','3');
insert into coach(coachname, telephone, teamnum) values('DODGER','5551232','2');
insert into coach(coachname, telephone, teamnum) values('POKEY','5551216','5');
insert into coach(coachname, telephone, teamnum) values('ROGER','5551212','1');
insert into coach(coachname, telephone, teamnum) values('RUDY','5551212','3');
insert into coach(coachname, telephone, teamnum) values('TAYLOR','5551242','3');
insert into coach(coachname, telephone, teamnum) values('WONDERBOY','5551212','7');

PLAYER TABLE:

insert into player(playernum, playername, age) values('10','MARTY','14');
insert into player(playernum, playername, age) values('11','AGRTY','15');
insert into player(playernum, playername, age) values('12','ARRTY','14');
insert into player(playernum, playername, age) values('13','ARTTY','16');
insert into player(playernum, playername, age) values('14','ARTYB','15');
insert into player(playernum, playername, age) values('15','ARTEY','15');
insert into player(playernum, playername, age) values('16','ARTYY','14');

TEAM TABLE:

insert into team (teamnum, teamname, city, manager) values('1','ATHLETICS','OAKLAND', 'ROGER');
insert into team (teamnum, teamname, city, manager) values('2','ASTROS','HOUSTON', 'DODGER');
insert into team (teamnum, teamname, city, manager) values('3','YANKEES','NEW YORK', 'TOYLOR');
insert into team (teamnum, teamname, city, manager) values('4','MARLINS','MIAMI', 'RUDY');
insert into team (teamnum, teamname, city, manager) values('5','MARINERS','SEATTLE', 'POKEY');
insert into team (teamnum, teamname, city, manager) values('6','TIGERS','DETROIT', 'BINGO');
insert into team (teamnum, teamname, city, manager) values('7','ROYALS','KC', 'WONDERBOY');

WORKEXPERIENCE TABLE:

insert into workexperience (experiencetype, yearsexperience, teamnum, coachname) values('COLLEGE COACH','10','1', 'ROGER');
insert into workexperience (experiencetype, yearsexperience, teamnum, coachname) values('HIGH SCHOOL','5','2', 'DODGER');
insert into workexperience (experiencetype, yearsexperience, teamnum, coachname) values('LIMITED','7','3', 'BINGO');
insert into workexperience (experiencetype, yearsexperience, teamnum, coachname) values('LOTS','25','4', 'POKEY');
insert into workexperience (experiencetype, yearsexperience, teamnum, coachname) values('NONE','1','5', 'TOYLOR');
insert into workexperience (experiencetype, yearsexperience, teamnum, coachname) values('PRO','30','6', 'WONDERBOY');
insert into workexperience (experiencetype, yearsexperience, teamnum, coachname) values('SOME','5','7', 'RUDY');