This article provides an overview of the RIGHT JOIN in SQL, as well as some basic examples.
what is
SQL Alias Explained
The SQL alias is a nice little feature of SQL that allows you to write more concise code and create column names when no column name exists.
There are two SQL alias types; column aliases, and table aliases. In this article, I provide an overview of both.
SQL Server ROWCOUNT_BIG()
In SQL Server, you can use the ROWCOUNT_BIG() system function to return the number of rows affected by the last T-SQL statement.
It works exactly the same as @@ROWCOUNT, except that ROWCOUNT_BIG() returns its result as a bigint.
SQL Server SHOWPLAN_ALL
In SQL Server, you can use the SET SHOWPLAN_ALL statement to return the query plan for a given T-SQL statement. The query plan displays detailed information about how the statement is executed, as well as estimates of the resource requirements for the statements.
SQL Server SHOWPLAN_TEXT
In SQL Server, you can use the SET SHOWPLAN_TEXT statement to return the query plan for a T-SQL statement. This contains detailed information about how the statement is executed.
SQL Server CASE Expression
In SQL Server, the T-SQL CASE expression is a scalar expression that returns a value based on conditional logic. It evaluates a list of conditions and returns a value, based on the outcome of those conditions..
In some ways, the SQL Server CASE expression is similar to IF...ELSE. However, CASE allows you to check for multiple conditions, whereas IF...ELSE doesn’t.
What is STATISTICS TIME in SQL Server?
In SQL Server, you can use the SET STATISTICS TIME statement to display the time it takes to execute a T-SQL statement.
More specifically, it returns the number of milliseconds required to parse, compile, and execute each statement.
When SET STATISTICS TIME is ON, the time statistics for a statement are displayed. When OFF, the time statistics are not displayed.
The setting of SET STATISTICS TIME is set at execute or run time and not at parse time.
What is STATISTICS PROFILE in SQL Server?
In SQL Server, you can use the SET STATISTICS PROFILE statement to display the profile information for a T-SQL statement.
STATISTICS PROFILE works for ad hoc queries, views, and stored procedures.
When STATISTICS PROFILE is set to ON, each executed query returns its regular result set, followed by an additional result set that shows a profile of the query execution.
What is STATISTICS IO in SQL Server?
In SQL Server, you can use the SET STATISTICS IO statement to generate detailed information about the amount of disk activity generated by a T-SQL statement.
In graphical tools like SSMS and Azure Data Studio, you can view this information in the Messages tab.
How to Use the BETWEEN Operator in SQL Server
The SQL Server BETWEEN operator allows you to test between a range of values in your queries. For example, you could test that a value is between two numbers.
The BETWEEN operator is inclusive, meaning that it includes the values that you specify within the range. That is, it includes values that are greater than or equal to the lower value, and values that are less than or equal to the higher value. Therefore it’s like using >= and <=.