SQLAlchemy Core β func Function
It is an object in SQLAlchemy that serves as a namespace for SQL functions.
Syntax: func.function_name(column).
Parameters:
- func: It is an object in SQLAlchemy that serves as a namespace for SQL functions.
- function_name(): Which represents the SQL function EX: avg, count, sum, max, minβ¦
- column: Represents a column of table in Database.
Return: returns a SQL Expression which represents the SQL function call with specified column.
For our examples, we have already created a Student table which we will be using:
SQLAlchemy Core β Functions
SQLAlchemy provides a rich set of functions that can be used in SQL expressions to perform various operations and calculations on the data. SQLAlchemy provides the Function API to work with the SQL functions in a more flexible manner. The Function API is used to construct SQL expressions representing function calls and can be applied to columns. SQL functions are invoked by using the func namespace.
Prerequisites