码迷,mamicode.com
首页 > 其他好文 > 详细

MySchool

时间:2016-04-06 23:06:22      阅读:326      评论:0      收藏:0      [点我收藏+]

标签:

USE [MySchool]
GO
/****** Object:  Table [dbo].[Grade]    Script Date: 08/06/2014 15:03:17 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Grade](
    [GradeId] [int] IDENTITY(1,1) NOT NULL,
    [GradeName] [nvarchar](50) NOT NULL,
 CONSTRAINT [PK_Grade_1] PRIMARY KEY CLUSTERED 
(
    [GradeId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY],
 CONSTRAINT [IX_Grade_GradeName] UNIQUE NONCLUSTERED 
(
    [GradeId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[Grade] ON
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (1, NS1)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (2, NS2)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (3, NY2)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (4, N精英班)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (11, Nzhanan)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (12, NS1288无敌班)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (13, N高一二班)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (14, N高一三班)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (15, N高一一班)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (16, N高一1班)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (17, N高一2班)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (18, N高一3班)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (19, Naa)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (20, Nmine)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (21, Nmine)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (22, Nmine)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (23, Nmine)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (26, N无敌S2214)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (27, N无敌S2214)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (28, N好人2214)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (30, Naa)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (31, Nbb)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (32, Ncc)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (33, Ndd)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (34, NS2216)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (48, NS2216第二个班)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (49, NS2216终结版)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (51, NJDBC测试啊啊啊啊)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (52, NJDBC测试啊啊啊啊2)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (53, NJDBC测试啊啊啊啊2)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (54, NDBC啊速度速度)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (55, NDBC阿萨德完全)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (56, NDBC阿萨德完全)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (57, NDBC阿萨德完全)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (58, Naa)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (59, Nbb)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (60, Naaa‘‘‘)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (61, Nccc)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (62, N1)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (63, Ns1)
SET IDENTITY_INSERT [dbo].[Grade] OFF
/****** Object:  Table [dbo].[Subject]    Script Date: 08/06/2014 15:03:17 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Subject](
    [SubjectId] [int] IDENTITY(1,1) NOT NULL,
    [SubjectName] [nchar](10) NOT NULL,
    [ClassHour] [int] NULL,
    [GradeId] [int] NOT NULL,
 CONSTRAINT [PK_Subject] PRIMARY KEY CLUSTERED 
(
    [SubjectId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[Subject] ON
INSERT [dbo].[Subject] ([SubjectId], [SubjectName], [ClassHour], [GradeId]) VALUES (1, Noop       , 78, 1)
INSERT [dbo].[Subject] ([SubjectId], [SubjectName], [ClassHour], [GradeId]) VALUES (2, Njava      , 67, 2)
INSERT [dbo].[Subject] ([SubjectId], [SubjectName], [ClassHour], [GradeId]) VALUES (3, NC#        , 78, 3)
INSERT [dbo].[Subject] ([SubjectId], [SubjectName], [ClassHour], [GradeId]) VALUES (4, N分层开发      , 24, 2)
SET IDENTITY_INSERT [dbo].[Subject] OFF
/****** Object:  Table [dbo].[Student]    Script Date: 08/06/2014 15:03:17 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Student](
    [StudentNo] [int] IDENTITY(1000,1) NOT NULL,
    [LoginPwd] [nvarchar](50) NOT NULL,
    [StudentName] [nvarchar](50) NOT NULL,
    [Gender] [char](1) NULL,
    [GradeId] [int] NOT NULL,
    [Phone] [nvarchar](255) NULL,
    [Address] [nvarchar](255) NULL,
    [Birthday] [datetime] NULL,
    [Email] [nvarchar](50) NULL,
    [MyTT] [int] NULL,
 CONSTRAINT [PK_Student] PRIMARY KEY CLUSTERED 
(
    [StudentNo] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[Student] ON
INSERT [dbo].[Student] ([StudentNo], [LoginPwd], [StudentName], [Gender], [GradeId], [Phone], [Address], [Birthday], [Email], [MyTT]) VALUES (23, N000000, N灰太狼2222, N1, 2, N23, N中国平安啊啊, CAST(0x0000759800000000 AS DateTime), N好@3, 1)
INSERT [dbo].[Student] ([StudentNo], [LoginPwd], [StudentName], [Gender], [GradeId], [Phone], [Address], [Birthday], [Email], [MyTT]) VALUES (23213, N000000, N李金香好人, N0, 3, N13835231533/13503542995, N北京海淀区北宫门, CAST(0x0000759800000000 AS DateTime), N1@3, NULL)
INSERT [dbo].[Student] ([StudentNo], [LoginPwd], [StudentName], [Gender], [GradeId], [Phone], [Address], [Birthday], [Email], [MyTT]) VALUES (23219, N000000, N美洋洋222, N0, 2, N6666666, N北京市海淀区, CAST(0x000081D500000000 AS DateTime), N1@3, NULL)
INSERT [dbo].[Student] ([StudentNo], [LoginPwd], [StudentName], [Gender], [GradeId], [Phone], [Address], [Birthday], [Email], [MyTT]) VALUES (23225, N000000, N张靓颖, N0, 2, N13503001234, N北京市海淀区, CAST(0x0000A1E5009B6025 AS DateTime), N1@3, NULL)
INSERT [dbo].[Student] ([StudentNo], [LoginPwd], [StudentName], [Gender], [GradeId], [Phone], [Address], [Birthday], [Email], [MyTT]) VALUES (23268, N000001, N张玲, N0, 2, N11, N北京, CAST(0x0000A0BA011CBBCC AS DateTime), N1@3, NULL)
INSERT [dbo].[Student] ([StudentNo], [LoginPwd], [StudentName], [Gender], [GradeId], [Phone], [Address], [Birthday], [Email], [MyTT]) VALUES (23270, N000000, N李小龙, N1, 2, NULL, N武汉, CAST(0x0000A227011C8BC0 AS DateTime), N1@3, NULL)
INSERT [dbo].[Student] ([StudentNo], [LoginPwd], [StudentName], [Gender], [GradeId], [Phone], [Address], [Birthday], [Email], [MyTT]) VALUES (23311, N111111, N微冷的雨, N1, 1, N11, N111, CAST(0x0000A2D000C38D54 AS DateTime), Nyymqqc@126.com, NULL)
INSERT [dbo].[Student] ([StudentNo], [LoginPwd], [StudentName], [Gender], [GradeId], [Phone], [Address], [Birthday], [Email], [MyTT]) VALUES (23316, N123456, N习小平, N1, 4, N010-1234567, N北京人民大会堂, CAST(0x00008D8900FBB008 AS DateTime), Nxinjinping@126.com, NULL)
INSERT [dbo].[Student] ([StudentNo], [LoginPwd], [StudentName], [Gender], [GradeId], [Phone], [Address], [Birthday], [Email], [MyTT]) VALUES (23317, N111111, N111, N0, 1, N11, N11, CAST(0x0000A2F000FCE310 AS DateTime), N@, NULL)
INSERT [dbo].[Student] ([StudentNo], [LoginPwd], [StudentName], [Gender], [GradeId], [Phone], [Address], [Birthday], [Email], [MyTT]) VALUES (23318, N111111, N习小平222, N1, 4, N11111, N北京任命, CAST(0x0000A2F000FD4DB4 AS DateTime), Nyymqqc@126.com, NULL)
INSERT [dbo].[Student] ([StudentNo], [LoginPwd], [StudentName], [Gender], [GradeId], [Phone], [Address], [Birthday], [Email], [MyTT]) VALUES (23322, N111111, N张靓颖, N0, 1, N010-123, N中国, CAST(0x0000A2FE00A0C0BC AS DateTime), Nzly@, 11)
INSERT [dbo].[Student] ([StudentNo], [LoginPwd], [StudentName], [Gender], [GradeId], [Phone], [Address], [Birthday], [Email], [MyTT]) VALUES (23323, N111111, N张靓颖, N0, 1, N010-123, N中国, CAST(0x0000A2FE00A0C0BC AS DateTime), Nzly@, 11)
SET IDENTITY_INSERT [dbo].[Student] OFF
/****** Object:  Table [dbo].[Result]    Script Date: 08/06/2014 15:03:17 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Result](
    [StudentNo] [int] NOT NULL,
    [SubjectId] [int] NOT NULL,
    [StudentResult] [int] NOT NULL,
    [ExamDate] [datetime] NOT NULL,
    [Id] [int] IDENTITY(1,1) NOT NULL,
 CONSTRAINT [PK_Result] PRIMARY KEY CLUSTERED 
(
    [Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[Result] ON
INSERT [dbo].[Result] ([StudentNo], [SubjectId], [StudentResult], [ExamDate], [Id]) VALUES (23219, 2, 92, CAST(0x0000A215010D13FC AS DateTime), 1)
INSERT [dbo].[Result] ([StudentNo], [SubjectId], [StudentResult], [ExamDate], [Id]) VALUES (23213, 1, 58, CAST(0x00009C8200000000 AS DateTime), 2)
INSERT [dbo].[Result] ([StudentNo], [SubjectId], [StudentResult], [ExamDate], [Id]) VALUES (23213, 1, 92, CAST(0x0000A215010D13FC AS DateTime), 3)
INSERT [dbo].[Result] ([StudentNo], [SubjectId], [StudentResult], [ExamDate], [Id]) VALUES (23219, 2, 82, CAST(0x00009C9D00000000 AS DateTime), 4)
INSERT [dbo].[Result] ([StudentNo], [SubjectId], [StudentResult], [ExamDate], [Id]) VALUES (23231, 1, 93, CAST(0x0000A1ED009052E0 AS DateTime), 5)
INSERT [dbo].[Result] ([StudentNo], [SubjectId], [StudentResult], [ExamDate], [Id]) VALUES (23231, 2, 97, CAST(0x0000A1ED00905C40 AS DateTime), 6)
INSERT [dbo].[Result] ([StudentNo], [SubjectId], [StudentResult], [ExamDate], [Id]) VALUES (23213, 1, 96, CAST(0x00009C7F00000000 AS DateTime), 9)
INSERT [dbo].[Result] ([StudentNo], [SubjectId], [StudentResult], [ExamDate], [Id]) VALUES (23213, 2, 93, CAST(0x00009C7F00000000 AS DateTime), 10)
INSERT [dbo].[Result] ([StudentNo], [SubjectId], [StudentResult], [ExamDate], [Id]) VALUES (23225, 1, 62, CAST(0x0000A215010D13FC AS DateTime), 11)
INSERT [dbo].[Result] ([StudentNo], [SubjectId], [StudentResult], [ExamDate], [Id]) VALUES (23225, 2, 48, CAST(0x0000A215010D27E8 AS DateTime), 12)
INSERT [dbo].[Result] ([StudentNo], [SubjectId], [StudentResult], [ExamDate], [Id]) VALUES (23225, 3, 98, CAST(0x0000A2DA00C441CC AS DateTime), 16)
INSERT [dbo].[Result] ([StudentNo], [SubjectId], [StudentResult], [ExamDate], [Id]) VALUES (23213, 3, 98, CAST(0x0000A2DB00CAB4F8 AS DateTime), 17)
SET IDENTITY_INSERT [dbo].[Result] OFF
/****** Object:  Default [DF_Student_GradeId]    Script Date: 08/06/2014 15:03:17 ******/
ALTER TABLE [dbo].[Student] ADD  CONSTRAINT [DF_Student_GradeId]  DEFAULT ((1)) FOR [GradeId]
GO
/****** Object:  Check [CK_Student_Birthday]    Script Date: 08/06/2014 15:03:17 ******/
ALTER TABLE [dbo].[Student]  WITH CHECK ADD  CONSTRAINT [CK_Student_Birthday] CHECK  (([BirthDay]>1970-01-01))
GO
ALTER TABLE [dbo].[Student] CHECK CONSTRAINT [CK_Student_Birthday]
GO
/****** Object:  Check [CK_Student_Email]    Script Date: 08/06/2014 15:03:17 ******/
ALTER TABLE [dbo].[Student]  WITH CHECK ADD  CONSTRAINT [CK_Student_Email] CHECK  (([Email] like %@%))
GO
ALTER TABLE [dbo].[Student] CHECK CONSTRAINT [CK_Student_Email]
GO
/****** Object:  Check [CK_Student_Gender]    Script Date: 08/06/2014 15:03:17 ******/
ALTER TABLE [dbo].[Student]  WITH CHECK ADD  CONSTRAINT [CK_Student_Gender] CHECK  (([Gender]=(0) OR [Gender]=1))
GO
ALTER TABLE [dbo].[Student] CHECK CONSTRAINT [CK_Student_Gender]
GO
/****** Object:  Check [CK_Student_LoginPwd]    Script Date: 08/06/2014 15:03:17 ******/
ALTER TABLE [dbo].[Student]  WITH CHECK ADD  CONSTRAINT [CK_Student_LoginPwd] CHECK  ((len([LoginPwd])>=(6)))
GO
ALTER TABLE [dbo].[Student] CHECK CONSTRAINT [CK_Student_LoginPwd]
GO
/****** Object:  Check [CK_studentname]    Script Date: 08/06/2014 15:03:17 ******/
ALTER TABLE [dbo].[Student]  WITH CHECK ADD  CONSTRAINT [CK_studentname] CHECK  (([studentname] IS NOT NULL))
GO
ALTER TABLE [dbo].[Student] CHECK CONSTRAINT [CK_studentname]
GO
/****** Object:  Check [CK_Result_StudentResult]    Script Date: 08/06/2014 15:03:17 ******/
ALTER TABLE [dbo].[Result]  WITH CHECK ADD  CONSTRAINT [CK_Result_StudentResult] CHECK  (([StudentResult]>=(0) AND [Studentresult]<=(100)))
GO
ALTER TABLE [dbo].[Result] CHECK CONSTRAINT [CK_Result_StudentResult]
GO
/****** Object:  ForeignKey [FK_Student_GradeId]    Script Date: 08/06/2014 15:03:17 ******/
ALTER TABLE [dbo].[Student]  WITH CHECK ADD  CONSTRAINT [FK_Student_GradeId] FOREIGN KEY([GradeId])
REFERENCES [dbo].[Grade] ([GradeId])
GO
ALTER TABLE [dbo].[Student] CHECK CONSTRAINT [FK_Student_GradeId]
GO
/****** Object:  ForeignKey [FK_Subject_Grade]    Script Date: 08/06/2014 15:03:17 ******/
ALTER TABLE [dbo].[Subject]  WITH CHECK ADD  CONSTRAINT [FK_Subject_Grade] FOREIGN KEY([GradeId])
REFERENCES [dbo].[Grade] ([GradeId])
GO
ALTER TABLE [dbo].[Subject] CHECK CONSTRAINT [FK_Subject_Grade]
GO
/****** Object:  ForeignKey [FK_Result_Subject]    Script Date: 08/06/2014 15:03:17 ******/
ALTER TABLE [dbo].[Result]  WITH CHECK ADD  CONSTRAINT [FK_Result_Subject] FOREIGN KEY([SubjectId])
REFERENCES [dbo].[Subject] ([SubjectId])
GO
ALTER TABLE [dbo].[Result] CHECK CONSTRAINT [FK_Result_Subject]
GO

 

MySchool

标签:

原文地址:http://www.cnblogs.com/WuXuanKun/p/5280974.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!