LeetCode – Combine two tables
Question Write a SQL query to report the first name, last name, city, and state of each person in the Person table. If a person’s… Read More »LeetCode – Combine two tables
![]()
Question Write a SQL query to report the first name, last name, city, and state of each person in the Person table. If a person’s… Read More »LeetCode – Combine two tables
![]()
SQL Exercise – Create a function that accepts a start date, an end date, and a day of the week (e.g., “Monday”). The function should return a table listing all dates within the specified range that match the given day of the week.
![]()
SQL Exercise: Retrieve the Top and Bottom 2 Sales Scenario: You have a SalesData table with the following columns: SalesID (unique identifier for sales records)… Read More »SQL Exercise – 19
![]()
SQL Exercise: You are given a table Numbers that contains a sequence of numbers starting from 1 to 10. But some numbers are missing. Your… Read More »SQL Exercise -18
![]()
SQL Exercise: You are given an Employee table containing details about employees, their departments, and their salaries. Your task is to write an SQL query… Read More »SQL Exercise – 17
![]()
SQL Exercise: Write an SQL query to calculate the percentage contribution to sales by each manager for a company. The data is stored in a… Read More »SQL Exercise -16
![]()
SQL Exercise: A company tracks sales data on a monthly basis and wants to calculate the percentage growth or decline in sales for each product… Read More »SQL Exercise – 15
![]()
SQL Exercise: Write a SQL query to classify invoices based on aging buckets: Due within the last 30 days: Due date is within the last… Read More »SQL Exercise -14
![]()
SQL Exercise: You are given a table of ticket data that includes the TicketID, OpenDate, and CloseDate. The task is to generate a new row… Read More »SQL Exercise – 13
![]()
SQL Exercise: You are provided with a table of employees containing their names, departments, and salaries. Write a query to determine the applicable tax rate… Read More »SQL Exercise – 12
![]()
SQL Exercise: Create a SQL function that takes a string as input and removes all special characters (keeping only alphanumeric characters and spaces). The following… Read More »SQL Exercise – 8
![]()
SQL Exercise: Given a table Sales that records sales data for various products across multiple months, write a query to dynamically pivot the data such… Read More »SQL Exercise – 11
![]()
SQL Exercise: You are provided with a table Sales that records monthly sales data for various products. Write a query to transform the data such… Read More »SQL Exercise -10
![]()
SQL Exercise: You are given two tables: Employees and Departments. Write a query to find the highest-paid employee in each department. If a department does… Read More »SQL Exercise – 7
![]()
SQL Exercise: Suppose you have a Sales table that tracks product sales data, including the sale amount, product category, and sale date. You want to… Read More »SQL Exercise – 6
![]()
SQL Exercise: You have a Sales table that tracks product sales in different cities for various dates. Now, you have to get the following information.… Read More »SQL Exercise – 5
![]()
SQL Exercise: Write Query to: Find all customers with the last name “Singh”. Retrieve customers whose email address contains the word “kumar”. Retrieve customers living… Read More »SQL Exercise – 4
![]()
SQL Exercise: Write a query to find the top 3 cities by total sales revenue, including: The total revenue for each city. The number of… Read More »SQL Exercise – 3
![]()
SQL Exercise: Write a query to find the following details for each department: The total hours worked by employees on all projects. The number of… Read More »SQL Exercise – 2
![]()