sqliteHow do I use SQLite on Windows?
SQLite is a lightweight database system that can be used on Windows. It is a self-contained, serverless, zero-configuration, transactional SQL database engine. The following steps explain how to use SQLite on Windows:
-
Download and install the SQLite command-line shell for your platform.
-
Create a new database file with the
sqlite3command:
sqlite3 test.db
This will create a new database file called test.db in the current directory.
- Create a table with the
CREATE TABLEcommand:
CREATE TABLE users (
id INTEGER PRIMARY KEY,
name TEXT NOT NULL,
age INTEGER
);
- Insert some data with the
INSERT INTOcommand:
INSERT INTO users (name, age) VALUES ('John', 25);
INSERT INTO users (name, age) VALUES ('Jane', 32);
- Query the data with the
SELECTcommand:
SELECT * FROM users;
This will output the following:
id name age
---------- ---------- ----------
1 John 25
2 Jane 32
- Finally, close the database with the
.exitcommand:
.exit
This will save the changes and close the database.
More of Sqlite
- How do I set up an ODBC driver to connect to an SQLite database?
- How can I use SQLite with Zabbix?
- How do I use SQLite with Visual Studio?
- How do I use UUIDs in SQLite?
- How do I install and use SQLite on Ubuntu?
- How do I truncate a table in SQLite?
- How do I use the SQLite sequence feature?
- How do I troubleshoot a near syntax error when using SQLite?
- How do I decide between using SQLite and MySQL for my software development project?
See more codes...