Geek Logbook

Tech sea log book

Extracting Year, Month, and Day from Dates in Azure Data Factory

In Azure Data Factory (ADF), working with dates is a common task, especially when dealing with data transformations and scheduling tasks. ADF allows you to handle dates in different formats, such as timestamps and strings. This blog post will guide you on how to extract the year, month, and day from two types of dates:

Understanding Window Functions in SQL: A Deep Dive

Introduction When working with databases, you’ll often need to perform calculations across a set of rows related to the current row in your query. Whether you’re calculating a running total, ranking rows, or performing other complex aggregations, window functions in SQL provide a powerful way to achieve these tasks without resorting to more complicated subqueries

Extracting the Header from a CSV File in Python

When working with CSV files in Python, it’s often necessary to extract the header (the first row of the file) to understand the structure of the data or to perform specific operations on the remaining rows. In this post, we’ll explore how to extract the header using Python’s csv module. Using csv.reader to Extract the

How to Check if Two Tables Have the Same Columns in SQL

When working with databases, it’s sometimes necessary to compare two tables to ensure they have the same structure. Specifically, you might need to verify that two tables have the same columns before performing operations like data migrations or comparisons. This post will guide you through the process of checking if two tables have identical columns

Identifying Duplicate Records in SQL Based on Specific Fields

In database management, identifying and handling duplicate records is crucial to ensure data integrity. This post will guide you through a SQL query designed to find duplicates based on a specific field. For this example, we’ll work with a table containing raw data and extract relevant information to identify duplicates. Understanding the Query Let’s say

Extracting the Last Segment of a String in SQL Server

When working with data, you often need to manipulate strings to extract meaningful information. A common scenario is having strings with segments separated by underscores (_), and you only need the last segment. For example, you might have strings like: In this blog post, we’ll explore how to extract the last segment of these strings

Creating a Pandas DataFrame from a List of Lists

Working with data in Python often involves using pandas, one of the most powerful libraries for data manipulation. A common task is converting a list of lists into a pandas DataFrame. This post will guide you through the process and help you avoid common pitfalls, such as the dreaded “ValueError: shape passed value is” error.