I am lerning and need help - what is wrong with this query.?

USE BalloonShop

GO

CREATE TABLE [dbo].[Department](
[DepartmentID] [int] IDENTITY(1,1) NOT NULL,
[Name] nvarchar NOT NULL,
[Description] nvarchar NULL,
CONSTRAINT [PK_Department] PRIMARY KEY CLUSTERED)

I have this messages :
Msg 8135, Level 16, State 0, Line 5
Table level constraint does not specify column list, table 'dbo.Department'.

How I can fix it?
Thanks for help.

You need to tell SQL what column(s) you want the primary key to be created on / consist of:

CONSTRAINT [PK_Department] PRIMARY KEY CLUSTERED (DepartmentID) )

1 Like

Thanks a lot. I have lot to learning.