SQL commands

Prashanth Jayaram

Stairway to SQL essentials

April 7, 2021 by

SQL Essentials stairway series helps readers understand the most common database language SQL uses for data munging and data wrangling. SQL Essentials articles is a collection of SQL standards and best practices and help you take you in step closer to learn database query.

Read more »
Emil Drkusic
the data model

Learn SQL: Dynamic SQL

March 3, 2021 by

Dynamic SQL is a programming technique you can use to build SQL statements as textual strings and execute them later. This technique could prove to be useful in some cases and therefore it’s good to know we have it as an option. In today’s article, we’ll show how to create and execute dynamic SQL statements.

Read more »
Emil Drkusic
the data model

Learn SQL: SQL Injection

November 2, 2020 by

SQL Injection is a well-known technique used to attack SQL-based applications. In this article, we’ll focus on examples showing how you could exploit database vulnerabilities using this technique, while in the next article we’ll talk about ways how you can protect your application from such attacks.

Read more »
Emil Drkusic
joining two tables using > operator

Learn SQL: Non-Equi Joins in SQL Server

September 29, 2020 by

Non-Equi join in SQL Server sounds like something abstract (and fancy), but it’s not so abstract (and fancy) at all. The same stands for equi joins. After reading this article, I hope you’ll agree on that with me. Today’ I’ll try to explain what they are and when you should use them. So, let’s start.

Read more »
Nisarg Upadhyay
New Job Schedule that executes a SP to populate the unused tables of SQL Database

Identify unused tables of SQL databases

September 24, 2020 by

In this article, I am going to demonstrate how we can identify the unused tables of a given SQL Database. As a database administrator, we must maintain the tables and objects of the SQL Database. In my organization, when we add a new column or change the data type of a column, we export the data of the existing table in the backup table. Often, we forgot to review and maintain those backup tables. So as a solution, we decided to create a SQL Job that populates the list of unused tables and email the list to the DBA Team for review.

Read more »
Emil Drkusic
SQL-related jobs - the data model

Learn SQL: SQL-Related Jobs

September 1, 2020 by

In today’s article, we’ll take a look at 4 common SQL-related jobs and roles and explain what kind of tasks you could expect at each of these roles and what types of queries you’ll possibly use to solve these tasks. If you’re already in any of these roles, you’re probably familiar with this, but if you’re new to the world of SQL, you could find this very useful to decide in which way you want your career to develop.

Read more »
Rajendra Gupta
Copy file using the xp_cmdhell

T-SQL scripts to copy or remove files from a directory in SQL Server 2019

August 21, 2020 by

Sometimes database professionals need to perform specific tasks at the operating system level. These tasks can be like copying, moving, deleting files and folders. A use case of these tasks might be removing the old backup files or copying backup files to a specific directory after a particular time. In SQL Server, we can use xp_cmdshell extended stored procedure to execute commands directly in the Windows command prompt(CMD). You need a sysadmin role or proxy account configured to use this extended procedure. We can also use the SSIS package for the file transfer, but it also requires you to build a package with the relevant tasks.

Read more »
Nisarg Upadhyay
create and drop temp table: create a new temp table using select query.

Learn MySQL: Create and drop temp tables

August 18, 2020 by

In this article, we are going to learn how to create a temp table and further drop these tables. The temporary tables are session-specific tables that are created within the session. When the session closes, the table is dropped by itself. A temporary table exists within a session only; therefore, a table created by one session is not visible to another session. For example, Session ID 501 has created a temporary table then session ID 502 cannot access it or manipulate it. Two different sessions can have a temporary table with the same name.

Read more »
Aveek Das
Binary Search Tree Example

Diving deep with complex Data Structures

July 29, 2020 by

In my previous article, Understanding common Data Structures, I have mentioned the most commonly used data structures in software programming. In this article, let us get into some more details about the other data structures that are a bit complex than the ones already discussed but also used quite often while designing software applications. Here, we will look into the following data structures.

Read more »
Emil Drkusic
Naming convention - the data model

Learn SQL: Naming Conventions

July 28, 2020 by

A naming convention is a set of unwritten rules you should use if you want to increase the readability of the whole data model. Today, I’ll try to explain how you should formulate your naming convention and, maybe even more important, why should you do it and what is the overall benefit from using it.

Read more »
Aveek Das

Understanding the SQL MERGE statement

July 27, 2020 by

In this article, I am going to give a detailed explanation of how to use the SQL MERGE statement in SQL Server. The MERGE statement in SQL is a very popular clause that can handle inserts, updates, and deletes all in a single transaction without having to write separate logic for each of these. You can specify conditions on which you expect the MERGE statement to insert, update, or delete, etc.

Read more »