Top 5
SQL Tips and
Timesavers
2023
Our most popular SQL Tips and timesavers this year from our Business Analytics
Blog
Our most popular SQL Tip
How to calculate running totals in SQL server
Why you would use them, with a breakdown of the syntax
The article gives a step-by-step example of how to create a
running total of daily sales
Running totals are an invaluable tool helping to explain trends,
performance and other changes over time
SQL Tip number 2
How to use the LEAD and LAG functions in SQL
These functions are window functions that allow
users to compare and analyse data points between
rows in a specified window.
By using these functions, users can identify trends,
correlations, and outliers in their data sets more easily
than ever before
SQL Tip number 3
How to use the ROLLUP extension of the GROUP
BY clause in SQL Server
To generate subtotals and grand totals for multiple
dimensions within a dataset.
The post provides a simple example to illustrate the
steps for using the ROLLUP function in SQL.
Assuming you have a table of daily sales records, you
can use the ROLLUP function to insert sub-total rows
for each year, quarter, and month name
SQL Tip number 4
How to avoid the common error of dividing by zero
in SQL.
We provide a simple logic to make sure the division by
zero errors do not get in the way of analysis.
The post explains that dividing by zero makes no
sense logically, as the result cannot be determined
The post provides a range of solutions to avoid these
issues with simple logic.
Not just SQL, but Excel, Power Query, Power BI (DAX)
and Google BigQuery
SQL Tip number 5
A step-by-step guide on how to split a column in SQL
Server.
The guide shows how to split one column into
multiple columns in SQL Server.
This can be a very common problem, but with a few
commands, it is easily achieved.
E.g. separating First name and surname from a full
name field
These have been our most popular SQL tips this year
Hope you find these useful
There are many more on our blog
For more Tips, Tricks and
Timesavers, visit our website
Business Analytics Blog – Select Distinct
Credit: simon.harrison@selectdistinct.co.uk

Top 5 SQL Tips and Timesaver 2023, our most popular posts

  • 1.
    Top 5 SQL Tipsand Timesavers 2023
  • 2.
    Our most popularSQL Tips and timesavers this year from our Business Analytics Blog
  • 3.
    Our most popularSQL Tip How to calculate running totals in SQL server Why you would use them, with a breakdown of the syntax The article gives a step-by-step example of how to create a running total of daily sales Running totals are an invaluable tool helping to explain trends, performance and other changes over time
  • 4.
    SQL Tip number2 How to use the LEAD and LAG functions in SQL These functions are window functions that allow users to compare and analyse data points between rows in a specified window. By using these functions, users can identify trends, correlations, and outliers in their data sets more easily than ever before
  • 5.
    SQL Tip number3 How to use the ROLLUP extension of the GROUP BY clause in SQL Server To generate subtotals and grand totals for multiple dimensions within a dataset. The post provides a simple example to illustrate the steps for using the ROLLUP function in SQL. Assuming you have a table of daily sales records, you can use the ROLLUP function to insert sub-total rows for each year, quarter, and month name
  • 6.
    SQL Tip number4 How to avoid the common error of dividing by zero in SQL. We provide a simple logic to make sure the division by zero errors do not get in the way of analysis. The post explains that dividing by zero makes no sense logically, as the result cannot be determined The post provides a range of solutions to avoid these issues with simple logic. Not just SQL, but Excel, Power Query, Power BI (DAX) and Google BigQuery
  • 7.
    SQL Tip number5 A step-by-step guide on how to split a column in SQL Server. The guide shows how to split one column into multiple columns in SQL Server. This can be a very common problem, but with a few commands, it is easily achieved. E.g. separating First name and surname from a full name field
  • 8.
    These have beenour most popular SQL tips this year Hope you find these useful There are many more on our blog
  • 9.
    For more Tips,Tricks and Timesavers, visit our website Business Analytics Blog – Select Distinct Credit: simon.harrison@selectdistinct.co.uk