我在网上找不到关于如何在数据库上执行SQLite 3 vacuum命令的任何示例.
我将首先展示代码:
create table products ('name' text primary key, 'price' INTEGER)
insert into table products ('name', 'price') values ('coke', 8)
insert into table products ('name', 'price') values ('sprite', 9)
Run Code Online (Sandbox Code Playgroud)
什么是SQLite3代码将焦炭行的价格列的值更改为12.
所以我希望输出为焦炭12精灵9.
非常感谢你们!
我以为我知道Python直到今晚.做这样的事的正确方法是什么?这是我的代码:
a = ["one", "two", "three"]
b = a # here I want a complete copy that when b is changed, has absolutely no effect on a
b.append["four"]
print a # a now has "four" in it
Run Code Online (Sandbox Code Playgroud)
基本上我想知道,而不是b = a步骤,我如何正确地制作列表或字典的副本,以便b更改时a不会随之改变?
我读到某处将数据保存到python中的sqlite3数据库,你必须在连接对象上调用commit()函数.我从来没有这样做,但我的数据库仍然保存了数据...为什么?
python ×3
sqlite ×3
autocommit ×1
reference ×1
sql ×1
sql-update ×1
transactions ×1
variables ×1