To install SQLite on Ubuntu, you can use the following commands:
Update your package list:
shsudo apt updateInstall the SQLite command-line tool:
shsudo apt install sqlite3Install the SQLite development libraries (optional, if you plan to develop applications using SQLite):
shsudo apt install libsqlite3-dev
Verification
After installation, you can verify that SQLite is installed correctly by checking the version:
shsqlite3 --version
This should display the installed version of SQLite.
Basic Usage Example
To create a new SQLite database and interact with it via the command line:
Create a new SQLite database:
shsqlite3 mydatabase.dbPerform CRUD operations:
Create a table:
sqlCREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT, email TEXT);Insert data:
sqlINSERT INTO users (name, email) VALUES ('John Doe', '[email protected]');Query data:
sqlSELECT * FROM users;Update data:
sqlUPDATE users SET email = '[email protected]' WHERE name = 'John Doe';Delete data:
sqlDELETE FROM users WHERE name = 'John Doe';
Exit the SQLite command-line tool:
sh.exit
SQLite is now installed and ready to use on your Ubuntu system.
No comments:
Post a Comment
If you have any doubts, please let me know.