SQLite Tutorial

  • Home
  • Start Here
  • Views
  • Indexes
  • Triggers
  • Functions
    • Aggregate Functions
    • Date Functions
    • String Functions
    • Window Functions
  • API
    • SQLite Python
    • SQLite Node.js
    • SQLite Java
    • SQLite PHP
  • Try It
Home / SQLite Functions

SQLite Functions

This section provides you with the core SQLite functions including aggregate functions, date & time functions, string functions, and Math functions.

SQLite Aggregate Functions

SQLite Aggregate Functions

This tutorial shows you how to use the SQLite aggregate functions to find the maximum, minimum, average, sum, and count of a set of values.
SQLite Date Functions

SQLite Date Functions

This section provides you with SQLite date and time functions that help you manipulate datetime data effectively.
SQLite String Functions

SQLite String Functions

This section shows the most commonly used SQLite string functions that help you manipulate character string data effectively.
SQLite Window Functions

SQLite Window Functions

SQLite window functions perform a calculation on a set of rows that are related to the current row. Unlike aggregate functions, window functions do not cause rows to become grouped into a single result row.

SQLite aggregate functions

NameDescription
AVGReturn the average value of non-null values in a group
COUNTReturn the total number of rows in a table.
MAXReturn the maximum value of all values in a group.
MINReturn the minimum value of all values in a group.
SUMReturn the sum of all non-null values in a column
GROUP_CONCATConcatenate non-null values in a column

SQLite string functions

NameDescription
SUBSTRExtract and returns a substring with a predefined length starting at a specified position in a source string
TRIMReturn a copy of a string that has specified characters removed from the beginning and the end of a string.
LTRIMReturn a copy of a string that has specified characters removed from the beginning of a string.
RTRIMReturn a copy of a string that has specified characters removed from the end of a string.
LENGTHReturn the number of characters in a string or the number of bytes in a BLOB.
REPLACEReturn a copy of a string with each instance of a substring replaced by the other substring.
UPPERReturn a copy of a string with all of the characters converted to uppercase.
LOWERReturn a copy of a string with all of the characters converted to lowercase.
INSTRFind a substring in a string and returns an integer indicating the position of the first occurrence of the substring.

SQLite control flow functions

NameDescription
COALESCEReturn the first non-null argument
IFNULLProvide the NULL if/else construct
IIFAdd if-else logic to queries.
NULLIFReturn NULL if the first argument is equal to the second argument.

SQlite date and time functions

NameDescription
DATECalculate the date based on multiple date modifiers.
TIMECalculate the time based on multiple date modifiers.
DATETIMECalculate the date & time based on one or more date modifiers.
JULIANDAYReturn the Julian day, which is the number of days since noon in Greenwich on November 24, 4714 B.C.
STRFTIMEFormat the date based on a specified format string.

SQLite math functions

NameDescription
ABSReturn the absolute value of a number
RANDOMReturn a random floating-point value between the minimum and maximum integer values
ROUNDRound off a floating value to a specified precision.
  • Was this tutorial helpful ?
  • YesNo
Previous SQLite Trigger
Next SQLite Aggregate Functions

Getting Started

  • What Is SQLite
  • Download & Install SQLite
  • SQLite Sample Database
  • SQLite Commands

SQLite Tutorial

  • SQLite Select
  • SQLite Order By
  • SQLite Select Distinct
  • SQLite Where
  • SQLite Limit
  • SQLite BETWEEN
  • SQLite IN
  • SQLite Like
  • SQLite IS NULL
  • SQLite GLOB
  • SQLite Join
  • SQLite Inner Join
  • SQLite Left Join
  • SQLite Cross Join
  • SQLite Self-Join
  • SQLite Full Outer Join
  • SQLite Group By
  • SQLite Having
  • SQLite Union
  • SQLite Except
  • SQLite Intersect
  • SQLite Subquery
  • SQLite EXISTS
  • SQLite Case
  • SQLite Insert
  • SQLite Update
  • SQLite Delete
  • SQLite Replace
  • SQLite Transaction

SQLite Data Definition

  • SQLite Data Types
  • SQLite Date & Time
  • SQLite Create Table
  • SQLite Primary Key
  • SQLite Foreign Key
  • SQLite NOT NULL Constraint
  • SQLite UNIQUE Constraint
  • SQLite CHECK constraints
  • SQLite AUTOINCREMENT
  • SQLite Alter Table
  • SQLite Rename Column
  • SQLite Drop Table
  • SQLite Create View
  • SQLite Drop View
  • SQLite Index
  • SQLite Expression-based Index
  • SQLite Trigger
  • SQLite VACUUM
  • SQLite Transaction
  • SQLite Full-text Search

SQLite Tools

  • SQLite Commands
  • SQLite Show Tables
  • SQLite Describe Table
  • SQLite Dump
  • SQLite Import CSV
  • SQLite Export CSV

SQLite Functions

  • SQLite AVG
  • SQLite COUNT
  • SQLite MAX
  • SQLite MIN
  • SQLite SUM

SQLite Interfaces

  • SQLite PHP
  • SQLite Node.js
  • SQLite Java
  • SQLite Python

About SQLite Tutorial

SQLite Tutorial website helps you master SQLite quickly and easily. It explains the complex concepts in simple and easy-to-understand ways so that you can both understand SQLite fast and know how to apply it in your software development work more effectively.

Looking for a tutorial…

If you did not find the tutorial that you are looking for, you can use the following search box. In case the tutorial is not available, you can request for it using the request for a SQLite tutorial form.

Recent Tutorials

  • SQLite IIF
  • SQLite Generated Columns
  • SQLite Getting Started
  • SQLite Programming Interfaces
  • SQLite Concat
  • SQLite INSTEAD OF Triggers
  • SQLite Join
  • SQLite IS NULL

Site Links

  • Home
  • About
  • Contact
  • Resources
  • Privacy Policy

Copyright © 2021 SQLite Tutorial. All Rights Reserved.