Simple use of SQLite under Win7

Source: Internet
Author: User
Tags sqlite database sqlite download

Objective

SQLite is a software library that implements a self-contained, server-free, 0-configured, transactional SQL database engine. SQLite is the most widely deployed SQL database engine in the world. SQLite source code is not subject to copyright restrictions.

After a simple understanding of sqlite, I would like to try, he is so lightweight, as a programmer, I have no reason not to learn.

SQLite Download and basic usage

1, download temporarily only see 32-bit, http://www.sqlite.org/download.html

2, unzip after download, and then copy exe file to C:\Sqlite

3. Open the Run window and enter cmd

Input cd\ return to C packing directory

Re-enter the CD Sqlite, will jump to the C:\Sqlite folder (if you want to go to D-Disk, then enter D: it will be)

4. Start creating the database now: Call the Sqlite3.exe file under C:\Sqlite, and enter the command as sqlite3 C:\Sqlite\aehyok.db

Now you can see the version number of SQLite, and let's take a look at the files under C:\Sqlite

5, re-enter once Sqlite3 C:\Sqlite\aehyok.db; Although the command error, but the database is still generated, do not know why, now can be used, then continue

6. To create a database table Input command the Create table Test (ID integer primary key,name text);

Then insert two data entry commands insert into Test (id,name) VALUES (1, ' aehyok ');

Insert into Test (Id,name) VALUES (2, ' Candy ');

7. Check now for select * from Test;

8, next try to modify the data Bar Update test set name= ' Aehyoks ' where id=1;

9. Finally come again to delete the Le delete from Test where id=1;

10. Change the display mode

11. Create a View

12. Create an index

13. Display table structure

14. Displaying Tables and views

15. Get the index of the specified table

16. Export data to SQL file

17. Import the database from the SQL file

18. List the databases in the current data file

19. Backing Up the database

20. Recovering data or databases

1 means the data has been emptied

2 represents the recovery data or database can be the following three error is actually the process of recovering data structure

3 data has been recovered and the original data can be detected.

Summarize

A simple test of some basic SQL instructions, the feeling is relatively simple, this can also be used as a tool for app data storage development. Good thing, to use this super lightweight SQLite database in Python learning.

Personal website Address: aehyok.com

QQ Technology Group Number: 206058845, Verification code: Aehyok

This article links to: http://www.cnblogs.com/aehyok/p/3981965.html

Thank you for your reading, if you are interested in the content of my blog, it is advisable to point a recommendation, thank you for supporting:-O.

Simple use of SQLite under Win7

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.