The use of Ubuntu under Sqlite3 (will later talk about wxwidgets using sqlite3 development)

Source: Internet
Author: User
Tags sqlite wxwidgets

1. Install sqlite3 Online First, try the command installation
[Email protected]:~$ sudo apt-get install sqlite3
2. Test will appear after successful installation
[Email protected]:~$ sqlite3
SQLite version 3.7.9 2011-11-01 00:52:41
Enter '. Help ' for instructions
Enter SQL statements terminated with a ";"
Sqlite>. Exit
3. Find the path to the Sqlite3
[Email protected]:~$ which sqlite3
/usr/bin/sqlite3
[Email protected]:~$ ls
Core OSLAB1 Public Videos
Desktop OSlab2 Qt Vmwaretools
Documents OSlab3 sqlite-amalgamation-3080403 WX
Downloads OSLAB4 Sqlite-amalgamation-3080403.zip wx3.0
Examples.desktop OSlab5 Stumana Wxlab
Music Pictures Templates
4. Examples of specific sqlite3 operations
[Email protected]:~$ mkdir mydb
[Email protected]:~$ CD mydb
[Email protected]:~/mydb$ ls
[Email protected]:~/mydb$ sqlite3 stu.db
SQLite version 3.7.9 2011-11-01 00:52:41
Enter '. Help ' for instructions
Enter SQL statements terminated with a ";"
Sqlite> CREATE TABLE stu (Sno int primary key, sname text NOT NULL, sage int);
sqlite> INSERT into Stu (1, ' Lisi ', 20);
Error:near "1": Syntax error
sqlite> INSERT into Stu values (1, ' Lisi ', 20);
sqlite> INSERT INTO Stu values (2, ' Zhangsan ', 18);
Sqlite> select * from Stu;
1|lisi|20
2|zhangsan|18
Sqlite>. Exit
[Email protected]:~/mydb$ ls
Stu.db
5. Examples of specific sqlite3 operations
[Email protected]:~$ cd Stumana
[Email protected]:~/stumana$ sqlite3 stuinfo.db
SQLite version 3.7.9 2011-11-01 00:52:41
Enter '. Help ' for instructions
Enter SQL statements terminated with a ";"
Sqlite> CREATE TABLE Stuinfo (id char), name char (1) Not Null,dormitoryid char (a) not Null,phone Char 3));
sqlite> INSERT into stuinfo values (' 1115115247 ', ' LiYa ', ' 15#501 ', ' 15530061772 ', ' 614100932 ');
sqlite> INSERT into stuinfo values (' 1115115276 ', ' Zhangaihua ', ' 15#424 ', ' 18330000036 ', ' 627100056 ');
Sqlite> select * from Stuinfo;
1115115247| liya|15#501|15500761772|614100932
1115115276| zhangaihua|15#424|18330000036|627100056
Sqlite>. Exit
[Email protected]:~/stumana$ ls
Bin Stuinfo.db Stumana.depend WXWIZFRAME.FBP
GUIFrame.cpp StuManaApp.cpp stumana.layout WxWizFrame.fbp.bak
GUIFrame.h StuManaApp.h StuManaMain.cpp
Obj STUMANA.CBP StuManaMain.h
[Email protected]:~/stumana$

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.