SQL Server Composite key
SQL Server Primary key is used to uniquely identify each rows in the table but sometimes more than one column are used to uniquely identify each rows in the table.
![]()
This website provides a SQL server, SSRS, Power BI, Python, Azure basics and advanced tutorials for beginners and professionals .
You will find out a step-by-step walk through of the basics and advanced topics with practical and include numerous hands-on activities.
SQL Server Primary key is used to uniquely identify each rows in the table but sometimes more than one column are used to uniquely identify each rows in the table.
![]()
Print a prime numbers separted by comma for any given number .
For example, the prime number for 10 , wolud be 2,3,5,7 .
Here is the query:
![]()
Query to Get the Students who scored higher than 80 Marks ?
![]()
SQL server allows us to transform a row- level data into columnar data using SQL Pivot.
![]()
SQL Server Clustered index
A clustered index defines the order in which data is physically stored in a table. A table can have only one clustered index because data rows can be only sorted in one order.
![]()
How to get all the tables in database those are having primary key constraints ?
![]()
SQL Server Temporal tables (system-versioned tables) allow us to track data changes. It was introduced in SQL Server 2016.
It allows SQL Server to maintain and manage the history of the data in the table automatically, So we can get all information about the data that was stored at any specified time rather than just the data that is current.
![]()
SQL Server IF..ELSE block is a control-of-flow that allows you to execute or skip a statement block based on a specified condition.
SYNTAX
IF Boolean_expression
{ sql_statement | statement_block }
[ ELSE { sql_statement | statement_block } ]
SYNTAX
IF Boolean_expression
{ sql_statement | statement_block }
[ ELSE { sql_statement | statement_block } ]
![]()
SQL Server WHILE loop sets a condition for the repeated execution of an SQL statement or statement block.
![]()
SQL Server UNPIVOT allow us to transform columns of a table-valued expression into column values that is rotating columns into rows.
It performs a reverse operation of SQL Server PIVOT.
SYNTAX
SELECT …
FROM …
UNPIVOT (
FOR
[ … ]
![]()
SQL Server FOR JSON Clause
SQL Server FOR JSON Clause is used to format query result to JSON format or export data from SQL Server as JSON format. It was introduced in SQL Server 2016 version.
![]()
What is the difference between SQL Server Stored Procedures and User Defined Functions (UDF)?
Following are the some major difference between Stored procedures and User Defined functions
Return a value
Stored procedure may or may not return a value while UDF function must return a value.
![]()
How to get dark theme for SQL Server Management studio?
By default it is hidden in SQL Server management studio, you can quickly check by following below steps.
![]()
NCHAR data type is used to store Unicode string data of fixed-length.
NCHAR data type is used to store Unicode string data of fixed-length.
It stores data at 2 byte per character.
It supports up to 4000 characters.
![]()
SQL Server NVARCHAR is used to store uniqcode string data of variable length, it can store both unicode and non unicode strings.
![]()
SQL Server VARCHAR Data Type is used to store non-unicode string data of varaible length.
![]()