0% found this document useful (0 votes)
30 views

InBuilt Functions SQL

This document provides examples of string, date, and other functions for various database systems like PostgreSQL, Oracle, MySQL, and Microsoft SQL Server. It includes functions like CONCAT, LEFT, RIGHT, LENGTH, SUBSTRING, and DATE functions like CURRENT_DATE, EXTRACT, and DATEADD among others along with brief syntax examples.

Uploaded by

astrolios
Copyright
© © All Rights Reserved
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views

InBuilt Functions SQL

This document provides examples of string, date, and other functions for various database systems like PostgreSQL, Oracle, MySQL, and Microsoft SQL Server. It includes functions like CONCAT, LEFT, RIGHT, LENGTH, SUBSTRING, and DATE functions like CURRENT_DATE, EXTRACT, and DATEADD among others along with brief syntax examples.

Uploaded by

astrolios
Copyright
© © All Rights Reserved
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
You are on page 1/ 29

* The function list just contains the most frequently used functions in SQL.

It does not cover

* It's not required to memorize all of these functions, just glance through them so you know

* Some of the functions may have additional functionalities which may not be covered in my
SQL. It does not cover all of them

gh them so you know what are the different things you can easily achieve using these inbuilt functions

y not be covered in my example. Please refer the reference links provided for additional details
these inbuilt functions

ditional details
SI.NO RDBMS FUNCTION TYPE

1 PostgreSQL CONCAT String function

2 PostgreSQL LEFT String function

3 PostgreSQL RIGHT String function

4 PostgreSQL LENGTH String function

5 PostgreSQL LPAD String function

6 PostgreSQL RPAD String function

7 PostgreSQL POSITION String function

8 PostgreSQL REPLACE String function

9 PostgreSQL SUBSTRING String function

10 PostgreSQL TRANSLATE String function

11 PostgreSQL TRIM / LTRIM / RTRIM String function

12 PostgreSQL TO_CHAR String function

13 PostgreSQL COALESCE String function

14 PostgreSQL AGE Date function


15 PostgreSQL CURRENT_DATE Date function
16 PostgreSQL CURRENT_TIME Date function

17 PostgreSQL CURRENT_TIMESTAMP Date function

18 PostgreSQL EXTRACT Date function

19 PostgreSQL TO_DATE Date function


20 Oracle CONCAT String function
21 Oracle INSTR String function

22 Oracle SUBSTR String function

23 Oracle LENGTH String function


24 Oracle UPPER String function
25 Oracle LOWER String function

26 Oracle LPAD String function

27 Oracle RPAD String function

28 Oracle TRIM / LTRIM / RTRIM String function

29 Oracle REPLACE String function

30 Oracle TRANSLATE String function

31 Oracle NVL String function

32 Oracle ADD_MONTHS Date function

33 Oracle CURRENT_DATE Date function

34 Oracle CURRENT_TIMESTAMP Date function

35 Oracle EXTRACT Date function


36 Oracle LAST_DAY Date function
37 Oracle MONTHS_BETWEEN Date function
38 Oracle NEXT_DAY Date function

39 Oracle ROUND Date function

40 Oracle SYSDATE Date function

41 Oracle TO_CHAR Date function

42 Oracle TO_DATE Date function


43 Oracle TRUNC Date function
44 Microsoft SQL Server CHARINDEX String function
45 Microsoft SQL Server CONCAT String function

46 Microsoft SQL Server COALESCE String function

47 Microsoft SQL Server LEFT String function

48 Microsoft SQL Server LEN String function

49 Microsoft SQL Server TRIM / LTRIM / RTRIM String function

50 Microsoft SQL Server LOWER / UPPER String function

51 Microsoft SQL Server PATINDEX String function

52 Microsoft SQL Server REPLACE String function

53 Microsoft SQL Server REPLICATE String function


54 Microsoft SQL Server REVERSE String function

55 Microsoft SQL Server RIGHT String function

56 Microsoft SQL Server STR String function


57 Microsoft SQL Server STRING_AGG String function

