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 do I use the SQLite zfill function?
- How do I store a timestamp in an SQLite database?
- 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 extract the year from a datetime value in SQLite?
- How do I use SQLite to retrieve data from a specific year?
- How can I use SQLite with WPF?
- How do I use SQLite with Zephyr?
- How do I use SQLite to zip a file?
- How can I use SQLite with Xamarin?
See more codes...