SQL Interview prep quiz 2 : Explain the difference between CTE and a subquery and give some advantages of using one over the other in OLAP vs OLTP systems

In this quiz, we are asked to give some differences between a common table expression and a subquery and what are some advantages of using one over the other in OLAP vs OLTP systems. This question is loaded so let’s break it down and explain each component. A common table expression (CTE) can be thought […]

Read More

SQL interview prep quiz 1: Write sql code to print the letters of the English alphabet in upper case without explicitly writing the letters.

Hi guys, I am starting a new series around sql interview prep which will have sql interview like questions and how to approach solving them. People have different approaches to solving problems so whatever approach l provide is just one of the ways of solving a problem and there could be other approaches that may […]

Read More

How to use analytic functions First_value and Last_value introduced in SQL Server 2012

I want to quickly go over some useful analytic functions introduced in sql server 2012 and how you can use it to accomplish some cool tasks in your data warehouse. Lets take a scenario where you have many employees who makes sales to various customers over the years. You are interested in generating report which […]

Read More