本節(jié)學習內(nèi)容:
1.Sqlite數(shù)據(jù)為基本概念
2.Sqlite數(shù)據(jù)庫基本創(chuàng)建
3.Sqlite數(shù)據(jù)庫基本使用
CREATE TABLE:創(chuàng)建數(shù)據(jù)表
SELECT:選擇數(shù)據(jù)庫數(shù)據(jù)
INSERT:插入數(shù)據(jù)庫數(shù)據(jù)
DELETE:刪除數(shù)據(jù)庫數(shù)據(jù)
UPDATE:更新數(shù)據(jù)庫數(shù)據(jù)
打開終端進入sqlite目錄
.databasese:顯示當前數(shù)據(jù)庫下所有數(shù)據(jù)
.tables當前數(shù)據(jù)庫下所有數(shù)據(jù)表
create table person(id integer primary key,name vqrcher(20),age amallint);//創(chuàng)建一個表
select * from stu;//查詢stu表的數(shù)據(jù)
select? id from stu;//打印指定字段
select * from stu where id>10;//按條件查詢
select * from stu order by id;按id排序
update stu set name='wike' where id=1;//更新表指定字段值
insert into stu values(1,'Mick',10);//向stu表插入數(shù)據(jù)