To install SQLite on Ubuntu, you can use the following commands:
Update your package list:
shsudo apt update
Install the SQLite command-line tool:
shsudo apt install sqlite3
Install 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.db
Perform 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', 'john@example.com');
Query data:
sqlSELECT * FROM users;
Update data:
sqlUPDATE users SET email = 'john.doe@example.com' 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.
Comments
Post a Comment
If you have any doubts, please let me know.