-
[classname] [nchar](20) NOT NULL,
CONSTRAINT [PK_class] PRIMARY KEY CLUSTERED
(
[classID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
2)course表
CREATE TABLE [dbo].[course](
[courseID] [int] NOT NULL,
[coursename] [nchar](20) NOT NULL,
[teacherID] [int] NULL,
CONSTRAINT [PK_course] PRIMARY KEY CLUSTERED
(
[coursename] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
ALTER TABLE [dbo].[course] WITH CHECK ADD CONSTRAINT [FK_course_teacher1] FOREIGN KEY([teacherID])
REFERENCES [dbo].[teacher] ([teacherID])
ALTER TABLE [dbo].[course] CHECK CONSTRAINT [FK_course_teacher1]
3)student表
CREATE TABLE [dbo].[student](
[studentID] [int] NOT NULL,
[name] [nchar](10) NOT NULL,
[sex] [nchar](2) NULL,
[birthday] [datetime] NULL,
[classID] [int] NULL,
CONSTRAINT [PK_student] PRIMARY KEY CLUSTERED
(
[studentID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
- .
- 总结资料-