Operatori
Aritmetici -/*%
Relationali < > <= >= = <>
Logici AND, OR,NOT
BETWEEN BETWEEN X AND Y
IN IN Expr
LIKE LIKE condition
Functii SQL Server pentru siruri
CONCAT(str1, str2, …, str n) Adds two or more strings together
CONCAT with “+” Adds two or more strings together
LEFT(column, number) Extracts a number of characters from a string (starting from left)
LOWER(str) Converts a string to lower-case
LTRIM(str) Removes leading (left) spaces from a string
REPLACE(str, old_str, new_str) Replaces all occurrences of a substring within a string, with a new substring
REPLICATE(str, number) Repeats a string a specified number of times
REVERSE(str) Reverses a string and returns the result
RIGHT(str, number) Extracts a number of characters from a string (starting from right)
RTRIM(str) Removes trailing (right) spaces from a string
SPACE(number) Returns a string of the specified number of space characters
STR(number) Returns a number as string
SUBSTRING(str, p_start, p_end) Extracts some characters from a string
TRIM(str) Removes leading and trailing spaces from a string
UPPER(str) Converts a string to upper-case
Functii Matematice
ABS(number) Returns the absolute value of a number
FLOOR(number) Returns the largest integer value that is <= to a number
CEILING(number) Returns the largest integer value that is >= to a number
POWER(number1, number2) Number 1 at the power of Number 2
RAND() Returns a random number
ROUND(number, operation(number)) Rounds a number to a specified number of decimal places
SQRT(number) Returns the square root of a number
Functii SQL pentru date calendaristice DATETIME
DATEADD Adds a time/date interval to a date and then returns the date
DATEDIFF Returns the difference between two dates
DATEFROMPARTS Returns a date from the specified parts (year, month, and day values)
DAY Returns a specified part of a date (as integer)
GETDATE Returns the current database system date and time
MONTH Returnează luna din data calendaristică (număr între 1 și 12)
YEAR Returnează anul din data calendaristică (număr)
HOUR Returnează ora (număr)