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
sqlite3
command:
sqlite3 test.db
This will create a new database file called test.db
in the current directory.
- Create a table with the
CREATE TABLE
command:
CREATE TABLE users (
id INTEGER PRIMARY KEY,
name TEXT NOT NULL,
age INTEGER
);
- Insert some data with the
INSERT INTO
command:
INSERT INTO users (name, age) VALUES ('John', 25);
INSERT INTO users (name, age) VALUES ('Jane', 32);
- Query the data with the
SELECT
command:
SELECT * FROM users;
This will output the following:
id name age
---------- ---------- ----------
1 John 25
2 Jane 32
- Finally, close the database with the
.exit
command:
.exit
This will save the changes and close the database.
More of Sqlite
- How can SQLite and ZFS be used together for software development?
- How to configure SQLite with XAMPP on Windows?
- How do I use the SQLite sequence feature?
- How do I use SQLite with Visual Studio?
- How do I use UUIDs in SQLite?
- How do I use SQLite to retrieve data from a specific year?
- How can I query a SQLite database for records from yesterday's date?
- How do I create a SQLite query using Xamarin?
- How do I use SQLite UNION to combine multiple SELECT queries?
- How can I use SQLite with Xamarin Forms and C#?
See more codes...