Yesterday, it was my rest day. Hence, I didn’t write anything.

If you connect your database with any BI software or even with Excel spreadsheets, you might know how to select some accurate information. Otherwise, you will have tons of rows and columns, and it will take more than a couple of minutes to manage the data.

So, one of the most various ways to filter the information is to use SQL queries, like this one I used yesterday:

SELECT SOD.ProductID, PP.Name, SOD.OrderQty, SOH.DueDate FROM Sales.SalesOrderHeader SOH INNER JOIN Sales.SalesOrderDetail SOD ON SOH.SalesOrderID = SOD.SalesOrderID INNER JOIN Production.Product PP ON PP.ProductID = SOD.ProductID WHERE SOH.DueDate between ‘2005-01-01’ AND ‘2006-01-01’ GROUP BY SOD.ProductID, PP.Name, SOD.OrderQty, SOH.DueDate HAVING SOD.OrderQty >= 2

You just need to click on Data tab in Excel, create a New Query > From Database > SQL Server Database.

Enter the Server and Database name. You can also write an SQL statement before importing the data; then loading process takes less time than usual.

After that, you can create a chart, like this one above:

The best seller product is the first one on the left side, and it is descending order on the right side. The period I already set in the query: the entire year of 2005.

It is extremely simple. I am ashamed to show this because it is a horrible chart, but it is just for a demonstration. I also installed the “Swirl” package in R-Studio and learned just one module about Regression analysis. However, it was very light. I need to study using another source, like books. (I’ve already found loads of them.)

That’s all, friends. See ya.