Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

SQLITEÈëÃÅ Öð²½½²½âSQLITEÃüÁîÐÐ(Ò»)

Ê×ÏÈ×öµãÆÌµæËµÃ÷£º
sqlite³ÌÐòͨ¹ý²éÕÒ·ÖºÅ(;)À´¾ö¶¨Ò»¸öSQLÓï¾äµÄ½áÊø,ËùÒÔÒªÖ´ÐÐSQLÓï¾äÇëÈ·±£ÔÚSQLÓï¾äºóÓзֺÅ(;).Èç¹ûÄãÊ¡ÂԷֺţ¬sqlite3½«¸øÄãÒ»¸öÁ¬ÐøµÄÃüÁîÌáʾ·û(...> )²¢µÈÄã¸øµ±Ç°µÄSQLÃüÁîÌí¼Ó¸ü¶àµÄÎÄ×Ö¡£Õâ¸öÌØµãÈÃÄãÊäÈë¶àÐеĶà¸öSQLÓï¾ä.µ«µãºÅ(.)ÃüÁî²»Òª·ÖºÅ(;).ctrl+c¿ÉÒÔ½áÊøµ±Ç°ÃüÁî¡£
ÔÚdos´°¿ÚÊäÈësqlite3 test.db,È»ºó»Ø³µ£¬½á¹ûÈçÏ£º
F:\>sqlite3 test.db
SQLite version 3.6.16
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
´ËʱÎÒÃDz¢Ã»ÓÐÔÚFÅÌÏ¿´µ½ test.db,ÐèÒªÔÚÊäÈë·ÖºÅ(;)È»ºó»Ø³µÈçÏ£º
F:\>sqlite3 test.db
SQLite version 3.6.16
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> ;
sqlite>
ÎÒÃÇÏÖÔھͿÉÒÔ¿´µ½ÔÚFÅÌÏÂÓÐtest.dbÎļþÁË¡£
¸½£º´ËÃüÁîÈç¹ûûÓÐtest.dbÊý¾Ý¿âÔò´´½¨£¬Èç¹ûÓÐÔò´ò¿ª£¬ÊµÀý¼ûÏÂÎÄ¡£
½¨Á¢±í(websites),
ÃüÁî
CREATE TABLE [websites] (
[WebID] INTEGER NOT NULL PRIMARY KEY,
[WebName] VARCHAR(20) NULL
);
×¢Òâ;²»¿ÉÉÙ";"ºÅ²»¿ÉȱÉÙ£¬·ñÔò²»Ö´ÐС£
²åÈëÊý¾Ý£º
insert into [websites] ([WebName])values('CTOChina.net');
insert into [websites] ([WebName])values('ËѺü');
insert into [websites] ([WebName])values('ÑÅ»¢');
²é¿´Êý¾Ý£º
sqlite> select * from websites;
1|CTOChina.net
2|ËѺü
3|ÑÅ»¢
sqlite>
ת×Ô£ºhttp://www.ctochina.net/topic/ShowArticle/346.html


Ïà¹ØÎĵµ£º

Sqlite ǶÈëʽÊý¾Ý¿âÒÆÖ²ºÍʹÓÃ

 
1.    Ô´´úÂëµÄ»ñÈ¡
sqliteÊÇÒ»¸ö¹¦ÄÜÇ¿´ó¡¢Ìå»ýСÔËËãËÙ¶È¿ìµÄǶÈëʽÊý¾Ý¿â£¬²ÉÓÃÁËÈ«CÓïÑÔ·â×°£¬²¢ÌṩÁ˰ËÊ®¶à¸öÃüÁî½Ó¿Ú£¬¿ÉÒÆÖ²ÐÔÇ¿£¬Ê¹Ó÷½±ã¡£
ÏÂÔØµØÖ·£ºhttp://sqlite.org/download.html
sqliteÔ´´úÂ룺sqlite-3.6.17.tar.gz
2.    sqliteÒÆÖ²µ½x86 for linu ......

