Statements Archives - {coding}Sight https://codingsight.com/category/database-development/statements/ Blog for SQL Server DBAs and Developers Wed, 16 Aug 2023 16:12:05 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.2 https://codingsight.com/wp-content/uploads/2021/10/cropped-Soсial_-Fb_180х180-1-32x32.png Statements Archives - {coding}Sight https://codingsight.com/category/database-development/statements/ 32 32 The SELECT INTO Temp Table Easy Guide: How to Manage Temporary Data Without Dismay        https://codingsight.com/select-into-temp-table-in-sql-server-guide/ Wed, 16 Aug 2023 16:07:54 +0000 https://codingsight.com/?p=25388 Data processing may involve several steps. And it can be fun! But the fun ends when you access some joined tables again and again. So, when you look at your SQL code, it’s yucky and ugly because of repeated lines. But what if you can store the results of those joined tables in temporary storage? …

The post The SELECT INTO Temp Table Easy Guide: How to Manage Temporary Data Without Dismay        appeared first on {coding}Sight.

]]>
SQL Server UPDATE from SELECT: How to Bulletproof Your Updates Like a Pro  https://codingsight.com/update-from-select-in-sql-server/ Wed, 14 Jun 2023 16:02:39 +0000 https://codingsight.com/?p=24842 SQL Server UPDATE from SELECT is not your usual cup of tea on T-SQL. So, it’s time to level up your UPDATE skills. But with this, you have a new foe: code complexity.  Crushing code complexity is a source of many headaches. Reading rows using a complex query is one thing. Updating rows is another. …

The post SQL Server UPDATE from SELECT: How to Bulletproof Your Updates Like a Pro  appeared first on {coding}Sight.

]]>
SQL Aggregate Functions: Easy Tips for Newbies https://codingsight.com/what-are-sql-aggregate-functions-easy-tips-for-newbies/ Wed, 28 Sep 2022 07:59:00 +0000 http://codingsight.com/?p=15123 SQL Aggregate Functions are functions that perform calculations and return a summarized result. With these, it’s easy to do these calculations on data sets: But there’s more. Statistical calculations like standard deviation and variance are also part of the tools. Mix it with grouping and sorting, and you’ll have something fantastic for your new report. So, …

The post SQL Aggregate Functions: Easy Tips for Newbies appeared first on {coding}Sight.

]]>
The Tutorial Guide to SQL Server DROP TABLE Statement https://codingsight.com/sql-drop-index-drop-table-and-drop-database-statements-explained-with-examples/ Thu, 22 Sep 2022 07:24:00 +0000 http://codingsight.com/?p=14264 The SQL DROP statement is a command that deletes existing database components or the entire databases with all their data permanently. There are other SQL commands with a similar effect (TRUNCATE or DELETE), but the specificity of the DROP command is that it deletes everything at once. For instance, DROP TABLE removes the table data, …

The post The Tutorial Guide to SQL Server DROP TABLE Statement appeared first on {coding}Sight.

]]>
Exploring SQL Server LEN() Function https://codingsight.com/exploring-sql-server-len-function/ Fri, 25 Mar 2022 17:43:40 +0000 http://codingsight.com/?p=20225 SQL Server supports different data types to store relevant data in SQL tables. These data types can be integer, float, Varchar, NVARCHAR, Float, Char, bit. While we work with the string data types, it is common to find string length. Suppose you have a web portal where users create their profiles. In the profile section, …

The post Exploring SQL Server LEN() Function appeared first on {coding}Sight.

]]>
SQL Server COUNT Function https://codingsight.com/sql-server-count-function/ Fri, 25 Mar 2022 17:25:37 +0000 http://codingsight.com/?p=19969 COUNT is one of the common SQL Server Aggregate operations done by almost all SQL Server Developers for their day-to-day needs. In this article, we can understand the COUNT Aggregate function, other possibilities of using the COUNT operation, and other functions to perform complicated Data Aggregate requirements. What Is Aggregate Function Aggregate functions perform a …

The post SQL Server COUNT Function appeared first on {coding}Sight.

]]>
SQL Cheat Sheet: What is SQL, SQL Commands, and SQL Injection https://codingsight.com/sql-cheat-sheet-what-is-sql-sql-commands-and-sql-injection/ Wed, 20 Oct 2021 08:04:10 +0000 http://codingsight.com/?p=19098 Using Structured Query Language (SQL) can seem complicated at first, but further, it will become easier and much more convenient. You only need practice. If you are looking for better ways to manage data in your database or if you are simply curious about the possibilities that SQL opens up to you, then you have …

The post SQL Cheat Sheet: What is SQL, SQL Commands, and SQL Injection appeared first on {coding}Sight.

]]>
SQL JOINs Tutorial with Examples https://codingsight.com/sql-joins-tutorial-with-examples/ Tue, 19 Oct 2021 07:18:46 +0000 http://codingsight.com/?p=19184 In this article, we are going to takes a close look at SQL Server JOINs. We will review all supported SQL Server JOIN types with syntax, visual illustrations, and examples. As we all know, table data is the core of any SQL database. To use it effectively, database administrators need to extract records from several …

The post SQL JOINs Tutorial with Examples appeared first on {coding}Sight.

]]>
Drop Temp Table in SQL Server and PostgreSQL https://codingsight.com/drop-temp-table-in-sql-server-and-postgresql/ Fri, 08 Oct 2021 09:01:28 +0000 http://codingsight.com/?p=19067 This article explains different ways to drop the temp table in SQL Server and PostgreSQL. As the name suggests, temporary tables are used to store the data temporarily. It can be used to process the data without accessing the actual table. We can create indexes, statistics, and constraints on the temp tables. Temporary Tables in …

The post Drop Temp Table in SQL Server and PostgreSQL appeared first on {coding}Sight.

]]>
How to Use SQL Server T-SQL Function SUM: 5 Use Cases https://codingsight.com/how-to-use-sql-server-t-sql-function-sum-5-use-cases/ Wed, 08 Sep 2021 07:43:58 +0000 http://codingsight.com/?p=16773 The T-SQL SUM function is one of the fundamental functions. Its purpose is to calculate the sum of all values in the specified column – note that it applies to numeric columns only. Below is the syntax of SQL SUM. ALL is a default value, not mandatory to pass. It allows for returning the sum …

The post How to Use SQL Server T-SQL Function SUM: 5 Use Cases appeared first on {coding}Sight.

]]>