Skip to main content

Posts

Showing posts from December, 2019

Data types in SQL

Data types in SQL Data type is nothing but type of the data Data types used in SQL :   String type values :  CHAR : length vary between  1 to 1000 bytes VARCHAR :  length vary between  1 to 2000 bytes VARCHAR2 :  length vary between  1 to 4000 bytes LONG   : upto 2 GB  Numeric type values :  NUMBER INTGER Date type values :  DATE

Scalar function in SQL

Scalar function Scalar function:  Scalar function takes one or more parameters and returns a single value These functions are based on user input, these too returns single value.  UCASE() LCASE()  MID()  LEN()  ROUND()  NOW()  FORMAT()

Aggregate Functions in SQL

Aggregate Functions Aggregate Functions : An aggregate function performs a calculation on a set of values, and returns a single value. Except for COUNT, aggregate functions ignore null values. Aggregate functions are often used with the GROUP BY clause of the SELECT statement. aggregate functions return the same value each time that they are called, when called with a specific set of input values. The following are the commonly used SQL aggregate functions: AVG() – returns the average of a set. COUNT() – returns the number of items in a set. MAX() – returns the maximum value in a set. MIN() – returns the minimum value in a set. SUM() – returns the sum of all or distinct values in a set.