58 Microsoft SQL Server STRING_SPLIT String function

59 Microsoft SQL Server STUFF String function

60 Microsoft SQL Server SUBSTRING String function

61 Microsoft SQL Server TRANSLATE String function

62 Microsoft SQL Server CURRENT_TIMESTAMP Date function

63 Microsoft SQL Server GETDATE Date function

64 Microsoft SQL Server DATENAME Date function


65 Microsoft SQL Server DATEPART Date function
66 Microsoft SQL Server DAY Date function
67 Microsoft SQL Server MONTH Date function
68 Microsoft SQL Server YEAR Date function
69 Microsoft SQL Server DATEDIFF Date function

70 Microsoft SQL Server DATEADD Date function

71 Microsoft SQL Server ISDATE Date function

72 Microsoft SQL Server CAST Date/String function

73 MySQL CONCAT String function

74 MySQL CONCAT_WS String function

75 MySQL INSTR String function


76 MySQL LENGTH String function
77 MySQL LEFT String function

78 MySQL LOWER / UPPER String function

79 MySQL TRIM / LTRIM / RTRIM String function

80 MySQL REPLACE String function

81 MySQL RIGHT String function


82 MySQL SUBSTRING String function

83 MySQL SUBSTRING_INDEX String function

84 MySQL FIND_IN_SET String function

85 MySQL FORMAT String function

86 MySQL IFNULL String function


87 MySQL CURDATE Date function

88 MySQL DATEDIFF Date function

89 MySQL DAY Date function

90 MySQL DATE_ADD Date function

91 MySQL DATE_SUB Date function

92 MySQL DATE_FORMAT Date function

93 MySQL EXTRACT Date function

94 MySQL LAST_DAY Date function

95 MySQL NOW Date function


96 MySQL MONTH Date function
97 MySQL STR_TO_DATE Date function

98 MySQL SYSDATE Date function


99 MySQL WEEK Date function

100 MySQL WEEKDAY Date function

101 MySQL YEAR Date function


SYNTAX

CONCAT('tech', 'TFQ') ==> techTFQ


LEFT('techTFQ', 4) ==> tech
LEFT('techTFQ', -2) ==> techT
RIGHT('techTFQ', 3) ==> TFQ
RIGHT('techTFQ', -2) ==> chTFQ
LENGTH('techTFQ') ==> 7

LPAD('techTFQ', 10, '*') ==> ***techTFQ

RPAD('techTFQ', 10, '*') ==> techTFQ***

POSITION('TFQ' IN 'techTFQ') ==> 5


REPLACE('techTFQ', 'ch', 'XX') ==> teXXTFQ
REPLACE('techTFQ', 't', 'z') ==> zechTFQ
SUBSTRING('techTFQ', 1, 4) ==> tech
SUBSTRING('techTFQ', 4) ==> hTFQ

TRANSLATE('techTFQ', 'tFQ', 'XYZ') ==> XechTYZ

TRIM(' techTFQF FF', 'F') -- ==> " techTFQF "


TRIM(' techTFQ ') ==> "techTFQ"
LTRIM(' techTFQ ') ==> "techTFQ "
RTRIM(' techTFQ ') ==> " techTFQ"

TO_CHAR(current_date, 'Mon') ==> 'Sep'


TO_CHAR(current_date, 'MM/YYYY') ==> '09/2022'

select COALESCE(NULL, '2nd argument'); ==> "2nd argument"


select COALESCE(NULL, NULL, '3rd argument'); ==> "3rd argument"
select COALESCE(NULL, NULL, 'NULL', '4th argument'); ==> "NULL"
AGE(current_date, '1986-07-05') ==> "36 years 2 mons 10 days"
SELECT CURRENT_DATE; ==> "2022-09-15"
SELECT CURRENT_TIME; ==> ""21:00:22.640298+08:00""

SELECT CURRENT_TIMESTAMP; ==> "2022-09-15 21:01:24.557127+08"

SELECT EXTRACT(YEAR FROM TIMESTAMP '2016-12-31 13:30:15'); ==> 2016


