高校成绩管理数据库系统的设计与实现
1、需求分析
1.1数据需求描述
➢开发意义:现代高校是信息化建设的生力军。随着信息化时代的推进与大数据时代 的到来, 越来越多的高校选择使用计算机开发数据库进行学生成绩信息 管理。面向学生个人信息、任课教师个人信息、课程及成绩等数据进行 数据处理与规划设计,便于查询信息。
➢可行性:高校成绩管理数据库系统依赖计算机存储速度快、存储容量大、查找与 计算效率高、错误率低的功能特性,与传统的人工与纸质信息记录相比, 大大提高了查询与数据更新的效率,节省了人力物力。
➢应用环境:
编程工具: Visual studio 2019
数据库:Micrsoft Sql server 2014
技术路线:Micrsoft Sql server 2014->C#+Microsoft Visual Studio 2019
操作系统:Windows 10
处理器:Inter® Core™ i5-10210H CPU @ 1.60GHZ 2.11GHZ
安装内存(RAM):16GB
系统类型:64 位操作系统,基于 x64 的处理器
➢用户需求 :
某校管理学生成绩的工作人员,根据实际工作需要,提出了以下基本数据和业务处理需求:
•学校设置了各专业,在专业下开设班级,每个班级包含若干学生,学生信息至少需要包含学号、姓名、性别、年龄、生源所在地、已修学分总数等数据项;另外,需要有地区信息,用于统计某一地区的学生数;
•课程信息表至少需包含课程编号、课程名称、任课教师、开课学期、学时、考试或考
察、学分等数据项,课程根据班级开设。
•教师信息至少需要包含教师编号、姓名、性别、年龄、职称、联系电话等数据项;
目录
1、需求分析 1
1.1数据需求描述 1
1.2系统功能需求 8
1.3其他性能需求 9
2、概念结构设计 9
2.1局部 E-R 图 9
2.2全局 E-R 图 11
2.3优化 E-R 图 12
3、逻辑结构设计 12
3.1关系模式设计 12
3.2数据类型定义 13
4、物理结构设计 15
4.1聚簇设计 15
4.2索引设计 15
4.3分区设计 15
5、数据库实施 16
5.1基本表建立 17
5.2视图的建立 25
5.3索引的建立 31
5.4触发器建立 36
5.5建存储过程 38
6、应用系统开发与试运行 41
6.1开发平台和开发环境介绍。 41
6.2前台界面与后台数据库连接说明,代码实现。 41
6.3系统各功能设计和运行界面截图。 42
7、实验总结 53
7.1遇到的问题和解决的办法 53
7.2系统设计的不足 55
7.3进一步改进思路和体会 56
namespace WindowsFormsApp1
{
partial class FrmLogin
{
///
/// 必需的设计器变量。
///
private System.ComponentModel.IContainer components = null;
///
/// 清理所有正在使用的资源。
///
/// 如果应释放托管资源,为 true;否则为 false。
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows 窗体设计器生成的代码
///
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
///
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmLogin));
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.txtName = new System.Windows.Forms.TextBox();
this.txtPwd = new System.Windows.Forms.TextBox();
this.button1 = new System.Windows.Forms.Button();
this.角色 = new System.Windows.Forms.Label();
this.role = new System.Windows.Forms.ComboBox();
this.label3 = new System.Windows.Forms.Label();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.panel1 = new System.Windows.Forms.Panel();
this.pictureBox2 = new System.Windows.Forms.PictureBox();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.BackColor = System.Drawing.SystemColors.GradientActiveCaption;
this.label1.Font = new System.Drawing.Font("仿宋", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label1.ForeColor = System.Drawing.SystemColors.ControlText;
this.label1.Location = new System.Drawing.Point(876, 184);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(98, 21);
this.label1.TabIndex = 0;
this.label1.Text = "用户名:";
this.label1.TextAlign = System.Drawing.ContentAlignment.TopCenter;
this.label1.Click += new System.EventHandler(this.label1_Click);
//
// label2
//
this.label2.AutoSize = true;
this.label2.BackColor = System.Drawing.SystemColors.GradientActiveCaption;
this.label2.Font = new System.Drawing.Font("仿宋", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label2.Location = new System.Drawing.Point(876, 291);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(98, 21);
this.label2.TabIndex = 1;
this.label2.Text = "密 码:";
this.label2.Click += new System.EventHandler(this.label2_Click);
//
// txtName
//
this.txtName.Location = new System.Drawing.Point(880, 220);
this.txtName.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.txtName.Name = "txtName";
this.txtName.Size = new System.Drawing.Size(236, 28);
this.txtName.TabIndex = 2;
this.txtName.TextChanged += new System.EventHandler(this.textBox1_TextChanged);
//
// txtPwd
//
this.txtPwd.Location = new System.Drawing.Point(880, 316);
this.txtPwd.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.txtPwd.Name = "txtPwd";
this.txtPwd.Size = new System.Drawing.Size(236, 28);
this.txtPwd.TabIndex = 3;
this.txtPwd.TextChanged += new System.EventHandler(this.textBox2_TextChanged);
//
// button1
//
this.button1.BackColor = System.Drawing.Color.Cyan;
this.button1.Cursor = System.Windows.Forms.Cursors.Hand;
this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button1.Font = new System.Drawing.Font("仿宋", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button1.Location = new System.Drawing.Point(922, 504);
this.button1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(144, 52);
this.button1.TabIndex = 4;
this.button1.Text = "登录";
this.button1.UseVisualStyleBackColor = false;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// 角色
//
this.角色.AutoSize = true;
this.角色.BackColor = System.Drawing.SystemColors.GradientActiveCaption;
this.角色.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.角色.Font = new System.Drawing.Font("仿宋", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.角色.ForeColor = System.Drawing.SystemColors.ControlText;
this.角色.Location = new System.Drawing.Point(876, 395);
this.角色.Name = "角色";
this.角色.Size = new System.Drawing.Size(98, 21);
this.角色.TabIndex = 7;
this.角色.Text = "角 色:";
this.角色.Click += new System.EventHandler(this.角色_Click);
//
// role
//
this.role.FormattingEnabled = true;
this.role.Items.AddRange(new object[] {
"学生",
"教师",
"管理员"});
this.role.Location = new System.Drawing.Point(880, 429);
this.role.Name = "role";
this.role.Size = new System.Drawing.Size(236, 26);
this.role.TabIndex = 8;
this.role.Text = "学生";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Font = new System.Drawing.Font("宋体", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label3.ForeColor = System.Drawing.SystemColors.ControlText;
this.label3.Location = new System.Drawing.Point(637, 37);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(320, 28);
this.label3.TabIndex = 9;
this.label3.Text = "高校成绩管理数据库系统";
//
// pictureBox1
//
this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
this.pictureBox1.Location = new System.Drawing.Point(584, 27);
this.pictureBox1.Margin = new System.Windows.Forms.Padding(0);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(133, 50);
this.pictureBox1.TabIndex = 10;
this.pictureBox1.TabStop = false;
//
// panel1
//
this.panel1.BackColor = System.Drawing.Color.Cyan;
this.panel1.Controls.Add(this.label3);
this.panel1.Controls.Add(this.pictureBox1);
this.panel1.Location = new System.Drawing.Point(2, 39);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(1490, 100);
this.panel1.TabIndex = 11;
//
// pictureBox2
//
this.pictureBox2.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pictureBox2.BackgroundImage")));
this.pictureBox2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.pictureBox2.Location = new System.Drawing.Point(195, 184);
this.pictureBox2.Name = "pictureBox2";
this.pictureBox2.Size = new System.Drawing.Size(500, 318);
this.pictureBox2.TabIndex = 12;
this.pictureBox2.TabStop = false;
//
// FrmLogin
//
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.AutoSize = true;
this.BackColor = System.Drawing.SystemColors.GradientActiveCaption;
this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.ClientSize = new System.Drawing.Size(1478, 944);
this.Controls.Add(this.pictureBox2);
this.Controls.Add(this.panel1);
this.Controls.Add(this.role);
this.Controls.Add(this.角色);
this.Controls.Add(this.button1);
this.Controls.Add(this.txtPwd);
this.Controls.Add(this.txtName);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Location = new System.Drawing.Point(500, 500);
this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.Name = "FrmLogin";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "登陆界面";
this.Load += new System.EventHandler(this.FrmLogin_Load);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox txtName;
private System.Windows.Forms.TextBox txtPwd;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Label 角色;
private System.Windows.Forms.ComboBox role;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.PictureBox pictureBox2;
}
}