When considering recursion in SQL, developers typically think of Common Table Expressions (CTEs) to solve hierarchical models. However, SQL Server also allows for recursive functions and stored procedures, a feature not in Microsoft's documentation or the literature I have encountered. This approach to recursion is less known, and rightly so, as there are usually more … Continue reading Recursion using Functions and Stored Procedures in SQL Server
Blog
Testing the Performance of Cursors in SQL Server
The conventional wisdom in T-SQL programming often advises against using cursors in SQL Server, citing performance concerns and potential issues. This advice stems from the understanding that cursors, which process data row by row, can lead to less efficient operations compared to set-based approaches. However, there are scenarios where the task at hand necessitates iterating … Continue reading Testing the Performance of Cursors in SQL Server
Utilizing the System Catalog
Hello there! I want to take a moment to share a link to my GitHub repository, where you can find a collection of my frequently used SQL Server scripts. Many of these scripts leverage the system catalog, also known as the data dictionary. In addition to the GitHub link, I'd like to provide a brief … Continue reading Utilizing the System Catalog
Unit Testing vs QA When Creating ETL pipelines using SQL
Hello, everyone. I've always found the distinction between unit testing and QA testing when creating ETP pipelines using SQL to be a somewhat gray area, so I thought I would throw this into ChatGPT and see its response. One of the more important aspects I find when performing checks is to ensure you have proper … Continue reading Unit Testing vs QA When Creating ETL pipelines using SQL
Removing Git History
Here's a step-by-step guide to removing all Git commit history while retaining the current state of your files. This will also remove all branches and tags. For these instructions, I use Visual Studio Code, but this can be done all from Git Bash. Because my GitHub is public and often traversed, I want to remove … Continue reading Removing Git History
Second Highest Salary
Welcome to exploring a classic SQL interview challenge: "How many different ways can you write an SQL statement that fetches the second-highest salary?" Apparently, I don't even know how to code this puzzle, which Anonymous kindly pointed out in the comments. So now I have to redo this blog post. One point of the puzzle is … Continue reading Second Highest Salary
Advanced SQL Quiz
Hello everyone. Step right up and take the SQL Quiz challenge! Click the above link to take the challenge; read below to review my notes and ramblings. First, I’ve written hundreds of advanced SQL quiz questions that you can use in your learning adventure. This collection is a great asset for identifying gaps in your … Continue reading Advanced SQL Quiz
MERGE Statement Example
Hello, I'm not a huge fan of the MERGE statement, as I find the syntax a little clunky. Plus, there are some drawbacks to it that I mentioned in a previous post here. A quick internet search for "SQL Merge statement problems" will yield several articles about the issues with MERGE statements. However, one benefit … Continue reading MERGE Statement Example
ChatGPT: SQL as a Religion
Hey, everyone. Thank you for checking out my blog. I can't find an option in WordPress to auto-approve comments, but please add a comment, and I will approve it. I also have a really cool GitHub here of all sorts of puzzles and database writings. I have noticed that ChatGPT is quite adept at refining my … Continue reading ChatGPT: SQL as a Religion
Attributes, Fields, and Columns
In the context of databases, the terms attribute, field, and column are often used interchangeably, especially in relational databases. However, there are slight nuances in the way they're used within different contexts. Here, I create a blog post to quickly define the differences and nuances of these terms. If you are unfamiliar with ERD, Conceptual, … Continue reading Attributes, Fields, and Columns