SELECT EXTRACT(DAY FROM TIMESTAMP '2016-12-31 13:30:15'); ==> 31
SELECT EXTRACT(MONTH FROM DATE '2016-12-31'); ==> 12
SELECT TO_DATE('2020-05-07', 'YYYY-MM-DD') ==> "2020-05-07" (Date datatype)
CONCAT('tech', 'TFQ') ==> techTFQ
SELECT INSTR('techtfq', 't', 1) from dual; ==> 1
SELECT INSTR('techtfq', 't', 1, 1) from dual; ==> 1 (searches for 1st occurence for "t". Starts search
from first character)

SELECT INSTR('techtfq', 't', 1, 2) from dual; ==> 5

SELECT INSTR('techtfq', 't', 1, 3) from dual; ==> 0 (Searches for 3rd occurrence of "t". Starts
search from first character)

select SUBSTR('techTFQ', 1) from dual; ==> "techTFQ"

select SUBSTR('techTFQ', 2) from dual; ==> "echTFQ"

select SUBSTR('techTFQ', 1, 4) from dual; ==> "tech"

select SUBSTR('techTFQ', 2, 4) from dual; ==> "echT"


select SUBSTR('techTFQ', -3) from dual; ==> "TFQ"

LENGTH('techTFQ') ==> 7
UPPER('techTFQ') ==> "TECHTFQ"
LOWER('techTFQ') ==> "techtfq"

LPAD('techTFQ', 10, '*') ==> ***techTFQ

RPAD('techTFQ', 10, '*') ==> techTFQ***

TRIM(' techTFQF FF', 'F') -- ==> " techTFQF "


TRIM(' techTFQ ') ==> "techTFQ"

LTRIM(' techTFQ ') ==> "techTFQ "


RTRIM(' techTFQ ') ==> " techTFQ"

REPLACE('techTFQ', 'ch', 'XX') ==> teXXTFQ


REPLACE('techTFQ', 't', 'z') ==> zechTFQ

TRANSLATE('techTFQ', 'tFQ', 'XYZ') ==> XechTYZ

SELECT NVL(NULL, 'some value') ==> "some value"

ADD_MONTHS( DATE '2016-02-29', 1 ) ==> 31-MAR-16

SELECT CURRENT_DATE FROM dual ==> 06-AUG-2017 19:43:44

SELECT CURRENT_TIMESTAMP FROM dual ==> 06-AUG-17 08.26.52.742000000 PM -07:00

EXTRACT(YEAR FROM SYSDATE) ==> 2022


LAST_DAY(DATE '2016-02-01') ==> 29-FEB-16
MONTHS_BETWEEN( DATE '2017-07-01', DATE '2017-01-01' ) ==> 6
NEXT_DAY( DATE '2000-01-01', 'SUNDAY' ) ==> 02-JAN-00
ROUND(DATE '2017-07-16', 'MM') ==> 01-AUG-17
ROUND(DATE '2017-07-14', 'MM') ==> 01-JUL-17

SELECT SYSDATE FROM DUAL; ==> 15-SEP-2022

TO_CHAR( DATE'2017-01-01', 'DL' ) ==> Sunday, January 01, 2017

TO_DATE( '01 Jan 2017', 'DD MON YYYY' ) ==> 01-JAN-17


TRUNC(DATE '2017-07-16', 'MM') ==> 01-JUL-17
SELECT CHARINDEX('TFQ', 'techTFQ'); ==> 5
CONCAT('tech', 'TFQ') ==> techTFQ
select COALESCE(NULL, '2nd argument'); ==> "2nd argument"
select COALESCE(NULL, NULL, '3rd argument'); ==> "3rd argument"
select COALESCE(NULL, NULL, 'NULL', '4th argument'); ==> "NULL"

SELECT LEFT('techTFQ', 4) ==> "tech"

select TRIM('F' from ' techTFQF FF') ==> "" techTFQF ""
select TRIM(' techTFQ ') ==> ""techTFQ""
select LTRIM(' techTFQ ') ==> ""techTFQ ""
select RTRIM(' techTFQ ') ==> "" techTFQ"

