MySchool

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, N‘S1‘)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (2, N‘S2‘)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (3, N‘Y2‘)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (4, N‘精英班‘)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (11, N‘zhanan‘)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (12, N‘S1288无敌班‘)
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, N‘aa‘)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (20, N‘mine‘)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (21, N‘mine‘)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (22, N‘mine‘)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (23, N‘mine‘)
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, N‘aa‘)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (31, N‘bb‘)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (32, N‘cc‘)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (33, N‘dd‘)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (34, N‘S2216‘)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (48, N‘S2216第二个班‘)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (49, N‘S2216终结版‘)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (51, N‘JDBC测试啊啊啊啊‘)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (52, N‘JDBC测试啊啊啊啊2‘)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (53, N‘JDBC测试啊啊啊啊2‘)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (54, N‘DBC啊速度速度‘)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (55, N‘DBC阿萨德完全‘)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (56, N‘DBC阿萨德完全‘)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (57, N‘DBC阿萨德完全‘)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (58, N‘aa‘)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (59, N‘bb‘)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (60, N‘aaa‘‘‘)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (61, N‘ccc‘)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (62, N‘1‘)
INSERT [dbo].[Grade] ([GradeId], [GradeName]) VALUES (63, N‘s1‘)
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, N‘oop       ‘, 78, 1)
INSERT [dbo].[Subject] ([SubjectId], [SubjectName], [ClassHour], [GradeId]) VALUES (2, N‘java      ‘, 67, 2)
INSERT [dbo].[Subject] ([SubjectId], [SubjectName], [ClassHour], [GradeId]) VALUES (3, N‘C#        ‘, 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, N‘000000‘, N‘灰太狼2222‘, N‘1‘, 2, N‘23‘, N‘中国平安啊啊‘, CAST(0x0000759800000000 AS DateTime), N‘好@3‘, 1)
INSERT [dbo].[Student] ([StudentNo], [LoginPwd], [StudentName], [Gender], [GradeId], [Phone], [Address], [Birthday], [Email], [MyTT]) VALUES (23213, N‘000000‘, N‘李金香好人‘, N‘0‘, 3, N‘13835231533/13503542995‘, N‘北京海淀区北宫门‘, CAST(0x0000759800000000 AS DateTime), N‘[email protected]‘, NULL)
INSERT [dbo].[Student] ([StudentNo], [LoginPwd], [StudentName], [Gender], [GradeId], [Phone], [Address], [Birthday], [Email], [MyTT]) VALUES (23219, N‘000000‘, N‘美洋洋222‘, N‘0‘, 2, N‘6666666‘, N‘北京市海淀区‘, CAST(0x000081D500000000 AS DateTime), N‘[email protected]‘, NULL)
INSERT [dbo].[Student] ([StudentNo], [LoginPwd], [StudentName], [Gender], [GradeId], [Phone], [Address], [Birthday], [Email], [MyTT]) VALUES (23225, N‘000000‘, N‘张靓颖‘, N‘0‘, 2, N‘13503001234‘, N‘北京市海淀区‘, CAST(0x0000A1E5009B6025 AS DateTime), N‘[email protected]‘, NULL)
INSERT [dbo].[Student] ([StudentNo], [LoginPwd], [StudentName], [Gender], [GradeId], [Phone], [Address], [Birthday], [Email], [MyTT]) VALUES (23268, N‘000001‘, N‘张玲‘, N‘0‘, 2, N‘11‘, N‘北京‘, CAST(0x0000A0BA011CBBCC AS DateTime), N‘[email protected]‘, NULL)
INSERT [dbo].[Student] ([StudentNo], [LoginPwd], [StudentName], [Gender], [GradeId], [Phone], [Address], [Birthday], [Email], [MyTT]) VALUES (23270, N‘000000‘, N‘李小龙‘, N‘1‘, 2, NULL, N‘武汉‘, CAST(0x0000A227011C8BC0 AS DateTime), N‘[email protected]‘, NULL)
INSERT [dbo].[Student] ([StudentNo], [LoginPwd], [StudentName], [Gender], [GradeId], [Phone], [Address], [Birthday], [Email], [MyTT]) VALUES (23311, N‘111111‘, N‘微冷的雨‘, N‘1‘, 1, N‘11‘, N‘111‘, CAST(0x0000A2D000C38D54 AS DateTime), N‘[email protected]‘, NULL)
INSERT [dbo].[Student] ([StudentNo], [LoginPwd], [StudentName], [Gender], [GradeId], [Phone], [Address], [Birthday], [Email], [MyTT]) VALUES (23316, N‘123456‘, N‘习小平‘, N‘1‘, 4, N‘010-1234567‘, N‘北京人民大会堂‘, CAST(0x00008D8900FBB008 AS DateTime), N‘[email protected]‘, NULL)
INSERT [dbo].[Student] ([StudentNo], [LoginPwd], [StudentName], [Gender], [GradeId], [Phone], [Address], [Birthday], [Email], [MyTT]) VALUES (23317, N‘111111‘, N‘111‘, N‘0‘, 1, N‘11‘, N‘11‘, CAST(0x0000A2F000FCE310 AS DateTime), N‘@‘, NULL)
INSERT [dbo].[Student] ([StudentNo], [LoginPwd], [StudentName], [Gender], [GradeId], [Phone], [Address], [Birthday], [Email], [MyTT]) VALUES (23318, N‘111111‘, N‘习小平222‘, N‘1‘, 4, N‘11111‘, N‘北京任命‘, CAST(0x0000A2F000FD4DB4 AS DateTime), N‘[email protected]‘, NULL)
INSERT [dbo].[Student] ([StudentNo], [LoginPwd], [StudentName], [Gender], [GradeId], [Phone], [Address], [Birthday], [Email], [MyTT]) VALUES (23322, N‘111111‘, N‘张靓颖‘, N‘0‘, 1, N‘010-123‘, N‘中国‘, CAST(0x0000A2FE00A0C0BC AS DateTime), N‘[email protected]‘, 11)
INSERT [dbo].[Student] ([StudentNo], [LoginPwd], [StudentName], [Gender], [GradeId], [Phone], [Address], [Birthday], [Email], [MyTT]) VALUES (23323, N‘111111‘, N‘张靓颖‘, N‘0‘, 1, N‘010-123‘, N‘中国‘, CAST(0x0000A2FE00A0C0BC AS DateTime), N‘[email protected]‘, 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
时间: 2024-10-01 05:20:56

MySchool的相关文章

优化MySchool数据库设计之【巅峰对决】

优化MySchool数据库设计 之独孤九剑 船舶停靠在港湾是很安全的,但这不是造船的目的 By:北大青鸟五道口原玉明老师 1.学习方法: 01.找一本好书 初始阶段不适合,可以放到第二个阶段,看到知识点时,要进行验证 02.查看帮助文档和搜索引擎的使用 借助网络上的Blog文章 03.不要急功近利 不要抱着速成的想法,否则必然走弯路学习编程不是一蹴而就的事情付出的成本高,才能有一个高薪的收入 04.不要浮躁 不要什么都学,只学有用的 浮躁的程度和技术水平成反比的走自己的路,让别人去浮躁去吧! 每

优化MySchool数据库设计总结

数据库的设计 一:什么是数据库设计? 数据库设计就是将数据库中的数据实体以及这些数据实体之间的关系,进行规范和结构化的过程. 二:为什么要实施数据库设计? 1:良好的数据库设计可以有效的解决数据冗余的问题 2:效率高 3:便于进一步扩展 4:使得应用程序开发变得容易 三:设计数据库的步骤 第一步    需求分析:  分析客户的业务和数据处理需求(收集信息,标识实体,标识每个实体需要存储的详细信息,标识实体间的关系) 第二步    概要设计:  绘制E-R图,用于与客户或团队成员的交流 第三步  

C#分层开发MySchool

分层开发之MYSCHOOL No.1实现登陆功能,验证用户名和密码.从数据库里进行匹配,看是否有符合要求的数据. 在DAL层编写代码,返回值为布尔类型.方法参数为(student实体类对象),使用参数化SqlParameter类型防止SQL注入. 1 public bool IsLogin(Student stu) 2 { 3 bool flag = false; 4 SqlConnection con = new SqlConnection(SqlHelper.str); 5 6 string

Myschool乱码问题

show variables like 'character_set%'; alter table users modify username char(20) character set gbk; alter table tt CONVERT TO CHARACTER SET gb2312 set character_set_results=gb2312; set character_set_connection=gb2312; set character_set_client=gb2312;

优化Myschool数据库设计联合、联接、子查询

USE MySchoolgo --联合查询:合并多个数据集中的行SELECT StudentNo,SubjectNo,StudentResult From Result--UNIONSELECT SubjectNo,ClassHour,GradeID From Subject --联接查询:合并多个数据集中的列SELECT StudentName AS 姓名,SubjectNo AS 课程编号,StudentResult AS 成绩FROM Student INNER JOIN Result O

优化MySchool总结习题

1) 在SQL Server 中,为数据库表建立索引能够( C ). A. 防止非法的删除操作 B. 防止非法的插入操作 C. 提高查询性能 D. 节约数据库的磁盘空间 解析:索引的作用是通过使用索引,大大提高数据库的检索速度,改善数据库性能 2) 在SQL SERVER中,创建一个表使用(  C)语句. A. INSERT B. DROP C. CREATE D. ALERT 解析:A :insert 插入数据.   B: drop 进行删除操作 D:alter 添加约束 3) 在SQL SE

