目錄
需求分析
一.登錄功能
二.注冊功能
三.管理員登錄后跳轉(zhuǎn)到功能頁面:
四.學(xué)生信息管理(主界面,刪除功能在主界面代碼中)
五.學(xué)生信息添加和修改(設(shè)計在一個頁面上,修改需要選中行)
六.課程信息管理(刪除功能在主界面中)
?七.課程信息添加和修改
?八.成績信息管理(刪除功能在主界面代碼中)
九.成績信息添加和修改
十.數(shù)據(jù)庫設(shè)計
https://github.com/2736933896/StudentSystem,報告,項目源碼,數(shù)據(jù)庫設(shè)計,窗體設(shè)計源碼上傳到github,需要的同學(xué)自行下載哦
需求分析
1.1設(shè)計可視化界面,具有身份驗證功能,需要登錄時輸入賬號及密碼。
1.2學(xué)生用戶能夠注冊自己的賬號,添加自己的基本注冊信息:學(xué)號、密碼、姓名、性別,對于學(xué)生除了基本注冊信息外,還包括學(xué)生個人信息、課程信息、學(xué)生成績信息。
1.3學(xué)生信息、課程信息、學(xué)生成績都能實現(xiàn)增刪改查并且符合符合數(shù)據(jù)庫完整性。
(其他圖文內(nèi)容省略了,需要課程報告的私聊我)
一.登錄功能
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.StartPanel;
namespace StudentSY
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void timer3_Tick(object sender, EventArgs e)
{
if(pictureBox2.Location.X<200)
{
pictureBox2.Location = new Point(pictureBox2.Location.X + 2, pictureBox2.Location.Y);
}
else
{
if(comboBox1.Text=="學(xué)生")
{
Form4 form4 = new Form4();
form4.Show();
}
timer3.Stop();
}
}
private void button3_Click(object sender, EventArgs e)
{
if(login())
{
timer3.Start();
textBox3.Visible = false;
textBox4.Visible = false;
comboBox1.Visible = false;
button3.Visible = false;
button4.Visible = false;
button5.Visible = false;
label4.Visible = false;
label5.Visible = false;
label6.Visible = false;
}
}
private bool login()
{
if(textBox3.Text==null|| textBox4.Text==null)
{
MessageBox.Show("登錄失敗,賬號或者密碼為空","提示",MessageBoxButtons.OK,MessageBoxIcon.Warning);
return false;
}
else if (comboBox1.Text == "學(xué)生")
{
string sql = "select * from StudentUser where ID='" + textBox3.Text + "'and PassWord='" + textBox4.Text + "'";
Dao dao = new Dao();
IDataReader dr = dao.read(sql);
if(dr.Read())
{
return true;
}
else
{
MessageBox.Show("登錄失敗!賬號或者密碼錯誤,請重試");
return false;
}
}
return false;
}
private void button4_Click(object sender, EventArgs e)
{
textBox3.Text = null;
textBox4.Text = null;
comboBox1.Text = null;
}
private void button5_Click(object sender, EventArgs e)
{
Form11 form11 = new Form11();
form11.ShowDialog();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void label7_Click(object sender, EventArgs e)
{
}
}
}
二.注冊功能
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace StudentSY
{
public partial class Form11 : Form
{
public Form11()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
if(textBox1.Text==""|| textBox2.Text == "" || textBox3.Text == "" || textBox4.Text == "" )
{
MessageBox.Show("輸入不完整,有空項,請檢查!","提示",MessageBoxButtons.OK,MessageBoxIcon.Warning);
}
else
{
string sql= "insert into StudentUser values('" + textBox1.Text + "', '" + textBox2.Text + "', '" + textBox3.Text + "', '" + textBox4.Text + "')";
Dao dao = new Dao();
int i = dao.Excute(sql);
if(i>0)
{
MessageBox.Show("添加成功");
this.Close();
}
}
}
private void button2_Click(object sender, EventArgs e)
{
textBox1.Text = null;
textBox2.Text = null;
textBox3.Text = null;
textBox4.Text = null;
}
}
}
三.管理員登錄后跳轉(zhuǎn)到功能頁面:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace StudentSY
{
public partial class Form4 : Form
{
public Form4()
{
InitializeComponent();
toolStripStatusLabel3.Text = DateTime.Now.ToString("G");
timer1.Start();
}
private void timer1_Tick(object sender, EventArgs e)
{
toolStripStatusLabel3.Text = DateTime.Now.ToString("G");
}
private void button1_Click(object sender, EventArgs e)
{
Form2 form2 = new Form2();
form2.ShowDialog();
}
private void button2_Click(object sender, EventArgs e)
{
Form3 form3 = new Form3();
form3.ShowDialog();
}
private void button3_Click(object sender, EventArgs e)
{
Form31 form31 = new Form31();
form31.ShowDialog();
}
private void button4_Click(object sender, EventArgs e)
{
Application.Exit();
}
}
}
四.學(xué)生信息管理(主界面,刪除功能在主界面代碼中)
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace StudentSY
{
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
toolStripStatusLabel3.Text = DateTime.Now.ToString("G");
timer1.Start();
Table();
}
private void timer1_Tick(object sender, EventArgs e)
{
toolStripStatusLabel3.Text = DateTime.Now.ToString("G");
}
public void Table() //讀取數(shù)據(jù)
{
string sql = "select * from Student";
Dao dao = new Dao();
IDataReader dr = dao.read(sql);
while(dr.Read())
{
string Sno;
string Sname;
string Ssex, Sage, Sdept;
Sno = dr["Sno"].ToString();
Sname = dr["Sname"].ToString();
Ssex = dr["Ssex"].ToString();
Sage = dr["Sage"].ToString();
Sdept = dr["Sdept"].ToString();
string[] str = { Sno, Sname, Ssex, Sage, Sdept };
dataGridView1.Rows.Add(str);
}
dr.Close();
}
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
dataGridView1.Rows[e.RowIndex].DefaultCellStyle.ForeColor = Color.Black;
}
private void dataGridView1_RowDefaultCellStyleChanged(object sender, DataGridViewRowEventArgs e)
{
ForeColor = Color.Black;
}
private void 添加學(xué)生ToolStripMenuItem_Click(object sender, EventArgs e)
{
Form21 form21 = new Form21();
form21.ShowDialog(); //開一個新窗口;
dataGridView1.Rows.Clear();
Table();
}
private void 修改學(xué)生信息ToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{
string[] str = { dataGridView1.SelectedCells[0].Value.ToString(), dataGridView1.SelectedCells[1].Value.ToString(),
dataGridView1.SelectedCells[2].Value.ToString(),dataGridView1.SelectedCells[3].Value.ToString(),
dataGridView1.SelectedCells[4].Value.ToString()};
// MessageBox.Show(str[0]+str[1]+str[2]+str[3]+str[4]);
Form21 form21 = new Form21(str);
form21.ShowDialog();
dataGridView1.Rows.Clear();
Table();
}
catch
{
MessageBox.Show("未正確選中行,請重試");
}
}
private void 刪除學(xué)生信息ToolStripMenuItem_Click(object sender, EventArgs e)
{
DialogResult r = MessageBox.Show("確定要刪除嗎?", "提示", MessageBoxButtons.OKCancel);
if(r==DialogResult.OK)
{
try
{
string id, name;
id = dataGridView1.SelectedCells[0].Value.ToString(); //選中當(dāng)前行第一列的值
name = dataGridView1.SelectedCells[0].Value.ToString();
string sql = "delete from Student where Sno=" + id;
Dao dao = new Dao();
int i = dao.Excute(sql); //執(zhí)行SQL語句
if(i>0)
{
dataGridView1.Rows.Clear();
Table();
}
}
catch
{
MessageBox.Show("請正確選擇行");
}
}
}
private void toolStripButton4_Click(object sender, EventArgs e)
{
dataGridView1.Rows.Clear();
Table();
}
private void 退出ToolStripMenuItem_Click(object sender, EventArgs e)
{
Application.Exit();
}
private void toolStripButton1_Click(object sender, EventArgs e)
{
添加學(xué)生ToolStripMenuItem_Click(sender, e);
}
private void toolStripButton3_Click(object sender, EventArgs e)
{
刪除學(xué)生信息ToolStripMenuItem_Click(sender, e);
}
private void toolStripButton2_Click(object sender, EventArgs e)
{
修改學(xué)生信息ToolStripMenuItem_Click(sender, e);
; }
}
}
五.學(xué)生信息添加和修改(設(shè)計在一個頁面上,修改需要選中行)
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace StudentSY
{
public partial class Form21 : Form
{
string []str = new string[5];
public Form21()
{
InitializeComponent();
button1.Text = "添加信息"; //更改button的值,用于增加和修改信息
}
public Form21(string[] a)
{
InitializeComponent();
button1.Text = "修改信息";
for(int i =0;i<5;i++)
{
str[i] = a[i];
}
textBox1.Text = str[0];
textBox2.Text = str[1];
textBox3.Text = str[2];
textBox4.Text = str[3];
textBox5.Text = str[4];
// this.Close();
}
private void Form21_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
if (button1.Text == "添加信息")
{
if (textBox1.Text == "" || textBox2.Text == "" || textBox3.Text == "" || textBox4.Text == "" || textBox5.Text == "")
{
MessageBox.Show("輸入不完整,不能為空", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
else
{
string sql = "insert into Student Values('" + textBox1.Text + "','" + textBox2.Text + "','" + textBox3.Text + "','" + textBox4.Text + "','" + textBox5.Text + "')";
MessageBox.Show(sql);
Dao dao = new Dao();
int i = dao.Excute(sql);
if (i > 0)
{
MessageBox.Show("添加成功");
this.Close();
}
}
}
else if (button1.Text == "修改信息")
{
if (textBox1.Text == "" || textBox2.Text == "" || textBox3.Text == "" || textBox4.Text == "" || textBox5.Text == "")
{
MessageBox.Show("修改后有空項,請檢查", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
else
{
string sql = "update Student set Sno='"+textBox1.Text+"' ,Sname ='"+textBox2.Text+"',Ssex='"+textBox3.Text+"',Sage='"+textBox4.Text+"',Sdept='"+textBox5.Text+"' where Sno = '" + str[0] +"';";
Dao dao = new Dao();
int i = dao.Excute(sql);
if (i > 0)
{
MessageBox.Show("修改成功");
this.Close();
}
}
}
}
private void button2_Click(object sender, EventArgs e)
{
this.Close();
}
}
}
六.課程信息管理(刪除功能在主界面中)
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace StudentSY
{
public partial class Form3 : Form
{
public Form3()
{
InitializeComponent();
toolStripStatusLabel3.Text = DateTime.Now.ToString("G");
timer1.Start();
Table();
}
public void Table()
{
string sql = "select * from Course";
Dao dao = new Dao();
IDataReader dr = dao.read(sql);
while (dr.Read())
{
string Cno, Cname, Cpno, Credit;
Cno = dr["Cno"].ToString();
Cname = dr["Cname"].ToString();
Cpno = dr["Cpno"].ToString();
Credit = dr["Credit"].ToString();
string[] str = { Cno, Cname, Cpno, Credit };
dataGridView1.Rows.Add(str);
}
dr.Close();
}
private void timer1_Tick(object sender, EventArgs e)
{
toolStripStatusLabel3.Text = DateTime.Now.ToString("G");
}
private void 添加課程ToolStripMenuItem_Click(object sender, EventArgs e)
{
addcourse addcourse = new addcourse();
addcourse.ShowDialog();
dataGridView1.Rows.Clear();
Table();
}
private void 修改課程ToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{
string[] str = { dataGridView1.SelectedCells[0].Value.ToString(), dataGridView1.SelectedCells[1].Value.ToString(),
dataGridView1.SelectedCells[2].Value.ToString(),dataGridView1.SelectedCells[3].Value.ToString()};
addcourse addcourse = new addcourse(str);
addcourse.ShowDialog();
dataGridView1.Rows.Clear();
Table();
}
catch
{
MessageBox.Show("未正確選擇行,請重試");
}
}
private void toolStripButton4_Click(object sender, EventArgs e)
{
dataGridView1.Rows.Clear();
Table();
}
private void 刪除課程ToolStripMenuItem_Click(object sender, EventArgs e)
{
DialogResult r = MessageBox.Show("確定要刪除嗎?", "提示", MessageBoxButtons.OKCancel);
if (r == DialogResult.OK)
{
try
{
string id;
id = dataGridView1.SelectedCells[0].Value.ToString(); //選中當(dāng)前行第一列的值
// name = dataGridView1.SelectedCells[0].Value.ToString();
string sql = "delete from Course where Cno=" + id;
Dao dao = new Dao();
int i = dao.Excute(sql); //執(zhí)行SQL語句
if (i > 0)
{
dataGridView1.Rows.Clear();
Table();
}
}
catch
{
MessageBox.Show("請正確選擇行");
}
}
}
private void toolStripButton1_Click(object sender, EventArgs e)
{
添加課程ToolStripMenuItem_Click(sender, e);
}
private void toolStripButton2_Click(object sender, EventArgs e)
{
修改課程ToolStripMenuItem_Click(sender, e);
}
private void toolStripButton3_Click(object sender, EventArgs e)
{
刪除課程ToolStripMenuItem_Click(sender, e);
}
private void 退出ToolStripMenuItem_Click(object sender, EventArgs e)
{
Application.Exit();
}
private void menuStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
{
}
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
}
}
}
?七.課程信息添加和修改
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
namespace StudentSY
{
public partial class addcourse : Form
{
string[] str=new string[4];
public addcourse()
{
InitializeComponent();
button1.Text = "添加信息";
}
public addcourse(string[] a)
{
InitializeComponent();
button1.Text = "修改信息";
for (int i = 0; i < 4; i++)
{
str[i] = a[i];
}
textBox1.Text = str[0];
textBox2.Text = str[1];
textBox3.Text = str[2];
textBox4.Text = str[3];
// this.Close();
}
private void button1_Click(object sender, EventArgs e)
{
if (button1.Text == "添加信息")
{
if (textBox1.Text == "" || textBox2.Text == "" || textBox4.Text == "")
{
MessageBox.Show("除先修課外輸入不完整,不能為空", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
else
{
string sql = "insert into Course Values('" + textBox1.Text + "','" + textBox2.Text + "','" + textBox3.Text + "','" + textBox4.Text + "')";
MessageBox.Show(sql);
Dao dao = new Dao();
int i = dao.Excute(sql);
if (i > 0)
{
MessageBox.Show("添加成功");
this.Close();
}
}
}
else if (button1.Text == "修改信息")
{
if (textBox1.Text == "" || textBox2.Text == "" || textBox4.Text == "" )
{
MessageBox.Show("除先修課外修改后有空項,請檢查", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
else
{
string sql = "update Course set Cno='" + textBox1.Text + "' ,Cname ='" + textBox2.Text + "',Cpno='" + textBox3.Text + "',Credit='" + textBox4.Text + "' where Cno = '" + str[0] + "';";
Dao dao = new Dao();
int i = dao.Excute(sql);
if (i > 0)
{
MessageBox.Show("修改成功");
this.Close();
}
}
}
}
private void button2_Click(object sender, EventArgs e)
{
this.Close();
}
}
}
?八.成績信息管理(刪除功能在主界面代碼中)
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace StudentSY
{
public partial class Form31 : Form
{
public Form31()
{
InitializeComponent();
Table();
}
public void Table()
{
string sql = "select * from SC";
Dao dao = new Dao();
IDataReader dr = dao.read(sql);
while (dr.Read())
{
string Sno,Cno,Grade;
Sno = dr["Sno"].ToString();
Cno = dr["Cno"].ToString();
Grade = dr["Grade"].ToString();
string[] str = { Sno,Cno, Grade};
dataGridView2.Rows.Add(str);
}
dr.Close();
}
private void 添加成績ToolStripMenuItem_Click(object sender, EventArgs e)
{
addgrade addgrade = new addgrade();
addgrade.ShowDialog();
dataGridView2.Rows.Clear();
Table();
}
private void 刪除成績ToolStripMenuItem_Click(object sender, EventArgs e)
{
DialogResult r = MessageBox.Show("確定要刪除嗎?", "提示", MessageBoxButtons.OKCancel);
if (r == DialogResult.OK)
{
try
{
string sno,cno;
sno = dataGridView2.SelectedCells[0].Value.ToString(); //選中當(dāng)前行第一列的值
cno= dataGridView2.SelectedCells[1].Value.ToString(); // name = dataGridView1.SelectedCells[0].Value.ToString();
string sql = "delete from SC where Sno= '"+sno+"' and Cno='"+cno+"'";
Dao dao = new Dao();
int i = dao.Excute(sql); //執(zhí)行SQL語句
if (i > 0)
{
dataGridView2.Rows.Clear();
Table();
}
}
catch
{
MessageBox.Show("請正確選擇行");
}
}
}
private void 修改成績ToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{
string[] str = { dataGridView2.SelectedCells[0].Value.ToString(), dataGridView2.SelectedCells[1].Value.ToString(),
dataGridView2.SelectedCells[2].Value.ToString()};
addgrade addgrade = new addgrade(str);
addgrade.ShowDialog();
dataGridView2.Rows.Clear();
Table();
}
catch
{
MessageBox.Show("未正確選擇行,請重試");
}
}
private void toolStripButton1_Click(object sender, EventArgs e)
{
添加成績ToolStripMenuItem_Click(sender, e);
}
private void toolStripButton2_Click(object sender, EventArgs e)
{
修改成績ToolStripMenuItem_Click(sender, e);
}
private void toolStripButton3_Click(object sender, EventArgs e)
{
刪除成績ToolStripMenuItem_Click(sender, e);
}
private void toolStripButton4_Click(object sender, EventArgs e)
{
dataGridView2.Rows.Clear();
Table();
}
private void dataGridView2_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
}
private void 退出ToolStripMenuItem_Click(object sender, EventArgs e)
{
Application.Exit();
}
}
}
九.成績信息添加和修改
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
namespace StudentSY
{
public partial class addgrade : Form
{
string []str = new string[3];
public addgrade()
{
InitializeComponent();
button1.Text = "添加信息";
}
public addgrade(string[] a)
{
InitializeComponent();
button1.Text = "修改信息";
for (int i = 0; i < 3; i++)
{
str[i] = a[i];
}
textBox1.Text = str[0];
textBox2.Text = str[1];
textBox3.Text = str[2];
}
private void textBox2_TextChanged(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
if (button1.Text == "添加信息")
{
if (textBox1.Text == "" || textBox2.Text == "" || textBox3.Text == "")
{
MessageBox.Show("輸入不完整,不能為空", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
else
{
string sql = "insert into SC Values('" + textBox1.Text + "','" + textBox2.Text + "','" + textBox3.Text + "')";
MessageBox.Show(sql);
Dao dao = new Dao();
int i = dao.Excute(sql);
if (i > 0)
{
MessageBox.Show("添加成功");
this.Close();
}
}
}
else if (button1.Text == "修改信息")
{
if (textBox1.Text == "" || textBox2.Text == "" || textBox3.Text == "")
{
MessageBox.Show("修改后有空項,請檢查", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
else
{
string sql = "update SC set Grade='" + textBox3.Text + "' where Sno = '" + str[0] + "' and Cno ='" + str[1] +"';";
Dao dao = new Dao();
int i = dao.Excute(sql);
if (i > 0)
{
MessageBox.Show("修改成功");
this.Close();
}
}
}
}
private void button2_Click(object sender, EventArgs e)
{
this.Close();
}
}
}
十.數(shù)據(jù)庫設(shè)計
USE MySchool;
DROP TABLE IF EXISTS SC /*成績*/
DROP TABLE IF EXISTS Student /*學(xué)生信息*/
DROP TABLE IF EXISTS Course /*課程*/
DROP TABLE IF EXISTS StudentUser /*學(xué)生用戶信息*/
DROP TABLE IF EXISTS Administrator /*管理員用戶信息*/
DROP TABLE IF EXISTS SysLog /*注冊日志*/
DROP TABLE IF EXISTS SysLog1 /*登陸日志*/
DROP TABLE IF EXISTS AVG1 /*平均成績*/
Create table StudentUser --學(xué)生注冊信息表格
(ID nchar(20) primary key,
PassWord nchar(32),
Name nchar(20),
Sex nchar(2),
);
Create table Administrator --管理員注冊信息表格
(
ID char(20) primary key,
PassWord nchar(32),
Name nchar(20),
Sex char(2),
-- Birthday datetime ,
--UserMobile nchar(11),
);
Create table Student --學(xué)生信息表格
(
Sno char(9) primary key, --列級完整性約束條件,Sno是主碼
Sname char(20) Unique, --名字唯一
Ssex char(2),
Sage int,
Sdept char(20),
);
Create table Course
(
Cno char(9) primary key, --列級完整性約束條件,Cno是主碼
Cname char(40),
cpno char(4),
Credit int,
);
create table SC
(
Sno char(9),
Cno char(9),
Grade int,
primary key (Sno,Cno), --主碼由兩個屬性構(gòu)成,必須作為表級完整性進(jìn)行定義
foreign key (Sno) references Student(Sno), --表級完整性約束條件,Sno是外碼,被參照表是Student
foreign key (Cno) references Course(Cno) --表級完整性約束條件, Cno是外碼,被參照表是Course
);
INSERT INTO StudentUser VALUES ('2023123','123456','張三','男');
INSERT INTO Administrator VALUES ('2023124','123456','張三','男');
INSERT INTO Administrator VALUES ('2023125','123456','張三','男');
INSERT INTO Student (Sno,Sname,Ssex,Sdept,Sage) VALUES ('201215121','李勇','男','CS',20);
INSERT INTO Student (Sno,Sname,Ssex,Sdept,Sage) VALUES ('201215122','劉晨','女','CS',19);
INSERT INTO Student (Sno,Sname,Ssex,Sdept,Sage) VALUES ('201215123','王敏','女','MA',18);
INSERT INTO Student (Sno,Sname,Ssex,Sdept,Sage) VALUES ('201215125','張立','男','IS',19);
INSERT INTO Student (Sno,Sname,Ssex,Sdept,Sage) VALUES ('201215128','陳冬','男','IS',20);
SELECT * FROM Student
INSERT INTO Course(Cno,Cname,Cpno,Credit) VALUES ('1','數(shù)據(jù)庫',NULL,4);
INSERT INTO Course(Cno,Cname,Cpno,Credit) VALUES ('2','數(shù)學(xué)',NULL,4);
INSERT INTO Course(Cno,Cname,Cpno,Credit) VALUES ('3','信息系統(tǒng)',NULL,4);
INSERT INTO Course(Cno,Cname,Cpno,Credit) VALUES ('4','操作系統(tǒng)',NULL,4);
INSERT INTO Course(Cno,Cname,Cpno,Credit) VALUES ('5','數(shù)據(jù)結(jié)構(gòu)',NULL,4);
INSERT INTO Course(Cno,Cname,Cpno,Credit) VALUES ('6','數(shù)據(jù)處理',NULL,4);
INSERT INTO Course(Cno,Cname,Cpno,Credit) VALUES ('7','Pascal語言',NULL,4);
UPDATE Course SET Cpno = '5' WHERE Cno = '1'
UPDATE Course SET Cpno = '1' WHERE Cno = '3'
UPDATE Course SET Cpno = '6' WHERE Cno = '4'
UPDATE Course SET Cpno = '7' WHERE Cno = '5'
UPDATE Course SET Cpno = '6' WHERE Cno = '7'
SELECT * FROM Course
INSERT INTO SC(Sno,Cno,Grade) VALUES ('201215121 ','1',92);
INSERT INTO SC(Sno,Cno,Grade) VALUES ('201215121 ','2',85);
INSERT INTO SC(Sno,Cno,Grade) VALUES ('201215121 ','3',88);
INSERT INTO SC(Sno,Cno,Grade) VALUES ('201215122 ','2',90);
INSERT INTO SC(Sno,Cno,Grade) VALUES ('201215122 ','3',80);
SELECT * FROM SC
CREATE TABLE AVG1
(
Cname CHAR(10), /* 科目*/
avg1 INT
);
INSERT INTO AVG1(Cname,avg1) VALUES ('數(shù)據(jù)庫',NULL);
INSERT INTO AVG1(Cname,avg1) VALUES ('數(shù)學(xué)',NULL);
INSERT INTO AVG1(Cname,avg1) VALUES ('信息系統(tǒng)',NULL);
INSERT INTO AVG1(Cname,avg1) VALUES ('操作系統(tǒng)',NULL);
INSERT INTO AVG1(Cname,avg1) VALUES ('數(shù)據(jù)結(jié)構(gòu)',NULL);
INSERT INTO AVG1(Cname,avg1) VALUES ('數(shù)據(jù)處理',NULL);
INSERT INTO AVG1(Cname,avg1) VALUES ('Pascal語言',NULL);
學(xué)生信息表(Student):
課程表(Course):
成績表(SC):
學(xué)生用戶表(StudentUser):文章來源:http://www.zghlxwxcb.cn/news/detail-786304.html
?有需要完整代碼和實驗報告的同學(xué)私聊我,有什么問題評論文章來源地址http://www.zghlxwxcb.cn/news/detail-786304.html
到了這里,關(guān)于數(shù)據(jù)庫課程設(shè)計——學(xué)生信息管理系統(tǒng)(Sqlserver,C#,Winform)的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!