T-SQL

Arindam Mondal
SQL IN with Subquery

Understanding the SQL IN operator with examples

March 19, 2024 by

Today we will learn about the SQL IN operator. The RDBMS systems are very popular today in terms of data storage, data security, and data analysis. SQL stands for Structured Query Language which is used to create, update, or retrieve data in RDBMS or Relational Database Management Systems like SQL Server, Oracle, Microsoft Access, MySQL, and PostgreSQL.

Read more »
Manvendra Singh
Run SQL SELECT UNIQUE statement

Difference between SQL SELECT UNIQUE and SELECT DISTINCT

January 16, 2024 by

Today, we will learn the difference between SQL SELECT UNIQUE and SELECT DISTINCT in this article. As we all know that SQL is a query language that is used to access, create, delete, and modify data stored in a database system like SQL Server, Oracle, MySQL, etc. All these database systems have their query language like TSQL, PLSQL, etc. These query languages are based on ANSI standard SQL language which can also be used in these database systems to perform any transaction.

Read more »
Manvendra Singh
use case with ORDER BY clause

How to do a group by clause

April 12, 2023 by

Today, I am going to explain how to do a group by clause in your SQL queries. SQL (Structured Query Language) is a very popular query language that is widely used to access and manipulate records stored in a database. The GROUP BY clause is also a SQL statement that is used to group identical values. Let’s first understand this clause what it does and why we use this clause in SQL queries.

Read more »
Manvendra Singh
Use case of OFFSET clause

Getting started with SQL LIMIT clause

January 13, 2023 by

Today, I am going to explain how to use the SQL LIMIT clause to limit output values. We all know RDBMS systems are one of the popular ways to store, protect, access, and analyze data in a structured way. We can store enormous sizes of data and then further can access them with the help of SQL language to get our desired output to analyze it. SQL stands for Structured Query Language which is used to perform activities like creating, modifying, and accessing data from the databases hosted on RDBMS systems like SQL Server or MySQL, etc. This article will explain one of the SQL query statements LIMIT which we use to limit the number of records returned in the output result.

Read more »
Esat Erkec
We need to use IS NULL or IS NOT NULL syntax when we compare the NULL values in a table

5 Best Practices for writing SQL queries

December 30, 2022 by

In this article, we are going to learn some best practices that help to write more efficient SQL queries.

Introduction

Queries are used to communicate with the databases and perform the database operations. Such as, we use the queries to update data on a database or retrieve data from the database. Because of these functions of queries, they are used extensively by people who also interact with databases. In addition to performing accurate database operations, a query also needs to be performance, fast and readable. At least knowing some practices when we write a query will help fulfill these criteria and improve the writing of more efficient queries.

Read more »
Manvendra Singh
Difference between SQL and MySQL

Understanding the difference between SQL and MySQL

December 26, 2022 by

This article will explain the difference between SQL and MySQL. Many people get confused between several database terms like SQL, MySQL, SQL Server, or other SQL-related phrases. If you are a database professional, then you should be aware of the difference between SQL and MySQL or other phrases which have SQL words included like PostgreSQL, Cloud SQL, TSQL, etc. Most of these terms are divided between a query language and database software like TSQL and SQL are query languages whereas MySQL, SQL Server, and PostgreSQL are database software.

Read more »
Manvendra Singh
Use SUM with other system functions and GROUP BY statement

Understanding the SQL SUM() function and its use cases

December 13, 2022 by

Today, I will describe the SQL SUM () function along with its use cases in this article. There are various mathematical calculations we need to do in day-to-day business requirements. SQL Server offers various system functions which I have listed below to get these mathematical calculations easily by using them. One such requirement is to get the sum of values stored in a numeric column. We can use SQL Server system function SUM () to easily get the sum of the values stored in a numeric column of the table.

Read more »
Daniel Calbimonte
Get age in SQL Server based on bithdate

SQL Subtract dates

November 7, 2022 by

In this article, we will show how to subtract dates using SQL Server. This article will be a learn-by-example article with a problem and a solution. But first, I will add some theory to understand the syntax of the DATEDIFF function which is the base of this article.

Read more »
Esat Erkec
Implicit conversion warning in an execution plan

7 Common T-SQL Query mistakes

June 1, 2022 by

SQL (Structured Query Language) is an ANSI/ISO standard programming language that is designed to program relational databases and T-SQL (Transact-SQL) is an extended implementation of the SQL for Microsoft SQL Server databases. T-SQL is highly used by database persons when they want to program or manage the SQL Server databases. However, the beginners may do some mistakes without realizing when they write queries with SQL. In the next section of this article, we will glance at the common mistakes that may be made by newbies.

Read more »
Frank Solomon
The solution result set.

Lever the TSQL MAX/MIN/IIF functions for Pinpoint Row Pivots

May 16, 2022 by

Introduction

For a recent Tsql development project involving text document records, the customer wanted a product that would show the latest and most recent earlier version of specific document text stored in a SQL Server 2014 database. One result set row had to hold all relevant information for each document: both document versions as described above, and relevant metadata. This essentially required fine-grained row pivots. This article will describe the engineering behind the solution, and compare that solution with the SQL Server PIVOT operator.

Read more »