LOWER('techTFQ') ==> "techtfq"


UPPER('techTFQ') ==> "TECHTFQ"
PATINDEX('%$%', 'tech$TFQ') ==> 5
REPLACE('techTFQ', 'ch', 'XX') ==> teXXTFQ
REPLACE('techTFQ', 't', 'z') ==> zechzFQ
REPLICATE('TFQ', 3) ==> "TFQTFQTFQ"
REVERSE('techTFQ') ==> "QFThcet"

RIGHT('techTFQ', 3) ==> "TFQ"

select 'Class' + STR(1,1,1) ==> "Class1"


select STR('123.456') ==> " 123"
select STR('123.456',6,2) ==> "123.46"
select STR('123.456',8,2) ==> " 123.46"
select STR('123.456',8,3) ==> " 123.456"
create table jobs(department varchar(20), role varchar(20));
insert into jobs values ('Data Science', 'Data Analyst');
insert into jobs values ('Data Science', 'Data Scientist');
insert into jobs values ('Data Science', 'Data Engineer');
insert into jobs values ('Software Engineering', 'Java Developer');
insert into jobs values ('Software Engineering', 'Python Developer');
select * from jobs;

select department, STRING_AGG(role, ', ') as role


from jobs
group by department;

select department, STRING_AGG(role, ', ') WITHIN GROUP (order by role) as role
from jobs
group by department;

==>> OUTPUT:
"Data Science Data Analyst, Data Scientist, Data Engineer"
"Software Engineering Java Developer, Python Developer"

select value
from STRING_SPLIT('James,David,Robin,Mark', ',');
==>> OUTOUT:
"James
David
Robin
Mark"

select STUFF('Live Classes', 5, 0, ' SQL'); ==> "Live SQL Classes"


select STUFF('Live Classes', 1, 4, 'Live SQL'); ==> "Live SQL Classes"
select STUFF('Password: Admin1234', 11, 9, REPLICATE('x',9)); ==> "Password: xxxxxxxxx"
SUBSTRING('techTFQ', 1, 4) ==> tech

TRANSLATE('techTFQ', 'tFQ', 'XYZ') ==> "XechXYZ"

select CURRENT_TIMESTAMP ==> "2022-11-23 16:20:53.287"

select GETDATE() ==> "2022-11-23 16:21:30.057"

select DATEPART(year, CURRENT_TIMESTAMP) ==> "2022" (Return type is String)


select DATEPART(year, CURRENT_TIMESTAMP) ==> "2022" (Return type is Integer)
select DAY('2010-03-22') ==> 22
select MONTH('2010-03-22') ==> 3
select YEAR('2010-03-22') ==> 2010
select DATEDIFF(YEAR, '2010-03-22 19:30:10.1234567', '2020-06-30 21:35:15.999999') ==> 10
select DATEDIFF(QUARTER, '2010-03-22 19:30:10.1234567', '2020-06-30 21:35:15.999999') ==>
41
select DATEDIFF(MONTH, '2010-03-22 19:30:10.1234567', '2020-06-30 21:35:15.999999') ==>
123
select DATEDIFF(DAY, '2010-03-22 19:30:10.1234567', '2020-06-30 21:35:15.999999') ==> 3753
select DATEDIFF(HOUR, '2010-03-22 19:30:10.1234567', '2020-06-30 21:35:15.999999') ==>
90074
select DATEDIFF(MINUTE, '2010-03-22 19:30:10.1234567', '2020-06-30 21:35:15.999999') ==>
5404445
select DATEDIFF(SECOND, '2010-03-22 19:30:10.1234567', '2020-06-30 21:35:15.999999') ==>
324266705

SELECT DATEADD(DAY, 5, '2020-01-01') ==> 2020-01-06 00:00:00.000


SELECT DATEADD(MONTH, 2, '2020-01-01') ==> 2020-03-01 00:00:00.000

SELECT ISDATE('2020-03-31') ==> 1


