sqlite在mac终端的简单实用

------ 调用mac终端
----- cd Desktop/ //进入桌面
---- sqlite3 tested.sqlite // 创建数据
----- .help //进行下条命令
------ create table student1; // ( number integer , name text , age integer ) ;
------ 增 insert into student1(22,'鸭蛋',19);
------ 查 select * from student1;
------ select count(*) from student1; // 表里面有几行数据
------ 删 delete from student where name = '鸭蛋';
------------改 update student1 set age=11 where name='鸭蛋';
------------ insert into student1; //(22,'鸭蛋',19);
------------- insert into student1; //(28,'狗蛋',11);
----- .mode line; //改变样式
---------- select * from student1 where age>16; // 按照条件查询
----------- select * from student1 where age>16 and number = 102; // 按照条件联合查询
----------- select * from student1 order by age asc/desc; //按照年龄升序和降序排列
----------- .exit; /退出
----------- .database; //显示当前打开的数据库文件
----------- http://www.cr173.com/mac/123368.html // sqlite mac 附应用下载链接

你可能感兴趣的:(sqlite在mac终端的简单实用)