SQLite database download, install and learn

Source: Internet
Author: User
Tags sqlite database win32

SQLite is an open-source, embedded relational database that implements a self-contained, 0 configuration, transactional SQL database engine. It is characterized by its high portability, ease of use, compact structure, high efficiency and reliability. Unlike other database management systems, SQLite is very simple to install and run, in most cases-just make sure that sqlite binaries exist to start creating, connecting, and using the database. If you are looking for an embedded database project or solution, SQLite is definitely worth considering.

Http://database.51cto.com/art/201205/335411.htm

SQLite on Windows

1) Go to SQL download page: http://www.sqlite.org/download.html

2) Download the precompiled binaries package under Windows:

Sqlite-shell-win32-x86-<build#>.zip
Sqlite-dll-win32-x86-<build#>.zip

Note: <build#> is the compiled version number of SQLite

Unzip the zip file to your disk and add the extracted directory to the system's PATH variable for easy execution of the SQLite command at the command line.

Optional: If you plan to publish an application based on the SQLite database, you will also need to download the source code to compile and utilize its API

Sqlite-amalgamation-<build#>.zip

3. Create your first SQLite database

Now that you have the SQLite database installed, we will create the first database. In the Command Line window, enter the following command to create a database named Test.db.

Sqlite3 test.db

To create a table:

sqlite> Create table mytable (ID integer primary key, value text);

2 columns were created.

The table contains a primary key field named ID and a text field named value

Note: At a minimum, you must create a table or view for the newly created database so that you can save the database to disk or the database will not be created.

By this time test.db created the default in the C:\Users\Administrator\ directory

Next, write some data into the table:

sqlite> INSERT INTO mytable (ID, value) values (1, ' Micheal ');

sqlite> INSERT INTO mytable (ID, value) values (2, ' Jenny ');

sqlite> INSERT INTO mytable (value) values (' Francis ');

sqlite> INSERT INTO mytable (value) values (' Kerk ');

Query data:

Sqlite> SELECT * from mytable;

1| Micheal

2| Jenny

3| Francis

4| Kerk

SQLite database download, install and learn

Related Article

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.