sqlite3 on mac

Create or open a sqlite3 file

$sqlite3 test.db3

SQLiteversion3.6.23

Enter".help"forinstructions

EnterSQLstatementsterminatedwitha";"

sqlite> 

Get help or quit

.help

.exit or .quit

create table

sqlite>create table Artists (

--->ArtistIDINTEGERPRIMARYKEY,

--->ArtistName TEXT);

insert data

sqlite>insert into Artists (ArtistID,ArtistName) values (NULL,'Peter Gabriel');

select data

sqlite>select * from Artists; 

select data and show headers

sqlite>.headers ON 

sqlite>select * from Artists;

update data

sqlite>update Artists set ArtistName ='Santana' where ArtistID=5; 

delete data

sqlite>DELETE FROM CDs WHERE Title LIKE 'Super%';

Import sql file

sqlite>.read insert_table.sql

相关推荐