Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to use SQLite database under Ubuntu 12.04

Shulou Source: shulou.com Published: 2022-06-01 05:26:12 09月18日 Update

Editor to share with you how to use the SQLite database under Ubuntu 12.04, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

A simple example of SQLite development under Ubuntu 12.04 is as follows:

1. Install SQLite3

Hadron@hadron ~ $sudo apt-get install sqlite sqlite3

2. Check the version number

Hadron@hadron ~ $sqlite3-version

3. Create a test database

Hadron@hadron ~ $sqlite3 test.db

SQLite version 3.7.9 2011-11-01 00:52:41

Enter ".help" for instructions

Enter SQL statements terminated with a ";"

Sqlite >

4. View the database

Sqlite > .database

Seq name file

0 main / home/hadron/test.db

5. Create a data table

Sqlite > create table user (id,username,password)

6. Insert data

Sqlite > insert into user (id,username,password) values (1)

7. Query data

Sqlite > select * from user

1 | abc | 123

8. Exit the database

Sqlite > .exit

9. Enter the database again

Hadron@hadron ~ $sqlite3

SQLite version 3.7.9 2011-11-01 00:52:41

Enter ".help" for instructions

Enter SQL statements terminated with a ";"

Sqlite >

10. Install visualization tools:

Hadron@hadron ~ $sudo apt-get install sqlitebrowser

These are all the contents of this article entitled "how to use SQLite Database under Ubuntu 12.04". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Data database article content not much again most examples tools datasheets more versions knowledge industry information information channels channels references visualization learning Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno Xiaomi vpn macOS MariaDB