SQLite Overview
• SQLite is a lightweight, serverless database.
• It stores data in a single file.
• Widely used in mobile apps and embedded systems.
Installing SQLite
1. Go to [Link]
2. Download SQLite tools
3. Extract files
4. Add to system PATH
5. Verify using: sqlite3
Starting SQLite
Open command prompt
Type: sqlite3
SQLite shell will start
You can now run SQL commands
Creating a Database
Command:
sqlite3 [Link]
If file does not exist, it will be created automatically
Creating a Table
CREATE TABLE student(
id INTEGER PRIMARY KEY,
name TEXT,
marks INTEGER);
Inserting Data
INSERT INTO student(name, marks) VALUES('John', 85);
Add multiple records similarly
Viewing Data
SELECT * FROM student;
- Displays all records in the table
Updating Data
UPDATE student SET marks = 90 WHERE name = 'John';
Deleting Data
DELETE FROM student WHERE name = 'John';
Dropping Table
DROP TABLE student;
- Deletes the table permanently