ACCP7.0优化MYSCHOOL数据库设计内测笔试题总结

) 在SQL Server 中,为数据库表建立索引能够(C ). 索引:是SQL SERVER编排数据的内部方法,是检索表中数据的直接通道 建立索引的作用:大大提高了数据库的检索速度,改善数据库性能 A. 防止非法的删除操作 B. 防止非法的插入操作 C. 提高查询性能 D. 节约数据库的磁盘空间 2) 在SQL SERVER中,创建一个表使用(C  )语句. A. INSERT   增加数据 B. DROP      删除数据库,表,约束,视图,索引,存储过程 C. CREATE   创建数据

优化MySchool数据库设计

第一章 数据库的设计 1.E-R图中: 矩形:实体 椭圆:属性 菱形:关系 直线:连接实体,属性和关系 2.映射基数 一对多 多对一 多对多 3.范式: 第一范式:确保每列的原子性 第二范式:确保表中的每列都和主键相关 第三范式:确保表中的每列都和主键有直接关系,而不是间接关系 第二章 数据库的实现 1.创建数据库 use master go create database 数据库名 on ( ) log on ( ) go 2.删除数据库 drop database 数据库名 3.创建表 us

优化MySchool数据库设计—SQL编程,学习回顾用

使用变量 局部变量 语法:declare @variable_name datatype 局部变量的名称 数据类型 例:declare @name varchar(8) declare @number int 局部变量的赋值方法: 语法:set @variable_name = value 或select @variable_name = value