I. CREATE the following 2 tables – a. Create the players Table using Right Click – New Table b. Create the coaches Table using a CREATE Table Statement USE the following Statements to enter 1 record into the Players & Coaches Table c. INSERT INTO dbo.Players VALUES 1,’Running Back’,22,’1/1/2012′ INSERT INTO dbo.Coaches VALUES 1,’John Starks’,’Running Back Coach’,’1/1/2012′ d.  INSERT 10 More Records into each table and answer the following Questions. If your confused on what type of data to insert, just make it up and adjust them to the SQL Statements you will produce below. II. Retrieve All Players with Jersey numbers in the 20’s III. Retrieve All Coaches with CoachID less than 5 IV. Retrieve All players who joined the team this year. V. Retrieve All coaches who joined the team last year. VI. Retrieve All players with PlayerID greater than 5 VII. Retrieve All running backs VIII. Retrieve All Quarter Back Coaches e. Create a player backup table (player_backup) using the SELECT INTO statement

To complete this assignment, I will provide the necessary SQL statements to achieve each task mentioned. I will also provide explanations for each statement to ensure a clear understanding.

I. Create tables:

a. To create the players table, we can use the following SQL statement:

“`sql
CREATE TABLE players (
playerID INT,
position VARCHAR(50),
jerseyNumber INT,
dateJoined DATE
);
“`

b. To create the coaches table, we can use the following SQL statement:

“`sql
CREATE TABLE coaches (
coachID INT,
coachName VARCHAR(50),
specialty VARCHAR(50),
dateJoined DATE
);
“`

II. Retrieve All Players with Jersey numbers in the 20’s:

To retrieve all players with jersey numbers in the 20’s, we can use the following SQL statement:

“`sql
SELECT * FROM players WHERE jerseyNumber >= 20 AND jerseyNumber < 30; ``` This will return all the players whose jersey numbers fall within the range of 20 to 29. III. Retrieve All Coaches with CoachID less than 5: To retrieve all coaches with a coachID less than 5, we can use the following SQL statement: ```sql SELECT * FROM coaches WHERE coachID < 5; ``` This will return all the coaches whose coachID is less than 5. IV. Retrieve All players who joined the team this year: To retrieve all players who joined the team this year, we can use the following SQL statement: ```sql SELECT * FROM players WHERE YEAR(dateJoined) = YEAR(GETDATE()); ``` This will return all the players whose date of joining is in the current year. V. Retrieve All coaches who joined the team last year: To retrieve all coaches who joined the team last year, we can use the following SQL statement: ```sql SELECT * FROM coaches WHERE YEAR(dateJoined) = YEAR(GETDATE()) - 1; ``` This will return all the coaches whose date of joining is in the previous year. VI. Retrieve All players with PlayerID greater than 5: To retrieve all players with a playerID greater than 5, we can use the following SQL statement: ```sql SELECT * FROM players WHERE playerID > 5;
“`

This will return all the players whose playerID is greater than 5.

VII. Retrieve All running backs:

To retrieve all running backs, we can use the following SQL statement:

“`sql
SELECT * FROM players WHERE position = ‘Running Back’;
“`

This will return all the players whose position is “Running Back.”

VIII. Retrieve All Quarter Back Coaches:

To retrieve all Quarter Back Coaches, we can use the following SQL statement:

“`sql
SELECT * FROM coaches WHERE specialty = ‘Quarter Back Coach’;
“`

This will return all the coaches whose specialty is “Quarter Back Coach.”

e. Create a player backup table (player_backup) using the SELECT INTO statement:

To create a player backup table using the SELECT INTO statement, we can use the following SQL statement:

“`sql
SELECT * INTO player_backup FROM players;
“`

This will create a new table called player_backup with the same structure and data as the players table.

These SQL statements should help to answer the questions in the assignment and complete the given tasks.

Need your ASSIGNMENT done? Use our paper writing service to score better and meet your deadline.


Click Here to Make an Order Click Here to Hire a Writer