Drop Temp Table in SQL Server and PostgreSQL
This article explains different ways to drop the temp table in SQL Server and PostgreSQL. As the...
Guide for CTE in SQL Server
The Common Table Expression aka CTE in SQL Server provides a temporary result set in T-SQL. You can refer to it within a SQL Select, SQL...
How to SHOW or LIST Tables in MySQL
There are two primary methods to view the tables in MySQL: In this article, we are going to explore them both....
Stored Procedure to Delete Duplicate Records in SQL Table
Sometimes during our run as DBAs, we come up across at least one table that is loaded with...
How to Create a Table with Multiple Foreign Keys and Not Get Confused
Understanding Table Relations SQL server adds foreign keys to implement relations between tables in a relational database. A table can have...
The Cartesian Product in SQL
Cartesian product in SQL is a term from the set theory of mathematics. However, we can also find this term in SQL database manuals. What...
SQL DEFAULT Constraint to Insert Column with a Default Value to SQL Server Table
To insert data into a table having columns with default constraints, we can use the DEFAULT...
3 Methods to Rebuild All Indexes for All Tables with T-SQL in SQL Server Database
There are several methods of how to rebuild all indexes of all tables in SQL Server, among them: Using SQL Server maintenance plans. Using...
4 Ways to Count Rows in SQL Server Table with Pros and Cons
Recently, I was working on a database performance improvement project. One stored procedure there was causing issues. In its code, a query...
Understanding DROP TABLE Statement in SQL Server
The SQL Server DROP TABLE statement serves to drop the table from the database. This article will...