SQL Server BasicsWhat is SQL Server database?What is RDBMS?What is Normalization?Why we use Denormalization?What_is_SQL?What is PL/SQL?Difference between SQL and PL/SQLDatabase TableOne to One RelationshipOne to Many RelationshipMany to Many RelationshipMany to One RelationshipString Data TypesNumber Data TypesDate Data TypesOther Data TypesCreate DatabaseDrop DatabaseCreating and Managing Users in SQL ServerCreate TableAlter TableDrop TableConstraints in SQL serverPrimary KeyForeign KeyUnique KeyCandidate KeyComposite KeyDifference between primary key and candidate keyPrimary key and foreign key relationshipSurrogate KeyCascading Referential Integrity ConstraintsSelf Referential Integrity ConstraintsInsert into statementInsert multiple recordsUpdate statementDelete statementTruncate statementDifference between Delete and TruncateAlias in SQL ServerSelect statementSelect DistinctSelect TopSelect IntoNull Functions(ISNULL(),NULLIF(),COALESCE())Sub QueryIdentity ColumnSequence objectDifference between sequence and identity columnSQL Server ClausesWHERE ClauseOrder By ClauseTop N ClauseGroup By ClauseHaving ClauseDifference between Where and HavingSQL Server OperatorsArithmetic OperatorsComparison OperatorsLogical OperatorsBitwise OperatorsAny OperatorsAll OperatorsUnion OperatorsUnion All OperatorsDifference between Union and Union AllIntersect OperatorExcept OperatorDifference between Except and IntersectJoinsInner JoinLeft JoinRight JoinFull JoinSelf JoinCross JoinViewsWhat are views?Create views using SSMSIndexed ViewsComplex ViewsCheck Option in ViewCheck Encryption in ViewSchema Binding Option in ViewRead-only ViewsUpdatable ViewsAdvantages and disadvantages of viewsCreate multiple views on one tableCan we implement index on views?Can we Perform Insert, update, delete operation on views?Stored Procedure and FunctionsWhat are Stored Procedures?Why we use stored procedures?Passing parameters to Stored procedureUser-Defined FunctionsDifference between UDF and Stored procedurePre-Defined Functions@@Indentity and Scope_IndentityNULLIF, ISNULL and COALESCE

Pre-Defined Functions in SQL Server

SQL Server provides a wide range of predefined functions that can be used to perform various operations on data. These functions can be categorized into several types based on their functionality. Here are some commonly used predefined functions in SQL Server:

  1. Scalar Functions:
    • •LEN: Returns the length of a string.
    • •LOWER: Converts a string to lowercase.
    • •UPPER: Converts a string to uppercase.
    • •LTRIM: Removes leading spaces from a string.
    • •RTRIM: Removes trailing spaces from a string.
    • •SUBSTRING: Extracts a substring from a string.
    • •CONVERT: Converts a value from one data type to another.
    • •GETDATE: Returns the current system date and time.
  2. Aggregate Functions:
    • •SUM: Calculates the sum of a column.
    • •AVG: Calculates the average of a column.
    • •COUNT: Counts the number of rows in a table or a column.
    • •MAX: Returns the maximum value in a column.
    • •MIN: Returns the minimum value in a column.
    • •GROUP BY: Groups rows based on a specified column.
  3. Date and Time Functions:
    • •DATEPART: Extracts a specific part (year, month, day, etc.) from a date.
    • •DATEDIFF: Calculates the difference between two dates.
    • •DATEADD: Adds or subtracts a specific time interval to a date.
    • •GETDATE: Returns the current system date and time.
    • •SYSDATETIME: Returns the current system date and time with higher precision
  4. String Functions:
    • •CHARINDEX: Returns the starting position of a substring within a string.
    • •REPLACE: Replaces all occurrences of a specified string within another string.
    • •LEFT: Returns a specified number of characters from the left of a string.
    • •RIGHT: Returns a specified number of characters from the right of a string.
    • •STUFF: Deletes a specified length of characters from a string and then inserts another set of characters at a specified position.
  5. Conversion Functions:
    • •CAST: Converts a value from one data type to another.
    • •CONVERT: Converts a value from one data type to another.
    • •PARSE: Converts a string to a specified data type.

These are just a few examples of the predefined functions available in SQL Server. There are many more functions that provide different functionalities and can be used to manipulate and analyze data in SQL Server.