思維導(dǎo)圖
一、 數(shù)據(jù)源
學(xué)號 | 姓名 | 性 別 | 年齡 | 班級 | 專業(yè) | 學(xué)院 | 電話 |
---|---|---|---|---|---|---|---|
2021001 | 李曉紅 | 女 | 30 | 2021級軟件4班 | 軟件技術(shù) | 人工智能與大數(shù)據(jù)學(xué)院 | 15945456780 |
2021002 | 王曉剛 | 男 | 18 | 2021級軟件4班 | 軟件技術(shù) | 人工智能與大數(shù)據(jù)學(xué)院 | 13890904567 |
2021003 | 唐雨涵 | 女 | 19 | 2021級軟件4班 | 軟件技術(shù) | 人工智能與大數(shù)據(jù)學(xué)院 | 18878789023 |
2021104 | 張三豐 | 男 | 18 | 2021級大數(shù)據(jù)1班 | 大數(shù)據(jù)技術(shù)與應(yīng)用 | 人工智能與大數(shù)據(jù)學(xué)院 | 15945456780 |
2021105 | 肖雨林 | 男 | 18 | 2021級大數(shù)據(jù)1班 | 大數(shù)據(jù)技術(shù)與應(yīng)用 | 人工智能與大數(shù)據(jù)學(xué)院 | 18890904560 |
2021106 | 鄭小翠 | 女 | 19 | 2021級大數(shù)據(jù)1班 | 大數(shù)據(jù)技術(shù)與應(yīng)用 | 人工智能與大數(shù)據(jù)學(xué)院 | 15890904567 |
二、建立數(shù)據(jù)庫
導(dǎo)入MySQL數(shù)據(jù)源,并建立鏈接
1、首先新建MySQL連接
輸入連接名“student”
主機名可填寫“l(fā)ocal host”或“127.0.0.1”
MySQL默認(rèn)端口號為“3306”
用戶名和密碼可自己任意填寫
建立主程序
1.主界面
文章來源:http://www.zghlxwxcb.cn/news/detail-477577.html
2.登入后界面
文章來源地址http://www.zghlxwxcb.cn/news/detail-477577.html
3.定義插入記錄
#插入學(xué)生記錄
def add_student():
cursor = main()
id1 = int(input('學(xué)號:'))
name = input('姓名:')
gem = input('性別:')
age = int(input('年齡:'))
class1 = input('班級:')
major1 = input('專業(yè):')
college = input('學(xué)院:')
telephone = int(input('電話:'))
add = cursor.execute('insert into stu (id, name, genden, age, class, major, college,telephone) values(%s,%s,%s,%s,%s,%s,%s,%s)',(id1, name, gem, age, class1, major1, college,telephone))
if add >= 1:
conn.commit()
print('插入記錄成功!')
else:
print('插入記錄失?。?)
4.定義查詢記錄
#查詢的菜單
def query_student():
while True:
print('查詢學(xué)生記錄')
print('================')
print(
到了這里,關(guān)于學(xué)生管理系統(tǒng)(MySQL版)的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!