database Category

SQLite :
SQLite คือ embedded SQL database engine - เป็นไฟล์ฐานข้อมูลขนาดเล็กที่ข้อมูลทั้งหมดจะเก็บอยู่ในไฟล์เพียงแค่ไฟล์เดียว
เริ่มต้นใช้งาน SQLite :
ดาวน์โหลด command-line program เพื่อใช้เข้าถึง และ แก้ไข ข้อมูล/โครงสร้าง ฐานข้อมูล เมื่อดาวน์โหลดเสร็จแล้วจะได้ไฟล์ sqlite3.exe นำไปเก็บไว้ที่ไดรฟ์ c (หรือจะเก็บไว้ไหนก็ได้) เปิด cmd ขึ้นมา พิมพ์คำสั่ง
cd\
sqlite3 databasename.db (ถ้าไฟล์นี้ยังไม่มี มันจะสร้างให้โดยอัตโนมัติ)
SQLite version 3.3.10
Enter ”.help” for instructions
จากนั้นการสร้างตาราง หรือการ insert คำสั่งก็เหมือน ๆ กะ sql ตัวอื่น ๆ ดังตัวอย่าง

sqlite> create table tbl1(one varchar(10), two smallint);
sqlite> insert into tbl1 values(’hello!’,10);
sqlite> insert into tbl1 values(’goodbye’, 20);
sqlite> select * from tbl1;
hello!|10
goodbye|20
sqlite>

addthis_url = ‘http%3A%2F%2Fcallmebird.com%2Fweblog%2Fusing-sqlite-in-c-application’;
addthis_title = ‘%E0%B9%83%E0%B8%8A%E0%B9%89+sqlite+%E0%B8%A3%E0%B9%88%E0%B8%A7%E0%B8%A1%E0%B8%81%E0%B8%B1%E0%B8%9A+c%23′;
addthis_pub [...]

SELECT a, b,
CASE WHEN z=1 THEN ‘one’ ELSE ‘TWO’ END c
FROM table

addthis_url = ‘http%3A%2F%2Fcallmebird.com%2Fweblog%2Fusing-if-condition-in-select-query’;
addthis_title = ‘Using+If+Condition+In+Select+Query’;
addthis_pub = ‘callmebird’;

About this blog

callmebird is Bird's weblog. Bird is blogger who spend life for programming and web technology. This weblog provide web technology article for anyone who love web programming and web design.

Flickr PhotoStream

    IMG_4586

Sponsors