Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This assignment will cover the basics: CRUD Statements ( INSERT , SELECT, UPDATE, and DELETE ) Basic single table SELECTs, JOINS or multi - table
This assignment will cover the basics:
CRUD Statements INSERT SELECT, UPDATE, and DELETE
Basic single table SELECTs,
JOINS or multitable SELECTs,
Grouping or Aggregate Functions,
SubQueries, and
SET Operators
Submission
Each student will submit a single sql file with appropriate commenting such that the entire file will run at once. That is the header and question labelling should be commented out and the answers in SQL should NOT be commented out. You should copy the question into a comment block before each answer in the SQL file for future reference.
Tasks
Create an SQL statement that adds yourself to the Players table. Use your real first and last names, your real dob, and use your studentID as the regNumber. Make yourself active and use a playerID of your own choice.
Create an SQL statement that change your professors whom is a player in the database dob to be May
Create a statement that adds both yourself and your professor to the team called Noobs making yourself active and your professor not active. Choose a jersey number for yourself and use number for your prof.
Create a query that outputs the team roster for all active teams in the league. Include the player names, jersey number, and team name in each row, making sure that players on the same team are together in the output, further sorted by last name, then by first name.
Create a query that outputs the league schedule game number, date, both team names, and location name for all future games, or games not yet played. Sort the output in ascending chronological order. Use JOIN and not subqueries.
Repeat Question but use subqueries to obtain the team names, rather than JOINS. You may still use JOINS for other output if required. Note: you should obtain the exact same output in Q and Q
Take the statement from either Q or Q and store it in the database as a view, called vwFutureGames. Then create a query that uses the view to output the exact same results, including sorting.
Create a query that outputs the names of the soccer fields locations in the database that have never been assigned a game within the league. You may NOT use JOINS or SubQueries in the main statement, but you may use a subquery to obtain the names afterwards.
Repeat Question using JOINS and NOT set operators.
Create a query that outputs the number of games each team has played as the home team and how many games they have played as the away team as of today. You may assume that the isPlayed field is up to date. A sample of the output might look like this:
TEAMID TEAMNAME HOMEGAMES AWAYGAMES
kickers
wannabees
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored 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