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 do I set up an ODBC driver to connect to an SQLite database?
- How to configure SQLite with XAMPP on Windows?
- How do I use SQLite with Visual Studio?
- How do I use the SQLite ZIP VFS to compress a database?
- How do I use SQLite to zip a file?
- How do I use the SQLite VARCHAR data type?
- How can I use the XOR operator in a SQLite query?
- How do I use SQLite UNION to combine multiple SELECT queries?
- How can I use SQLite window functions in my software development project?
- How do I install SQLite on Windows?
See more codes...