create table Course( course_id char(20), course_name char(5), teacher_name varchar(30), mark int check (mark between 0 and 10), times int check (times >0), adress char(30) )
ALTER TABLE Course
ALTER COLUMN course_id char(20) NOT NULL;
go
ALTER TABLE Course
ADD CONSTRAINT pk_course_id PRIMARY KEY(course_id);
go
------解决方案--------------------
SQL code
ALTER TABLE Course
ALTER COLUMN course_id char(20) NOT NULL
GO
ALTER TABLE Course
ADD CONSTRAINT pk_course_id PRIMARY KEY(course_id)
GO
------解决方案--------------------