Python连接SqlServer+GUI嵌入式——学生管理系统1.0
学生管理系统1.0
1.建学生数据库
2.数据库嵌入高级语言(Python)
3.界面设计
简化思路:
1.先通过SqlServer2012建立学生数据库,包括账号、密码,姓名、选课等信息
2.运用Python的pymssql库与SqlServer建立连接再用tkinter库创建GUI界面
1)SqlServer建学生数据库
1 create database student_Mis
2 on
3 (name = student_Data,
4 filename='F:\SQL list\student_mis_data.mdf',
5 size = 20,
6 maxsize = 100,
7 filegrowth = 10)
8 log on
9 (name = student_Log,
10 filename = 'F:\SQL list\student_mis_log.ldf',
11 size = 5mb,
12 maxsize = 50mb,
13 filegrowth = 5mb)
2)在学生库内建表并插入数据
1 create table Students
2 (学号 char(10) primary key,
3 密码 varchar(20) not null,
4 姓名 char(20) not null,
5 性别 char(5),
6 出生日期 date
7 )
8
9 create table Course
10 (课程名 char(30) not null,
11 课程老师 char(20) not null,
12 课程号 char(10) primary key)
13
14 create table Report
15 (学号 char(10),
16 课程号 char(10),
17 成绩 int,
18 primary key(学号,课程号),
19 constraint Students_Report foreign key(学号) references Students,
20 constraint Couse_Report foreign key(课程号) references Course)
21
22
23 insert
24 into Students
25 values
26 ('2018165201','12345678','李铭','男','2000-02-01'),
27 ('2018165202','12345678','刘晓鸣','男','2000-08-02'),
28 ('2018165203','12345678','李明','男','1999-07-09'),
29 ('2018165204','12345678','张鹰','女','1998-08-20'),
30 ('2018165205','12345678','刘竟静','女','1999-09-09'),
31 ('2018165206','12345678','刘成刚','男','2000-10-10'),
32 ('2018165207','12345678','王铭','男','2000-01-01'),
33 ('2018165118','12345678','右耳朵耗子','男','1998-08-25')
34
35 insert
36 into Course
37 values
38 ('数据库', '美美',