Sql Query with Where clause select ProductSubcategoryID, size, StandardCost, ListPrice, class, style from Production.Product where ProductSubcategoryID is not null and size is not null and StandardCost <> 0.00 and ListPrice <> 0.00 and class is not null and style is not null -- Complex SQL query with where, group by, having clauses and top, rank, dense_rank, row functions select Top 20 ProductSubcategoryID, Max(StandardCost) as MaximumStdCost, Max(ListPrice) as MaxListPrice, Max(ListPrice) - Max(StandardCost) as MaxDifferenceStandardFin, Max(ListPrice) / Max(StandardCost) as CostPriceRatio, Rank() over( Order by(Max(ListPrice) / Max(StandardCost)) Desc) as DistinctRankMaximumCostPriceRatio, Row_Number() over( Order by(Max(ListPrice) / Max(StandardCost)) Desc) as RankMaximumCostPriceRatio, DENSE_RANK() over( Order by(Max(ListPrice) / Max(StandardCost)) Desc) as DistinctRankwithNextSequence from Production.Pro...