这是写sql语句,你先写写看。都是平时讲过的
import sqlite3
conn=sqlite3.connect('yggz.db')
cur=conn.cursor()
cur.execute("""create table if not exists gzb( workid varchar(4) primary key,name varchar(10),salary float(6),award float(6))"""
)
cur.execute('update gzb set salary=3000 where workid=1002')
s=cur.execute('''select workid,name,salary+award from gzb''')
for i in s:
print(i)
conn.commit()
如有帮助请点采纳。