SQL 튜토리얼

SQL 홈 SQL 소개 SQL 구문 SQL 선택 SQL 선택 고유 SQL 어디에 SQL 및, 또는, 아님 SQL 순서 SQL 삽입 SQL Null 값 SQL 업데이트 SQL 삭제 SQL 상위 선택 SQL 최소 및 최대 SQL 개수, 평균, 합계 SQL 좋아요 SQL 와일드카드 SQL 입력 SQL 사이 SQL 별칭 SQL 조인 SQL 내부 조인 SQL 왼쪽 조인 SQL 권한 조인 SQL 전체 조인 SQL 자체 조인 SQL 유니온 SQL 그룹화 기준 SQL SQL 존재 모든 SQL SQL 선택 대상 선택에 SQL 삽입 SQL 케이스 SQL 널 함수 SQL 저장 프로시저 SQL 주석 SQL 연산자

SQL 데이터베이스

SQL DB 생성 SQL 삭제 DB SQL 백업 DB SQL 테이블 생성 SQL 삭제 테이블 SQL 변경 테이블 SQL 제약 조건 SQL이 널이 아님 SQL 고유 SQL 기본 키 SQL 외래 키 SQL 확인 SQL 기본값 SQL 인덱스 SQL 자동 증분 SQL 날짜 SQL 보기 SQL 주입 SQL 호스팅 SQL 데이터 유형

SQL 참조

SQL 키워드 MySQL 함수 SQL 서버 기능 MS 액세스 기능 SQL 빠른 참조

SQL 예제

SQL 예제 SQL 퀴즈 SQL 연습 SQL 인증서

SQL 서버 기능


SQL Server에는 많은 기본 제공 기능이 있습니다.

이 참조에는 SQL Server의 문자열, 숫자, 날짜, 변환 및 일부 고급 기능이 포함되어 있습니다.


SQL Server 문자열 함수

Function Description
ASCII Returns the ASCII value for the specific character
CHAR Returns the character based on the ASCII code
CHARINDEX Returns the position of a substring in a string
CONCAT Adds two or more strings together
Concat with + Adds two or more strings together
CONCAT_WS Adds two or more strings together with a separator
DATALENGTH Returns the number of bytes used to represent an expression
DIFFERENCE Compares two SOUNDEX values, and returns an integer value
FORMAT Formats a value with the specified format
LEFT Extracts a number of characters from a string (starting from left)
LEN Returns the length of a string
LOWER Converts a string to lower-case
LTRIM Removes leading spaces from a string
NCHAR Returns the Unicode character based on the number code
PATINDEX Returns the position of a pattern in a string
QUOTENAME Returns a Unicode string with delimiters added to make the string a valid SQL Server delimited identifier
REPLACE Replaces all occurrences of a substring within a string, with a new substring
REPLICATE Repeats a string a specified number of times
REVERSE Reverses a string and returns the result
RIGHT Extracts a number of characters from a string (starting from right)
RTRIM Removes trailing spaces from a string
SOUNDEX Returns a four-character code to evaluate the similarity of two strings
SPACE Returns a string of the specified number of space characters
STR Returns a number as string
STUFF Deletes a part of a string and then inserts another part into the string, starting at a specified position
SUBSTRING Extracts some characters from a string
TRANSLATE Returns the string from the first argument after the characters specified in the second argument are translated into the characters specified in the third argument.
TRIM Removes leading and trailing spaces (or other specified characters) from a string
UNICODE Returns the Unicode value for the first character of the input expression
UPPER Converts a string to upper-case


SQL Server 수학/숫자 함수

Function Description
ABS Returns the absolute value of a number
ACOS Returns the arc cosine of a number
ASIN Returns the arc sine of a number
ATAN Returns the arc tangent of a number
ATN2 Returns the arc tangent of two numbers
AVG Returns the average value of an expression
CEILING Returns the smallest integer value that is >= a number
COUNT Returns the number of records returned by a select query
COS Returns the cosine of a number
COT Returns the cotangent of a number
DEGREES Converts a value in radians to degrees
EXP Returns e raised to the power of a specified number
FLOOR Returns the largest integer value that is <= to a number
LOG Returns the natural logarithm of a number, or the logarithm of a number to a specified base
LOG10 Returns the natural logarithm of a number to base 10
MAX Returns the maximum value in a set of values
MIN Returns the minimum value in a set of values
PI Returns the value of PI
POWER Returns the value of a number raised to the power of another number
RADIANS Converts a degree value into radians
RAND Returns a random number
ROUND Rounds a number to a specified number of decimal places
SIGN Returns the sign of a number
SIN Returns the sine of a number
SQRT Returns the square root of a number
SQUARE Returns the square of a number
SUM Calculates the sum of a set of values
TAN Returns the tangent of a number

SQL Server 날짜 함수

Function Description
CURRENT_TIMESTAMP Returns the current date and time
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)
DATENAME Returns a specified part of a date (as string)
DATEPART Returns a specified part of a date (as integer)
DAY Returns the day of the month for a specified date
GETDATE Returns the current database system date and time
GETUTCDATE Returns the current database system UTC date and time
ISDATE Checks an expression and returns 1 if it is a valid date, otherwise 0
MONTH Returns the month part for a specified date (a number from 1 to 12)
SYSDATETIME Returns the date and time of the SQL Server
YEAR Returns the year part for a specified date

SQL Server 고급 기능

Function Description
CAST Converts a value (of any type) into a specified datatype
COALESCE Returns the first non-null value in a list
CONVERT Converts a value (of any type) into a specified datatype
CURRENT_USER Returns the name of the current user in the SQL Server database
IIF Returns a value if a condition is TRUE, or another value if a condition is FALSE
ISNULL Return a specified value if the expression is NULL, otherwise return the expression
ISNUMERIC Tests whether an expression is numeric
NULLIF Returns NULL if two expressions are equal
SESSION_USER Returns the name of the current user in the SQL Server database
SESSIONPROPERTY Returns the session settings for a specified option
SYSTEM_USER Returns the login name for the current user
USER_NAME Returns the database user name based on the specified id