Basically its what the title says. This is my code.
USE Assignment2;
GO
/* Player View (2 marks)
Create a view which shows the following details of all
Batches are delimited by the word GO
- which is an instruction to client tools, not to SQL Server, specifically telling those tools how to split your query into batches.
The error tells you that CREATE VIEW
must be the first statement in a batch:
USE Assignment2;
GO
/* Player View (2 marks)
Create a view which shows the following details of all players:
• The ID number of the player
• The first name and surname of the player concatenated and given an alias of “full_name”
• The team ID number of the player (if applicable)
• The team name of the player (if applicable)
• The coach ID number of the player (if applicable)
• The name of the player’s coach (if applicable)
Creating this view requires a select statement using multiple joins and concatenation of names.
Make sure that you use the appropriate type of join to ensure that players without teams or coaches are still included in the results.
*/
-- Write your Player View here
PRINT 'Creating Player View'
GO -->-- New GO here
CREATE VIEW playerView AS
So I've added a GO
before CREATE VIEW