LIMIT Clause in SQLite

SQLite LIMIT Clause To limit the number of records fetched from a table, the SQLite LIMIT clause is used with the SELECT command. Syntax 1: SELECT column1, column2, column_N FROM table_name LIMIT [no of rows] Syntax 2: Using Offset SELECT column1, column2, column_N FROM table_name LIMIT [no of rows] OFFSET [row num] Example 1: TEACHERS … Read more

GLOB in SQLite

SQLite GLOB To match the text values against a pattern, the SQLite GLOB operator is used. It uses wildcards: the asterisk sign (*) representing 0 or multiple numbers or characters; and the question mark (?) representing a single number or character. Syntax 1: SELECT FROM table_name WHERE column GLOB ‘XXXX*’ Syntax 2: SELECT FROM table_name … Read more

LIKE operator in SQLite

SQLite LIKE To match the text values against a pattern, the SQLite LIKE operator is used. It uses wildcards: the percent sign Syntax 1: SELECT FROM table_name WHERE column LIKE ‘XXX Syntax 2: SELECT FROM table_name WHERE column LIKE Syntax 3: SELECT FROM table_name WHERE column LIKE ‘XXXX_’ Syntax 4: SELECT FROM table_name WHERE column … Read more

OR condition in SQLite

SQLite OR To make multiple comparisons with different operators in the same statement, the SQLite OR clause is used. It is generally used with SELECT, UPDATE and DELETE statements. In the case of OR operation, if any of the given condition is true, the complete condition is considered true. It is always used with the … Read more

AND condition in SQLite

SQLite AND To make multiple comparisons with different operators in the same statement, the SQLite AND Operator are used. It is generally used with SELECT, UPDATE and DELETE statements. It is a conjunctive operator and is always used with the WHERE Clause. Syntax: SELECT column_1, column_2, column_N FROM table_name WHERE condition_1 AND condition_2…AND condition_N; Example: … Read more

WHERE Clause in SQLite

SQLite WHERE Clause To specify a condition for fetching only the necessary data from a table or tables, the SQLite WHERE clause is used. It is generally used with SELECT, UPDATE and DELETE statements. Syntax: SELECT column_1, column_2, column_N FROM table_name WHERE expression; Example 1: Using WHERE clause with the SELECT statement. TEACHERS Table: ID … Read more

DELETE Query in SQLite

SQLite DELETE Query To delete the existing records from a table, the DELETE query is used in SQLite. Syntax: DELETE FROM table_name WHERE conditions; Example 1: TEACHERS Table: ID NAME SUBJECT 1 Jim English 2 John Geology 3 Watson French 4 Holmes Chemistry 5 Tony Physics Example: DELETE FROM TEACHERS WHERE ID = 2;DELETE FROM … Read more

UPDATE Query in SQLite

SQLite UPDATE Query To modify the existing records in a table, the UPDATE query is used in SQLite. Syntax: UPDATE table_name SET column_1 = value_1, column_2 = value_2…., column_N = value_N WHERE conditions; Example 1: TEACHERS Table: ID NAME SUBJECT 1 Jim English 2 John Geology 3 Watson French 4 Holmes Chemistry 5 Tony Physics … Read more

SELECT Query in SQLite

SQLite SELECT Query To fetch data from a table, the SELECT statement is used in SQLite. Syntax 1: To select specific fields from a table. SELECT column_1, column_2, column_N FROM table_name WHERE expression; Syntax 2: To select all fields from a table. SELECT * FROM table_name; Example: SELECT * FROM TEACHERS;SELECT * FROM TEACHERS; Output: … Read more

Insert Query in SQLite

SQLite Insert Query To add data into a table, the INSERT INTO statement is used in SQLite. Syntax 1: If adding values to only some of the columns in a table or if adding values in random order. INSERT INTO TABLE_NAME [(column_1, column_2, column_3,…column_N)] VALUES (value_1, value_2, value_3,…value_N); Syntax 2: If adding values to all … Read more