sqlite3

  • 可视化工具

sudo apt-get install sqlitebrowser

sqlitebrowser test.db

  • 使用方法

import sqlite3 as s3

con = s3.connect('frist.db')

cur = con.cursor()

cur.execute('create table t_fish(date text,name text,nums int,price real,explain text)')

cur.execute('''insert into t_fish values('2018-3-28,'黑鱼','10,'28.3','tom')''')

cur.execute(''' UPDATE t_fish SET name='红鱼' WHERE date = '2018-4-27' ''')

result = cur.execute('''select * from t_fish where date = '2018-3-28' ''')

for x in result:
    print(x)

con.commit()

con.close()

posted @ 2020-11-29 18:26  kaiser_yinkai  阅读(37)  评论(0)    收藏  举报