IF EXISTS(SELECT * FROM sysobjects WHERE name='learnRecord') DROP TABLE learnRecord GO CREATE TABLE [learnRecord]( [lid] int NOT NULL CONSTRAINT [FK_pt_learnRecord_learnSubject] REFERENCES [learnSubject]([id])ON UPDATE CASCADE ON DELETE CASCADE, [sid] int NOT NULL CONSTRAINT [FK_pt_learnRecord_subjectClass] REFERENCES [subjectClass]([ID])ON UPDATE CASCADE ON DELETE CASCADE, [stype] char(2) NULL, [kid] int not null, [answer]nvarchar(20) null, [result] bit null, [createTime] [datetime] NOT NULL DEFAULT (getdate()), ) GO