sqliteHow do I install and use SQLite on Ubuntu?
- Install SQLite on Ubuntu by running the command
sudo apt-get install sqlite3in a terminal window. - Create a new database by running the command
sqlite3 <database_name>in the same terminal window. - Create a table in the database by running the command
CREATE TABLE <table_name> (<column_name> <data_type>). - Add records to the table using the command
INSERT INTO <table_name> VALUES (<value1>, <value2>, ...). - Retrieve records from the table using the command
SELECT * FROM <table_name>. - Update existing records using the command
UPDATE <table_name> SET <column_name> = <new_value> WHERE <column_name> = <value>. - Delete records from the table using the command
DELETE FROM <table_name> WHERE <column_name> = <value>.
Example code block:
sqlite> CREATE TABLE users (name TEXT, age INTEGER);
sqlite> INSERT INTO users VALUES ('John', 25);
sqlite> SELECT * FROM users;
name age
---------- ----------
John 25
Helpful links
More of Sqlite
- How can SQLite and ZFS be used together for software development?
- How do I use the SQLite ZIP VFS to compress a database?
- How do I use the SQLite zfill function?
- How do I call sqlitepcl.raw.setprovider() when using SQLite?
- How do I use SQLite to retrieve data from a specific year?
- How to configure SQLite with XAMPP on Windows?
- How can I use SQLite with Zabbix?
- How do I use SQLite xfilter to filter data?
- How do I generate XML output from a SQLite database?
- How do I use SQLite Studio to manage my database?
See more codes...