Category: 1. SQL Lite
-
DISTINCT Keyword
SQLite DISTINCT keyword is used in conjunction with SELECT statement to eliminate all the duplicate records and fetching only the unique records. There may be a situation when you have multiple duplicate records in a table. While fetching such records, it makes more sense to fetch only unique records instead of fetching duplicate records. Syntax Following is…
-
HAVING Clause
HAVING clause enables you to specify conditions that filter which group results appear in the final results. The WHERE clause places conditions on the selected columns, whereas the HAVING clause places conditions on groups created by GROUP BY clause. Syntax Following is the position of HAVING clause in a SELECT query. HAVING clause must follow…
-
GROUP BY Clause
SQLite GROUP BY clause is used in collaboration with the SELECT statement to arrange identical data into groups. GROUP BY clause follows the WHERE clause in a SELECT statement and precedes the ORDER BY clause. Syntax Following is the basic syntax of GROUP BY clause. GROUP BY clause must follow the conditions in the WHERE clause and…
-
ORDER BY Clause
SQLite ORDER BY clause is used to sort the data in an ascending or descending order, based on one or more columns. Syntax Following is the basic syntax of ORDER BY clause. You can use more than one column in the ORDER BY clause. Make sure whatever column you are using to sort, that column should be…
-
LIMIT Clause
SQLite LIMIT clause is used to limit the data amount returned by the SELECT statement. Syntax Following is the basic syntax of SELECT statement with LIMIT clause. Following is the syntax of LIMIT clause when it is used along with OFFSET clause.SELECT column1, column2, columnN FROM table_name LIMIT [no of rows] OFFSET [row num] SQLite engine will…
-
GLOB Clause
SQLite GLOB operator is used to match only text values against a pattern using wildcards. If the search expression can be matched to the pattern expression, the GLOB operator will return true, which is 1. Unlike LIKE operator, GLOB is case sensitive and it follows syntax of UNIX for specifying THE following wildcards. The asterisk sign (*)…
-
LIKE Clause
SQLite LIKE operator is used to match text values against a pattern using wildcards. If the search expression can be matched to the pattern expression, the LIKE operator will return true, which is 1. There are two wildcards used in conjunction with the LIKE operator − The percent sign represents zero, one, or multiple numbers or characters.…
-
DELETE Query
SQLite DELETE Query is used to delete the existing records from a table. You can use WHERE clause with DELETE query to delete the selected rows, otherwise all the records would be deleted. Syntax Following is the basic syntax of DELETE query with WHERE clause.DELETE FROM table_name WHERE [condition]; You can combine N number of conditions using AND or…
-
UPDATE Query
SQLite UPDATE Query is used to modify the existing records in a table. You can use WHERE clause with UPDATE query to update selected rows, otherwise all the rows would be updated. Syntax Following is the basic syntax of UPDATE query with WHERE clause. You can combine N number of conditions using AND or OR operators. Example Consider COMPANY…
-
AND & OR Operators
SQLite AND & OR operators are used to compile multiple conditions to narrow down the selected data in an SQLite statement. These two operators are called conjunctive operators. These operators provide a means to make multiple comparisons with different operators in the same SQLite statement. The AND Operator The AND operator allows the existence of multiple conditions in a SQLite statement’s WHERE…