SQL Server - Tutorials



Introduction

SQL Server is a Relational Database management system (RDBMS), its a product of Microsoft. The primary functions of the SQL Server is to store and retrieve data to be used by other applications as like normal database servers.


f5d4834276bcdc_sql_server_tutorial.png

Getting Started

This section helps you understand SQL Server very quickly.


Data Definition Language (DDL)

A data definition or data description language is similar to computer programming language used in defining data structures especially database schemas.

DDL statements create, modify and remove database objects like tables, indexes and users.

DDL statements are ALTER, CREATE & DROP


Data Manipulation Language (DML)

DML is a computer language includes commands permitting users to manipulate data in a database. This involves INSERTING, RETRIEVING and DELETING data from the existing data.

DML is highly inculcated in SQL databases.

SQL Server Functions

This server contains many types of functions which are inbuilt .They are


String Functions
DatatypeDescription
ASCIIreturns the ASCII value for a specific character
CHARreturns character based on a ASCII code
CHARINDEXreturns the position of a substring in a string
LENreturns the length of a string
STRreturns a number as a string

Numeric/math functions
DatatypeDescription
ABSreturns the absolute value of a number
AVGreturns the average value of an expression
COSreturns the cosine value of a number
DEGREESconverts the value of radians to degrees
SQRTreturns the square root of a number

Date function
DatatypeDescription
DAYreturns the day of a month for a specified date
MONTHreturns the month part for a specified date
DATEADDadds date/time interval to date and then returns to date
DATEDIFFreturns the difference between two dates

Advanced functions
DatatypeDescription
CASTconverts value of any type into a specified data type
CONVERTconverts value of any type into a specified data type
NULLIFreturns NULL if two expressions are equal
SYSTEM USERreturns the login name for current user

SQL Operators

SQL arithmetic operators

operatordescription
+addition
-subtraction
*multiplication
/division

SQL Bitwise operators

Operatordescription
&Bitwise AND
^Bitwise Exclusive OR

SQL Comparison Operators


OperatorDescription
=Equal to
>Greater than
<Less than
>=Greater than or equal to
<=Less than or equal to
<>Not equal to

SQL Compound Operators


OperatorDescription
+=Add equals
-=Subtract equals
*=Multiply equals
/=Divide equals
%=Modulo equals
&=Bitwise AND equals
^-=Bitwise exclusive equals

SQL Logical Operators


OperatorDescription
ALLTRUE if all of the subquery values meet the condition
ANDTRUE if all the conditions separated by AND is TRUE
ANYTRUE if any of the subquery values meet the condition
BETWEENTRUE if the operand is within the range of comparisons
EXISTSTRUE if the subquery returns one or more records
INTRUE if the operand is equal to one of a list of expressions
LIKETRUE if the operand matches a pattern
NOTDisplays a record if the condition(s) is NOT TRUE
ORTRUE if any of the conditions separated by OR is TRUE
SOMETRUE if any of the subquery values meet the condition


Connection String

SQL Server Connection String Formats

posted on 2019-08-27 05:53:53 - SQL Server Tutorials


UNION

union in SQL server

posted on 2019-08-09 23:05:33 - SQL Server Tutorials


System Functions

System Functions in SQL Server

posted on 2019-08-09 06:14:33 - SQL Server Tutorials


Prompt Examples

ChatGPT Prompt Examples

posted on 2023-06-21 22:37:19 - ChatGPT Tutorials


Use Cases

Chat GPT Key Use Cases

posted on 2023-06-21 21:03:17 - ChatGPT Tutorials


Prompt Frameworks

Prompt Frameworks

posted on 2023-06-21 19:33:06 - ChatGPT Tutorials