ÔÚ.NET C#ÖÐʹÓÃsqlite

 1¡£´Ówww.sqlite.orgÏÂÔØSQLite 3.3.4µÄ°æ±¾
ΪÁË·½±ã£¬ÎÒ°ÑËü½âѹÁË£¬¾ÍÒ»¸öSQLite3.exe£¬·ÅÈëWindowsĿ¼Ï¡£
Cmd ½øÈëÃüÁîÐÐ
1)
´´½¨Êý¾Ý¿âÎļþ:
>SQLite3 d:\test.db »Ø³µ
¾ÍÉú³ÉÁËÒ»¸ötest.dbÔÚdÅÌ¡£
ÕâÑùͬʱҲSQLite3¹ÒÉÏÁËÕâ¸ötest.db
2)
ÓÃ.help¿ÉÒÔ¿´¿´ÓÐʲôÃüÁî
>.help »Ø³µ¼´¿É
3)¿ÉÒ ......

ǶÈëʽÊý¾Ý¿â SQLite ¼ò½é

 ×Ô¼¸Ê®Äêǰ³öÏÖµÄÉÌÒµÓ¦ÓóÌÐòÒÔÀ´£¬Êý¾Ý¿â¾Í³ÉΪÈí¼þÓ¦ÓóÌÐòµÄÖ÷Òª×é³É²¿·Ö¡£ÕýÓëÊý¾Ý¿â¹ÜÀíϵͳ·Ç³£¹Ø¼üÒ»Ñù£¬ËüÃÇÒ²±äµÃ·Ç³£ÅӴ󣬲¢Õ¼ÓÃÁËÏ൱¶àµÄϵ
ͳ×ÊÔ´£¬Ôö¼ÓÁ˹ÜÀíµÄ¸´ÔÓÐÔ¡£Ëæ×ÅÈí¼þÓ¦ÓóÌÐòÖð½¥Ä£¿éÄ£¿é»¯£¬Ò»ÖÖÐÂÐÍÊý¾Ý¿â»á±È´óÐ͸´ÔӵĴ«Í³Êý¾Ý¿â¹ÜÀíϵͳ¸üÊÊÓ¦¡£Ç¶ÈëʽÊý¾Ý¿âÖ±½ÓÔÚÓ¦ÓóÌÐò½ø³Ì
ÖÐ ......

SQLiteÖеÄÈ«ÎÄËÑË÷

    °ÝGoogleµÄScott Hessͬ־Ëù´Í£¬SQLiteÒ²ÍÆ³öÁËÈ«ÎÄËÑË÷¹¦ÄÜ¡£
    SQLiteͨ¹ý½¨Á¢Ò»¸öÐéÄâ±í£¬½«ÊäÈëµÄÎÄ×Ö¸ù¾Ý¿Õ¸ñ¡¢±êµã·ûºÏµÈ¹æÔò½øÐзִʣ¬×éÖ¯³ÉÒ»¿ÃBÊ÷£¬ÒÔ´ËÀ´Ìá¸ßËÑË÷ËÙ¶È¡£
    ÈçºÎʹÓÃÕâÒ»¹¦ÄÜ£¬ÐÔÄÜÉÏÈçºÎ£¬´ó¼Ò¸÷×ÔÑо¿È¥°É¡£
    ÔÚÕâÀ ......

SQLiteѧϰ±Ê¼Ç

 SQLiteѧϰ±Ê¼Ç
1.²é¿´ÓÐÄÄЩÊý¾Ý¿â,ÏÔʾÊý¾Ý¿âÁбí
show databases;
2.ÏÔʾ±íµÄ½á¹¹
·½·¨Ò»£º
use student;
describe student;
·½·¨¶þ£º
des student.student;
·½·¨Èý£º
show columns from student;
3.ÏÔʾMYSQLµÄ°æ±¾
select version();
4.ÏÔʾ¿âÖеÄÊý¾Ý±í
use  mysql;
show tables;
5.½¨¿â ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