Posts

CASE Statement in SQL Server

Image
                                                                 CASE Statement in SQL Server The CASE Statement fundamentals The CASE statement is SQL's way of handling if/then logic.  What is CASE in SQL? SQL CASE statement evaluates a condition and returns a result that meets that condition. If none of the conditions is evaluated to TRUE it returns a value from the ELSE block. In simple words, the CASE expression is the way to build the IF - THEN logic into SQL. Why is CASE so important in SQL? If you’re analyzing or manipulating data, you’ll often want to define rules based on certain conditions therefore CASE helps us to retrive data based on our requirement. A quick review of CASE rules: CASE must be followed by at least one WHEN... THEN expression Every CASE statement must end with t...

SQL Query Order of Execution

Image
                                                  SQL Query Order of Execution SQL SQL - ( Structured Query Language ) is the most wanted tool for everyone who is living in IT Industry ,it like breathing air and water -this both can be like EXCEL & SQL without this 2 we can't do any projects. Lets learn about Order of Execution in SQL Why the order of SQL is Important ? Each and every task there will be an ORDER to reach like If we want to land in GOOD IT JOB with the proper role as Business Analyst or Data Analyst  should be good to have an education criteria with IT KINGS- EXCEL , SQL , POWERBI / TABLEAU / MICRO STRATEGY / STATISTICS / STORY TELLING (communication). As like this same way there will be an ORDER in SQL queries SQL Query Order of Execution Why Order of Execution is Important ? Helps to understand the concept easily Can able to debug query...

SQL Aggregate Functions

Image
                                                                             SQL Aggregate Functions What is SQL Aggregation? SQL aggregation is a set of values to return a single value. Aggregate function is available in Excel, SQL, Power BI-Dax. It's done with the help of aggregate functions, such as SUM, COUNT, and AVG.  Let's look about SQL Aggregate functions today. For example, in a database of products, we might want to calculate the average price of the whole inventory. How is it used? Aggregation in SQL is, typically, used in conjunction with grouping.  The Group By clause is used to arrange rows into groups in SQL.  Aggregation, together with grouping, is key to generating quick reports and insights from a database. Commonly Used SQL Ag...

T-SQL Server-GROUP BY Clause

Image
                                                              T-SQL Server-GROUP BY Clause What is GROUP BY ? In SQL Group BY is a function used to query results from the groups of rows with the help of Aggregate functions. It helps to generate quick reports and insights from data base. Aggregate functions: * Count * Min * Max * Sum * Avg Ex: Assuming we have different category vegetables in basket. Tomato, Potato, Brinjal all mixed in same bucket. with the help of GROUP BY and AGGREGATE functions we will retrive data from database to analyze how many vegetables and varieties in basket.

Danny's Dinner

Image
                                                                                       Danny's Dinner SQL Challenge - 1 Data set link : https://8weeksqlchallenge.com/getting-started/ 3 key datasets for this case study: Entity Relationship Diagram Case Study Questions Each of the following case study questions can be answered using a single SQL statement: create database Dannys_Dinner CREATE TABLE sales (   "customer_id" VARCHAR(1),   "order_date" DATE,   "product_id" INTEGER ); INSERT INTO sales   ("customer_id", "order_date", "product_id") VALUES   ('A', '2021-01-01', '1'),   ('A', '2021-01-01', '2'),   ('A', '2021-01-07', '2'),   ('A', '2021-01-10', '3'),   ('A', '2021-01-11', '3'), ...

DAX

  ๐Ÿ‘ฉ‍๐Ÿซ If you are looking Power BI related documents then this post is for you. ๐ŸŽˆ In this 2024 DATA ANALYTICS is highly Boomed but don't think you can become a DATA ANALYST with in 2hrs or 2 days. So just deep dive into 1 DAX formula per day and do practice then you will be familiar end of 1 month. ๐ŸŽˆData Analysis Expressions (DAX) ๐ŸŽˆData Analysis Expressions (DAX) is a powerful formula language that is at the core of Microsoft Power BI and other Microsoft products like Excel and SQL Server Analysis Services. ๐ŸŽˆDAX is designed for creating custom calculations, aggregations, and data transformations within these tools. ๐ŸŽˆThis chapter introduces you to the fundamental concepts of DAX and lays the foundation for your journey into mastering its essentials. ๐ŸŽˆIt means that it is a type of formula or expressions that are used for the analysis and calculations of data. ๐ŸŽˆYou need to understand its basic syntax. ๐ŸŽˆDAX formulas are written in a similar way to Excel formulas, using functio...