SELECT ISDATE('2020-13-31') ==> 0
SELECT ISDATE('2020-11-31') ==> 0

select CAST('2013-10-03' as date) ==> "2013-10-03" (Returns Date data type)


select CAST('2013-10-03' as TEXT) ==> "2013-10-03" (Returns string data type)
SELECT CONCAT('SENIOR', 'SOFTWARE', 'ENGINEER') ==> "SENIORSOFTWAREENGINEER"
SELECT CONCAT_WS(', ', 'SENIOR', 'SOFTWARE', 'ENGINEER') ==> "SENIOR, SOFTWARE,
ENGINEER"
SELECT INSTR('SENIOR SOFTWARE ENGINEER', 'ENG') ==> 17
SELECT LENGTH('SENIOR SOFTWARE ENGINEER') ==> 24
SELECT LEFT('SENIOR SOFTWARE ENGINEER', 10) ==> "SENIOR SOF"
SELECT LOWER('SENIOR SOFTWARE ENGINEER') ==> "senior software engineer"

SELECT UPPER('senior software engineer') ==> "SENIOR SOFTWARE ENGINEER"

select TRIM('F' from ' techTFQF FF') ==> "" techTFQF ""
select TRIM(' techTFQ ') ==> ""techTFQ""
select LTRIM(' techTFQ ') ==> ""techTFQ ""
select RTRIM(' techTFQ ') ==> "" techTFQ"

SELECT REPLACE('techTFQ', 'ch', 'XX') ==> "teXXTFQ"


SELECT REPLACE('techTFQ', 't', 'z') ==> "zechTFQ"
SELECT RIGHT('SENIOR SOFTWARE ENGINEER', 10) ==> "E ENGINEER"
"select SUBSTRING('techTFQ', 1) from dual; ==> ""techTFQ""
select SUBSTRING('techTFQ', 2) from dual; ==> ""echTFQ""

select SUBSTRING('techTFQ', 1, 4) from dual; ==> ""tech""


select SUBSTRING('techTFQ', 2, 4) from dual; ==> ""echT""

