Introduction
[Opening paragraph. Describe the problem or topic and why it matters. Use inline code for object names such as dbo.Orders or pandas.DataFrame.]
[Section One Heading]
[Section text. Replace this with your content.]
SQL Code Block
[Introduce the example before showing it.]
-- Rank customers by revenue within each region
WITH RegionSales AS (
SELECT
c.Region,
c.CustomerName,
SUM(o.TotalAmount) AS Revenue
FROM dbo.Orders AS o
INNER JOIN dbo.Customers AS c
ON c.CustomerID = o.CustomerID
WHERE o.OrderDate >= '2026-01-01'
GROUP BY c.Region, c.CustomerName
)
SELECT
Region,
CustomerName,
Revenue,
RANK() OVER (PARTITION BY Region ORDER BY Revenue DESC) AS RegionRank
FROM RegionSales
ORDER BY Region, RegionRank;
Python Code Block
[Introduce the example before showing it.]
import pandas as pd
import pyodbc
@retry(attempts=3)
def load_orders(conn_str: str, since: str) -> pd.DataFrame:
# Pull recent orders from SQL Server into a DataFrame
query = "SELECT OrderID, CustomerID, TotalAmount FROM dbo.Orders WHERE OrderDate >= ?"
with pyodbc.connect(conn_str) as conn:
return pd.read_sql(query, conn, params=[since])
df = load_orders(CONN_STR, "2026-01-01")
print(df.describe())
Other Content Components
[Use these elements as needed and delete the rest.]
[Highlight a tip, warning, or important detail here.]
[A pull quote or key takeaway.]
- [Numbered step one]
- [Numbered step two]
- [Numbered step three]
| [Column] | [Column] | [Column] |
|---|---|---|
| [Value] | [Value] | [Value] |
| [Value] | [Value] | [Value] |
Conclusion
[Wrap up the article with key takeaways and next steps. Request a consultation if you need help with a similar project.]