Use the SQLite under VC

Source: Internet
Author: User
Tags exit documentation sqlite sqlite database

Introduction of SQLite

SQLite is a C-language open source database, mainly for embedded, you can also integrate it in your own desktop program, but also someone to replace access, as a background database.

SQLite supports most SQL92 standards, such as indexing, throttling, triggering, and viewing support.

Supports transactions with NULL, INTEGER, Real, TEXT, and BLOB data types.

Second, download SQLite

SQLite can be downloaded to the official site

Includes: Linux,mac OS X, compiled files under Windows, and source code, help documentation.

Three, the simple use of SQLite

3.1 Establishing a database

C:\sqlite-3_6_11> sqlite3.exe dbname.db

Sqlite3.exe followed by the database file name

3.2 Creating data tables

sqlite> create table users(userid varchar(20) PRIMARY KEY,
  ...> age int,
  ...> birthday datetime);

3.3 Adding records

insert into users values('wang',20,'1989-5-4');
insert into users values('li',22,'1987-11-16');

3.4 Query Records

select * from users order by birthday;

3.5 Deleting records

delete from users where userid='wang';

3.6 Exit SQLite

sqlite> .exit

The data structure of the SQLite database is stored in the "sqlite_master" table

Specific commands can be entered. Help view or refer to assistance documentation

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.