Posts

Showing posts from November 30, 2024

SQL Queries Code Interviews QA 50 plus

Image
Here are SQL-focused interview questions with only the relevant SQL code: 1. Find the second highest salary from an Employee table. SELECT MAX(Salary) AS SecondHighestSalary FROM Employees WHERE Salary < (SELECT MAX(Salary) FROM Employees); Using ROW_NUMBER(): WITH RankedSalaries AS (   SELECT Salary, ROW_NUMBER() OVER (ORDER BY Salary DESC) AS Rank   FROM Employees ) SELECT Salary AS SecondHighestSalary FROM RankedSalaries WHERE Rank = 2; --- 2. Write a query to calculate a running total of sales. SELECT   OrderID,   OrderDate,   Amount,   SUM(Amount) OVER (ORDER BY OrderDate) AS RunningTotal FROM Orders; --- 3. Retrieve customers who placed no orders using a LEFT JOIN. SELECT c.CustomerID, c.CustomerName FROM Customers c LEFT JOIN Orders o ON c.CustomerID = o.CustomerID WHERE o.OrderID IS NULL; --- 4. Write a query to find the top 3 highest salaries. SELECT DISTINCT Salary FROM Employees ORDER BY Salary DESC LIMIT 3; Using DENSE_RANK(): WIT...

Introduction - GenAI Data Analytics using Python

Introduction to Python and Data Analytics: Details This module provides a foundation in Python programming and introduces participants to the field of data analytics. It's designed for beginners with no prior experience in Python or analytics. --- Objective Familiarize participants with Python programming basics. Introduce the core concepts of data analytics. Enable participants to explore, clean, and prepare datasets. --- Content Outline 1. What is Data Analytics? What is Data Analytics? Data analytics is the process of examining raw data to identify trends, patterns, and insights to aid in decision-making. It involves using statistical techniques, tools, and software to transform data into actionable knowledge. --- Key Components of Data Analytics 1. Data Collection Gathering data from various sources like databases, APIs, sensors, and surveys. 2. Data Cleaning Preparing and correcting the data for analysis by handling missing values, removing duplicates, and correcting inconsist...