Site icon TestingDocs.com

SQLite Statements

Overview

SQLite statements are SQL commands that we use to interact with the database. These are organized into different categories based on the CRUD operations. CRUD stands for Create, Read, Update, or Delete operations.

We can execute the statements from the command prompt, GUI tools like DB Browser, or application programs written in languages like Java, Python, etc.

SQLite Statements

SQLite Statements can be broadly classified into the following categories:

 

Data Definition Language

Statement Description Example
CREATE The CREATE statement is used to create database objects. Examples: Table, View, etc CREATE TABLE users (
uid INTEGER PRIMARY KEY,
name TEXT NOT NULL,
email_address TEXT UNIQUE,
country TEXT DEFAULT ‘USA’
);
ALTER The ALTER statement modifies an existing database object. ALTER TABLE employee
ADD COLUMN bonus INTEGER;
DROP The DROP statement deletes database objects. DROP TABLE user;

 

Data Manipulation Language

Statement Description Example
INSERT The INSERT statement is used to add new rows to the table. INSERT INTO users VALUES

(1, ‘John’,’john@example.com’,’UK’);

UPDATE The UPDATE statement modifies data in the table. UPDATE users
SET country = ‘USA’
WHERE uid = 4;

Data Query Language

Statement Description Example
SELECT The SELECT statement is used to fetch data from the tables. SELECT * FROM users;

SQLite Tutorials

SQLite tutorials on this website:

https://www.testingdocs.com/sqlite-database-tutorials/

For more information on SQLite, visit the official website:

https://www.sqlite.org/

Exit mobile version