ios sqlite

Last login: Tue Jun  2 08:39:17 on console
sunlihuodeMacBook-Air:~ sunlihuo$ pwd
/Users/sunlihuo
sunlihuodeMacBook-Air:~ sunlihuo$ sqlite3 test.sqlite
SQLite version 3.8.5 2014-08-15 22:37:57
Enter ".help" for usage hints.
sqlite> create table if not exists test(id integer primary key, name varchar2, age int);
sqlite> .tables
test
sqlite> .tables
test
sqlite> .schema test
CREATE TABLE test(id integer primary key, name varchar2, age int);
sqlite> alter table test add column test int;
sqlite> .schema test
CREATE TABLE test(id integer primary key, name varchar2, age int, test int);
sqlite> insert into test (name, age) values ('sunlihuo',18);
sqlite> select * from test;
1|sunlihuo|18|
sqlite> .mode column
sqlite> .headeron
Error: unknown command or invalid arguments:  "headeron". Enter ".help" for help
sqlite> select * from test;
1           sunlihuo    18                    
sqlite> .header on
sqlite> select * from test;
id          name        age         test      
----------  ----------  ----------  ----------
1           sunlihuo    18                    
sqlite> update table set name = 'sunlili' where id = 1;
Error: near "table": syntax error
sqlite> update test set name = 'sunlili' where id = 1;
sqlite> select * from test;
id          name        age         test      
----------  ----------  ----------  ----------
1           sunlili     18                    
sqlite> drop table if exists test;
sqlite> select * from test;
Error: no such table: test
sqlite>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值