select SUBSTRING('techTFQ', -3) from dual; ==> ""TFQ"""

SELECT SUBSTRING_INDEX('sony sounds', 'n', 1) ==> 'so' (returns every character up to the 1st
occurrence of the delimiter "s")

SELECT SUBSTRING_INDEX('sony sounds', 'n', 2) ==> 'sony sou' (returns every character up to the
2nd occurrence of the delimiter "s")

SELECT SUBSTRING_INDEX('sony sounds', 'n', -1) ==> 'ds' (returns every character from the right
of the string up to the 1st occurrence of the character "s")

SELECT FIND_IN_SET('T','R,S,T'); ==> 3


SELECT FIND_IN_SET('T','R,S,Z,T'); ==> 4

select FORMAT('550.455', 2) ==> 550.46


select FORMAT('550.455', 3) ==> 550.455
select FORMAT('550.455', 4) ==> 550.4550
select ifnull(NULL, '2nd argument'); ==> "2nd argument"
SELECT CURDATE() ==> 2022-11-29
SELECT DATEDIFF('2020-03-22','2020-03-27'); ==> -5
SELECT DATEDIFF('2020-03-29','2020-03-27'); ==> 2
select DAY('2010-03-22') ==> 22
SELECT DATE_ADD('2022-12-31 23:59:59', INTERVAL 1 SECOND) ==> "2023-01-01 00:00:00"

SELECT DATE_ADD('2022-12-31 23:59:59', INTERVAL 1 DAY) ==> "2023-01-01 23:59:59"

SELECT DATE_SUB('2022-11-29',INTERVAL 1 DAY); ==> "2022-11-28"

SELECT DATE_SUB('2022-11-29',INTERVAL 1 MONTH); ==> "2022-10-29"

SELECT DATE_FORMAT('2022-11-29', '%d/%b/%Y') ==> "29/Nov/2022"


SELECT DATE_FORMAT('2022-11-29', '%d/%m/%y') ==> "29/11/22"

SELECT EXTRACT(DAY FROM '2022-11-01 08:20:34') ; ==> 1


SELECT EXTRACT(YEAR FROM '2022-11-01 08:20:34') ; ==> 2022
SELECT EXTRACT(HOUR FROM '2022-11-01 08:20:34') ; ==> 8

select LAST_DAY('2022-02-01') ==> "2022-02-28"


select LAST_DAY('1864-02-01') ==> "1864-02-29"
SELECT LAST_DAY(NOW()); ==> 2022-11-30
SELECT NOW(); ==> "2022-11-29 01:28:24"
select MONTH('2010-03-22') ==> 3
SELECT STR_TO_DATE('20221129','%Y%m%d'); ==> "2022-11-29"

SELECT STR_TO_DATE('103015','%h%i%s'); ==> "10:30:15"


SELECT SYSDATE(); ==> "2022-11-29 01:28:39"
select WEEK('2010-03-22') ==> 12

select WEEKDAY('2010-03-27') ==> 5


select WEEKDAY('2010-03-28') ==> 6
select WEEKDAY('2010-03-29') ==> 0
select WEEKDAY('2010-03-30') ==> 1

select YEAR('2010-03-22') ==> 2010


DESCRIPTION

Concatenate two or more strings into one

Returns the first n characters in the string

Returns the last n characters in the string

Returns number of characters in a string

Pads a string on the left to a specified length with a sequence of characters

Pads a string on the right to a specified length with a sequence of characters

Returns the location of a substring in a string

Search and replace a substring with a new substring in a string

Extracts a substring from a string

Performs several single-character, one-to-one translation in one operation

Function to remove either spaces or a given character (second argument)


which are leading and trailing in a given string (first argument).
LTRIM only removes leading characters
RTRIM only removes trailing characters

converts a timestamp, an interval, an integer, a double precision, or a


numeric value to a string

Returns the first non null value in the given arguments.


This function is used to replace NULL values with other values

calculate ages
returns the current date
returns the current time with time zone
returns the current date and time with time zone, which is the time when
the transaction starts

retrieves a field such as a year, month, and day from a date/time value

convert a string to a date


concatenates two strings and returns the combined string.
searches for a substring in a string and returns the position of the substring
in a string

extracts a substring from a string with various flexible options

returns length of given string


converts all letters in a string to uppercase
converts all letters in a string to lowercase

Pads a string on the left to a specified length with a sequence of characters

Pads a string on the right to a specified length with a sequence of characters

Function to remove either spaces or a given character (second argument)


which are leading and trailing in a given string (first argument).

LTRIM only removes leading characters


RTRIM only removes trailing characters

replaces all occurrences of a specified substring in a string with another


Performs several single-character, one-to-one translation in one operation

Replace null with non null value


Add a number of months (n) to a date and return the same day which is n of
months away.
Return the current date and time in the session time zone

Return the current date and time with time zone in the session time zone

Extract a value of a date time field e.g., YEAR, MONTH, DAY, … from a date
time value.
Gets the last day of the month of a specified date.
Return the number of months between two dates.
Get the first weekday that is later than a specified date.

Return a date rounded to a specific unit of measure.

Return the current system date and time of the operating system where the
Oracle Database resides.
Convert a DATE or an INTERVAL value to a character string in a specified
format.
Convert a date which is in the character string to a DATE value.
Return a date truncated to a specific unit of measure.
Returns the position of a substring in a string
join multiple strings into one string

Returns the first non null value in the given arguments.


This function is used to replace NULL values with other values

Used to extract a given number of characters from the left side of the given
string

"Function to remove either spaces or a given character (second argument)


which are leading and trailing in a given string (first argument).
LTRIM only removes leading characters
RTRIM only removes trailing characters"

converts all letters in a string to lowercase/uppercase

find the position of a pattern in a string

replaces all occurrences of a specified substring in a string with another


replicate a string a specified number of times
return the reverse order of a string
extract a given number of character from the right side of a given character
string

convert numeric value to character value


Concatenate rows of strings into one string with a specified separator. It
does not add the separator at the end of the result string.

function to split a string into a row of substrings based on a specified


separator.

delete a part of a string and then insert a substring into the string, beginning
at a specified position.

extract a substring from a string.

replace several single-characters, one-to-one translation in one operation.

Returns the current system date and time without the time zone part.
Returns the current system date and time of the operating system on which
the SQL Server is running.
Returns a date part of a date as a character string
Returns a date part of a date as an integer number
Returns the day of a specified date as an integer
Returns the month of a specified date as an integer
Returns the year of the date as an integer.
calculate the number of years, months, weeks, days,etc., between two
dates.

Adds a value to a date part of a date and return the new date value.

Check if a value is a valid date, time, or datetime value.


Returns 1 if valid DATE, TIME, or DATETIME otherwise returns 0.

Convert date to string and vice versa


Concatenate two or more strings into a single string

Concatenates two or more string values with a predefined separator.


Return the position of the first occurrence of a substring in a string
Get the length of a string in bytes and in characters
Get a specified number of leftmost characters from a string

Convert a string to lowercase / uppercase

"Function to remove either spaces or a given character (second argument)


which are leading and trailing in a given string (first argument).

LTRIM only removes leading characters


RTRIM only removes trailing characters"

replaces all occurrences of a specified substring in a string with another


Get a specified number of rightmost characters from a string
Extract a substring starting from a position with a specific length.

Return a substring from a string before a specified number of occurrences


of a delimiter

Find a string within a comma-separated list of strings

Format a number with a specific locale, rounded to the number of decimals


Replace null with non null value
Returns the current date.

Calculates the number of days between two DATE values.


Gets the day of the month of a specified date.

Adds a time value to date value.

Subtracts a time value from a date value.


Formats a date value based on a specified date format.
Refer reference link for all supported date format values

Extracts a part of a date & time.

Returns the last day of the month of a specified date


Returns the current date and time at which the statement executed.
Returns an integer that represents a month of a specified date.
Converts a string into a date and time value based on a specified format.
Returns the current date.
Returns a week number of a date.

Returns a weekday index for a date.


Return the year for a specified date
RDBMS FUNCTION TYPE

PostgreSQL String function


PostgreSQL Date function
Oracle String function
Oracle Date function
Microsoft SQL Server String function
Microsoft SQL Server Date function
MySQL String function
MySQL Date function
LINK

https://www.postgresqltutorial.com/postgresql-string-functions/postgresql-left/
https://www.postgresqltutorial.com/postgresql-date-functions/postgresql-age/
https://www.oracletutorial.com/oracle-string-functions/
https://www.oracletutorial.com/oracle-date-functions/
https://www.sqlservertutorial.net/sql-server-string-functions/
https://www.sqlservertutorial.net/sql-server-date-functions/
https://www.mysqltutorial.org/mysql-string-functions/
https://www.mysqltutorial.org/mysql-date-functions/
TOPIC PLATFORM

Practice SQL DataLemur


SQL Course LearnSQL.com
Practice SQL StrataScratch
Practice SQL LeetCode
Practice SQL HackerRank

Python Course CodeBasics.io

PowerBI Course CodeBasics.io


DESCRIPTION

Please not this course is free only until 30-Sep-2022


For learning SQL concepts through live practice
One of the best platform for solving real interview queries
Also one of the best platform for solving real interview queries
Practice SQL Queries and get certified

Python course

Excellent Power BI course


LINK REMARKS

https://datalemur.com/
https://learnsql.com/?ref=thoufiqmohammed Affiliate link
https://www.stratascratch.com/?via=techTFQ Affiliate link
https://leetcode.com/
https://www.hackerrank.com/

https://codebasics.io/courses/python-for-beginner-and-intermediate-learners?refId=70170e4c-7511-4c83-b769-c5
Affiliate link

https://codebasics.io/courses/power-bi-data-analysis-with-end-to-end-project?refId=4b1e1886-3252-4bf1-86f4-7d
Affiliate link

You might also like