What are SELECT INTO Alternatives in Snowflake?

In my other post, I have discussed about what are different methods to create Snowflake table. There are many database specific syntaxes that are not supported in Snowflake yet. One of such syntax is SELECT INTO. The databases such as SQL Server, Reshift, Teradata, etc. supports SELECT INTO clause to create new table and insert the resulting rows from the query into it. In this article, we will check what are SELECT INTO alternatives in Snowflake with some examples. SELECT INTO Alternatives in Snowflake In the databases such as SQL…

Continue ReadingWhat are SELECT INTO Alternatives in Snowflake?
Comments Off on What are SELECT INTO Alternatives in Snowflake?

What are Different Methods to Create Snowflake Tables?

In my other posts, I have discussed on how to create Snowflake clustered tables, creating external tables in Snowflake, etc. In this article, we will check what are different methods to create Snowflake tables with some basic examples. Different Methods to Create Snowflake Tables During database development, developer create a table such as permanent, temporary or transient tables as per the requirement. Developers usually create tables using DDL such as “CREATE TABLE” statement. But, sometimes you may need to use different methods such as creating a copy of an existing…

Continue ReadingWhat are Different Methods to Create Snowflake Tables?
Comments Off on What are Different Methods to Create Snowflake Tables?

How to Duplicate or Clone SQL Tables – Methods

In an application development, there may be situations where you need to create a similar table of the table which is already present in the database. In other words, you need to create a duplicate or clone of the existing table. The methods to duplicate or clone SQL table vary from database to database. For example, data warehouse such as Snowflake, Redshift provide methods which are not present in any other databases. In this article, we will check basic methods that you can use to clone or duplicate SQL tables…

Continue ReadingHow to Duplicate or Clone SQL Tables – Methods
Comments Off on How to Duplicate or Clone SQL Tables – Methods

Different Methods to Create Redshift Tables – Examples

In my other posts, I have discussed various methods to create Redshift table from Spark DataFrame, Redshift Temporary tables, creating an index on Redshift tables, etc. In this article, we will check different methods and approach to create Amazon Redshift tables. We will also check differences between various methods to create tables in Redshift. Different Methods to Create Redshift Tables During development, developer create a table either permanently or temporarily as per the requirement. Developers usually create tables using DDL such as “CREATE TABLE” statement. But, sometimes you may need…

Continue ReadingDifferent Methods to Create Redshift Tables – Examples
Comments Off on Different Methods to Create Redshift Tables – Examples

SQL GROUPING SETS Alternative in Redshift

In my other articles, we have discussed GROUP BY with CUBE and GROUP BY ROLLUP alternatives. In this article, we will check this SQL GROUPING SETS alternative in Amazon Redshift with an example. The GROUPING SETS option in SQL gives you the ability to combine multiple GROUP BY clauses into one GROUP BY clause. The GROUPING SETS is one of the powerful GROUP BY extension. The group set is a set of dimension columns. Amazon Redshift does not support GROUPING SETS. SQL GROUPING SETS Alternative in Redshift GROUP BY GROUPING…

Continue ReadingSQL GROUPING SETS Alternative in Redshift
Comments Off on SQL GROUPING SETS Alternative in Redshift

SQL GROUP BY ROLLUP Function Alternative in Redshift

In my other articles, we have discussed GROUP BY with GROUPING SETS and GROUP BY with CUBE alternatives. In this article, we will check the SQL GROUP BY ROLLUP function alternative in Amazon Redshift. The relational databases such as Oracle, Teradata, etc. support GROUP BY ROLLUP function to group the result rows. However, Amazon Redshift does not support GROUP BY ROLLUP function. SQL GROUP BY ROLLUP Alternative in Redshift Similar to GROUP BY with CUBE, the GROUP BY ROLLUP is an extension of the GROUP BY clause that produces sub-total rows. Sub-total…

Continue ReadingSQL GROUP BY ROLLUP Function Alternative in Redshift
Comments Off on SQL GROUP BY ROLLUP Function Alternative in Redshift

SQL GROUP BY with CUBE Function Alternative in Redshift

In my other articles, we have discussed GROUP BY with GROUPING SETS and GROUP BY ROLLUP alternatives. In this article, we will check the SQL GROUP BY CUBE function alternative in Amazon Redshift. The relational databases such as Oracle, Teradata, etc. support GROUP BY with CUBE function to group the result rows. However, Amazon Redshift does not support GROUP BY with CUBE function. SQL GROUP BY with CUBE Function Alternative in Redshift The GROUP functions such as ROLLUP, CUBE, GROUPING SETS are an extension of the GROUP BY clause. The CUBE allows you to generate subtotals like…

Continue ReadingSQL GROUP BY with CUBE Function Alternative in Redshift
Comments Off on SQL GROUP BY with CUBE Function Alternative in Redshift

Amazon Redshift CONCAT Function-Syntax and Examples

The data warehouse is built from many heterogeneous data sources. It is a common requirement to combine data from multiple columns or two strings before loading them to target table. For example, you may get requirement to combine state and city columns before loading data to the customer table. In this article, we will check Amazon AWS Redshift CONCAT function, its Syntax and examples. We will also check how to combine two or more columns using Redshift CONCAT operator (||). Amazon Redshift provides multiple methods to concatenate the strings The…

Continue ReadingAmazon Redshift CONCAT Function-Syntax and Examples
Comments Off on Amazon Redshift CONCAT Function-Syntax and Examples

How to Export Azure Synapse Table to Local CSV using BCP?

It is common practice to offload large table to a flat file such as CSV, TSV or fixed width files. Many application stores data in the form of flat files such as CSV. Managing flat files such as CSV is easy and it is easy to transport using any electronic medium. In this article, we will check how to export Azure Synapse table to local CSV using BCP command? In my other article, we have discussed how to export an Azure table to local CSV using SQLCMD command. Azure Synapse…

Continue ReadingHow to Export Azure Synapse Table to Local CSV using BCP?
Comments Off on How to Export Azure Synapse Table to Local CSV using BCP?

How to Load Local File to Azure Synapse using BCP?

It is common practice to offload large table to a flat file such as CSV, TSV or fixed width files. Managing flat files such as CSV is easy and it is easy to transport using any electronic medium. In this article, we will check how to load or import local flat file to Azure Synapse using the BCP command with some examples. Load Local Flat File to Azure Synapse using BCP Utility The bulk copy program utility (bcp) bulk copies data from a file in a user-specified format to an instance such as…

Continue ReadingHow to Load Local File to Azure Synapse using BCP?
Comments Off on How to Load Local File to Azure Synapse using BCP?