Posts

Showing posts from 2023

PayPal SQL Interview Problem (Level Hard) | Advanced SQL Problem

 |---PayPal SQL Interview Problem (Level Hard) | Advanced SQL Problem USE SSIS --DROP TABLE PayPal_emp-------------- #𝗜𝗻𝘁𝗿𝗲𝘃𝗶𝗲𝘄𝗣𝗿𝗲𝗽𝗮𝗿𝗮𝘁𝗶𝗼𝗻𝟭𝟬𝟬𝗱𝗮𝘆𝘀 𝗧𝗼𝗽𝗶𝗰-𝗦𝗤𝗟 𝗤𝘂𝗲𝘀𝘁𝗶𝗼𝗻-2 ------------🅿🅰🆈🅿🅰🅻 🅸🅽🆃🅴🆁🆅🅸🅴🆆 🆀🆄🅴🆂🆃🅸🅾🅽 -----------------------  𝙁𝙞𝙣𝙙 𝙩𝙝𝙚 𝘿𝙚𝙥𝙖𝙧𝙩𝙢𝙚𝙣𝙩 𝙬𝙝𝙤𝙨𝙚 𝙨𝙖𝙡𝙖𝙧𝙞𝙚𝙨 𝙖𝙧𝙚 𝙡𝙚𝙨𝙨 𝙩𝙝𝙖𝙣 𝙘𝙤𝙢𝙥𝙖𝙣𝙞𝙚𝙨 𝙨𝙖𝙡𝙖𝙧𝙞𝙚𝙨 𝙗𝙪𝙩 𝙩𝙝𝙚 𝙙𝙪𝙧𝙞𝙣𝙜 𝙩𝙝𝙚 𝙘𝙤𝙢𝙥𝙖𝙧𝙞𝙣𝙜 𝙩𝙝𝙚 𝙃𝙍 𝘿𝙚𝙥𝙖𝙧𝙩𝙢𝙚𝙣𝙩'𝙨 𝘼𝙫𝙚𝙧𝙖𝙜𝙚 𝙨𝙖𝙡𝙖𝙧𝙮 𝙬𝙞𝙩𝙝  𝘾𝙤𝙢𝙥𝙖𝙣𝙮'𝙨 𝙖𝙫𝙚𝙧𝙖𝙜𝙚 𝙨𝙖𝙡𝙖𝙧𝙮 (𝙃𝙍 𝘿𝙚𝙥𝙖𝙧𝙩𝙢𝙚𝙣𝙩 𝙩𝙤 𝙗𝙚 𝙚𝙭𝙘𝙡𝙪𝙙𝙚𝙙 𝙙𝙪𝙧𝙞𝙣𝙜 𝙩𝙝𝙚 𝙘𝙖𝙡𝙘𝙪𝙡𝙖𝙩𝙞𝙤𝙣 𝙩𝙝𝙚 𝙘𝙤𝙢𝙥𝙖𝙣𝙮'𝙨 𝙖𝙫𝙚𝙧𝙖𝙜𝙚 𝙨𝙖𝙡𝙖𝙧𝙮) 𝙖𝙣𝙙 same condition to be applied for 𝙤𝙩𝙝𝙚𝙧 𝙙𝙚𝙥𝙖𝙧𝙩𝙢𝙚𝙣𝙩 ------------------------------------------- -Sample Table Created ------------------------------------------------------------ create table PayPal_emp( emp_id int, emp_...

🅳🆈🅽🅰🅼🅸🅲 🆃🅸🆃🅻🅴🆂 🅱🅰🆂🅴🅳 🅾🅽 🆂🅻🅸🅲🅴🆁 🆂🅴🅻🅴🅲🆃🅸🅾🅽 🅸🅽 🅿🅾🆆🅴🆁 🅱🅸

  🆃🅾🅿🅸🅲 : 🅳🆈🅽🅰🅼🅸🅲 🆃🅸🆃🅻🅴🆂 🅱🅰🆂🅴🅳 🅾🅽 🆂🅻🅸🅲🅴🆁 🆂🅴🅻🅴🅲🆃🅸🅾🅽 🅸🅽 🅿🅾🆆🅴🆁 🅱🅸  1-𝘿𝙮𝙣𝙖𝙢𝙞𝙘 𝙏𝙞𝙩𝙡𝙚 𝘽𝙖𝙨𝙚𝙙 𝙤𝙣 𝙎𝙡𝙞𝙘𝙚𝙧 𝙎𝙞𝙣𝙜𝙡𝙚 𝙨𝙚𝙡𝙚𝙘𝙩 2-𝘿𝙮𝙣𝙖𝙢𝙞𝙘 𝙏𝙞𝙩𝙡𝙚 𝘽𝙖𝙨𝙚𝙙 𝙤𝙣 𝙎𝙡𝙞𝙘𝙚𝙧 𝙈𝙪𝙡𝙩𝙞-𝙨𝙚𝙡𝙚𝙘𝙩 3-𝘿𝙮𝙣𝙖𝙢𝙞𝙘 𝙏𝙞𝙩𝙡𝙚 𝘽𝙖𝙨𝙚𝙙 𝙤𝙣 𝙎𝙡𝙞𝙘𝙚𝙧 𝙈𝙪𝙡𝙩𝙞-𝙨𝙚𝙡𝙚𝙘𝙩 𝙛𝙧𝙤𝙢 𝙏𝙬𝙤 𝙙𝙞𝙛𝙛𝙚𝙧𝙚𝙣𝙩 𝘿𝙞𝙢𝙚𝙣𝙨𝙞𝙤𝙣𝙨 Solution: https://youtu.be/UiD041WcmdQ Dataset- SalesData PWBIX File- pbix file

Student Marks & Grade SQL Real Problem Statement#sqlinterviewquestionsandanswers

We have two tables Student Marks & Grade i-Find the grade of each student & Sort the table by  descending  grade ii-If any student's Grade is below 7th Grade then they  sort the table in Ascending order of their Total Marks for these students only iii-If the Grade is greater than OR Equal to 7  then sort the table by name Alphabetically for these Students only Check out my solution on: https://www.youtube.com/watch?v=Hop7ULM53_U Download the code & Sample Input   

IntreviewQuestion||Ask by Amazon Shopify || Stratascratch

  Highest Cost Orders Data Analyst Intreview #Highest Cost Orders Data Analyst IntreviewQuestion||Ask by Amazon Shopify || Stratascratch Que-https://platform.stratascratch.com/coding/9915-highest-cost-orders?code_type=2 --Find the customer with the highest daily total order cost between 2019-02-01 to 2019-05-01. If the customer had more than one order on a certain day, sum the order costs on a daily basis. --Output the customer's first name, the total cost of their items, and the date. Check out the solution: https://youtu.be/u1blDrpxPgY Click here to download the script:

Data Analyst LinkedIn SQL Interview Question

Image
  Data Analyst LinkedIn SQL Interview Question --Given a table of candidates and their skills, you're tasked with finding the candidates best suited for an open Data Science job. You want to find candidates who are proficient in Python, Tableau, and PostgreSQL. --Write a query to list the candidates who possess all of the required skills for the job. Sort the output by candidate ID in ascending order. https://datalemur.com/questions/matching-skills Check out my solution: Download the script:

Highest Salary In Department by Pandas Ask by Twitter:

Image
  Highest Salary In Department by Pandas Ask by Twitter: Find the employee with the highest salary per department. Output the department name, and employee's first name along with the corresponding salary. check out my solution: Click here to download:

Highest Energy Consumption Pandas Intreview Question Ask by Meta/Facebook

Image
  Find the date with the highest total energy consumption from the Meta/Facebook data centers. Output the date along with the total energy consumption across all data centers. Check out the solution: Click here to download the script:

Sales by Day of the Week|| ASK BY Walmart tech India

Image
   --Sales by Day of the Week  --ASK BY Walmart tech India  --You are the business owner and would like to obtain a sales report for category items and day of the week.  --Write an SQL query to report how many units in each category have been ordered on each day of the week. Check out my solution: Click here to download the script :

Average salary by Department Python #dataanalyst Interview Question Asked by Salesforce

Image
  Average salary by Department Python  #dataanalyst   interview Question Asked by Salesforce Check out my video for the solution: Click here to download the Python code

LetCode SQL Game Analysis Problem

Image
 --Date 23-04-2023 --LetCode SQL Interview Series --Que-1--Write an SQL query to report the first login date for each player. --Que-2--Each row is a record of a player who logged in and played a number of games (possibly 0) before logging out  on someday using some device. Write a SQL query that reports the device that is first logged in for each player --Que-3--Write an SQL query that reports for each player and dates, how many games played so far by the player.  --That is the total number of games played by the player until that date. Check the example for clarity. Que-4: --Write an SQL query that reports the fraction of players that logged in again on the day after the day they first logged in, rounded to 2 decimal places. In other words, you need to count the number of players that logged in for at least two consecutive days starting from their first login date, then divide that number by the total number of players. Check out the solution: Click here to download the ...

Write an SQL query to report the distance traveled by each user.

Image
 --Write an SQL query to report the distance traveled by each user. --Return the result table ordered by travelled_distance in descending order, if two or more users traveled the same distance,order them by their name in ascending order. Solution: Check out my video for the solution: Download the script here. Download the excel here (Question details here)

SQL Interview Questions – First and Last Call On the Same Day

Image
  --Problem Description – --Ask by Subex --SQL Interview Questions – First and Last Call On the Same Day --Write an SQL query to report the  Callerid,Recipientid  of the users whose first and last calls on any day were with the  --same person along with  Datecalled column Check out my solution: Click here to download the SQL SCRIPT

Restaurant Growth 7 Days Sales Average Problem Description

Image
 --Restaurant Growth 7 Days Sales Average Problem Description – --You are the restaurant owner and you want to analyze a possible expansion (there will be at least one customer every day). --Write an SQL query to compute the moving average of how much the customer paid in a seven days window  --(i.e., current day + 6 days before) --Return result table ordered by visited_on in ascending order. Check out my solution on Youtube: Click here to download the SQL SCRIPT:

No of rows/record generated by different types of SQL join

Image
  --SQL interview series 12 ---Asked in most of intreview million dolar question ---No of rows/record generated by different types of join ---Joining Concept  Download the script

#SQLIntreviewQuestion by LeadingBank|Avg distance between source and destination on multiple routes

Image
  #SQLIntreviewQuestion by LeadingBank|Avg distance between source and destination on multiple routes ----SQL Data Analyst interview question ---Average distance between source and destination on multiple routes --Asked by a leading Bank Data Analyst/Business Intelligence SQL Interview Preparation Playlist: Click here to download the script

Ungroup the given grouped data in SQL | Solving #sqlinterviewquestions#sql

Image
  Ungroup the given grouped data in SQL | Solving #sqlinterviewquestions #sql SQL Data Analyst Interview Question Click to Download Data Analyst/Business Intelligence SQL Interview Preparation Playlist: https://www.youtube.com/playlist?list.. . YouTube: YouTube: https://www.youtube.com/@ArabindaMoha.. . LinkedIn: LinkedIn: https://www.linkedin.com/in/arabinda-.. . Blog: Blog: https://play-with-data.blogspot.com/ Tableau Public: https://public.tableau.com/app/profil.. . GitHub: GitHub: https://github.com/ARBINDA765 Twitter: https://twitter.com/Rtr_Arabinda Instagram- https://www.instagram.com/arabinda_mo.. . Telegram: Join Group Chat- https://t.me/+nHjZKdHXOx04NDFl

Cricket Score board design by SQL || Asked by Facts*** Analyt***

Image
 ---SQL intreview Question Series-12 --Cricket Score board design by SQL --Asked by Facts*** Analyt*** Do check out my video for the solution. Click to download the script

SQL Intreview Question :Ungroup the given grouped data IN SQL

Image
  ---SQL Interview Question  ---Ungroup the given grouped data in SQL  Please check out my solution  Download the script

SQL intreview Question Average distance between source and destination on multiple routes by Leading bank

 --SQL Interview Question Series Video -9 ---Average distance between source and destination on multiple routes  Do check out my video for the solution. Please like and subscribe https://www.youtube.com/watch?v=rxvInz88GMY Thanks for your support 

Missing Sequence Number in SQL (Dynamically way)

 - Find out the Missing Employee ids  #sqlinterviewquestions --SQL Interview Question Series Video -8 ---Missing Sequence Number in SQL (Dynamic way) Do check out my video for the solution. Find out the Missing Employee ids #sqlinterviewquestions

DATA ANALYST SQL Interview Question Big Four" accounting firms| find an employee who got a hike for consecutively 2 years

  SQL Interview Video Series -5 : --SQL query to find an employee who got hike for consecutively 2 years --BIG 4 Accounting Firms SQL Data Analyst interview question Get the answer on my YouTube channel: https://youtu.be/cgSdsZ1PAhs Data Analyst/Business Intelligence SQL Interview: Question https://www.youtube.com/playlist?list=PLNXw57Z3DB-U5QSGdJbiMbcN1q7KHR1k4

Create a Donut chart by Sales & Profit over Category --Tableau Intreview Question

  --Tableau Interview Question  A**ion L**s India Private Limited Tableau Interview Question  --Create a Donut chart by Sales & Profit over Category  Follow my Tableau Public Profile Donurt Chart by Sles & Profit Over category | Tableau Public

When the user will select subcategory , that particular subcategory will colored & level up with sales - Tableau Interview Question

 --Question:- When the user will select subcategory , that particular subcategory will colored & level up with sales  --Asked by Big 4 Tableau Interview Question  Follow my Tableau Public Profile Blog:  Sub category hover | Tableau Public

Choose the Dimension & Top N by Drop down --Tableau Interview Question

--Choose the Dimension & Top N by Drop down  --Tableau Interview Question --Asked by Klou** Interview question Follow my Tableau Public: Choose Dimension BY Parameter & Top N | Tableau Public

User can select the moving average day by parameter-Tableau Intreview Question

  Question-User can select the moving average day by parameter --Tableau Intreview Question --Asked by Ti**r A**l***cs Follow my Tableau Public to get the details. Tableau Public: https://public.tableau.com/app/profile/arabinda.mohapatra/viz/MovingavergaebysalesInputbyUser/Movingavergaebysales?publish=yes

Drop down list of YOY, MOM,QOQ Growth --Tableau intreview Question

--Question   A**ion L**s India Private Limited Tableau interview Question  -- Drop down list of YOY, MOM,QOQ Growth  -- Vist my Tableau public to get the details https://public.tableau.com/app/profile/arabinda.mohapatra/viz/DropdownofYOY_MOM_QOQGrowth/GROWTHKPI?publish=yes

How to change the default properties of aggregation from sum to average -Tableau Intreview Question

 --How to change the default properties of aggregation from the sum to average  Answer-Default properties > Aggregation> SUM (By default) .Can change to maximum, minimum & aggregation 

Dealing with 20M records in Tableau (CTe,Temptable & Empty extract)

--Tableau Handling Large dataset.  Dealing with 20M records in Tableau  Create a Temp table to hold the data and to store the intermediate result in INITIAL SQL & load the data to TEMP Table. doo the calculation on the top of that temp table in the Tableau Custom SQL. Create an Empty extract on top of it  Publish the Data source  & refresh on the tableau server level only. Empty extract Create a Boolean paramter  Create the workbook  Make a calculated field on the top of that parameter Show the parameter and select True Create a extract by adding that calcualted field as exculding the True  You can check the no of records in the workbook is ZERO AND Now you have zero extract ready  Now make the parameter to False so that the the condition will True (True exculde in the Extract filter & Parameter will select False) Now publish the data source on the tableau server. Refersh over the tableau server. We can connect that datasource to get a...

How to add the custom color palette in Tableau

 --Asked by Ti*er An**yti*s --How to add the custom color palette in Tableau  -- Go to the My Tableau Repository and open the preference  --Edit that html by adding color platte  <workbook> <preferences> <color-palette name="PLAYDATABLOGS" type="regular" > <color>#f6bc50</color> <color>#ab3939</color> <color>#374674</color> <color>#7ba668</color> <color>#a08ca3</color> </color-palette> </preferences> </workbook>

How to add custom shape in Tableau

Image
 --How to add the custom shape in Tableau --Go to  C:\Users\arabi \OneDrive\Documents\My Tableau Repository\Shapes --Add a folder & paste all the icon (PNG Format only) --Reload the shape

Find out the possible pair but the pair should not repeat with respect to the order of the pair

Image
 --SQL Interview question --Find out the possible pair but the pair should not repeat with respect to the order of the pair  --Table has 5 rows maximum possible pair is 10 CREATE TABLE COUNTRY (Country_name nvarchar(100)) insert into COUNTRY values ('INDIA'),('US'),('UK'),('Oman'),('Russia') SELECT REPLICATE ('*',500) As 'INPUT TABLE' GO select * from COUNTRY GO SELECT REPLICATE ('*',500) As 'OUTPUT TABLE' go  WITH COUNTRY_1 AS ( SELECT ROW_NUMBER () OVER (ORDER BY Country_name DESC ) as'Country_ID',* FROM COUNTRY ) SELECT CONCAT(C1.Country_name,'-',C2.Country_name) as 'PAIR_NAME' FROM COUNTRY_1  C1 INNER JOIN  COUNTRY_1 C2 ON C1.Country_ID > C2.Country_ID

Swap the consecutive rows and the first & last rows will remain same (No changes will be on 1st and last row)

---Swap the  consecutive rows and the first & last rows will remain same (No changes will be on 1st and last row) ---SQL INTERVIEW QUESTION SELECT REPLICATE ('*',500) As 'INPUT TABLE' SELECT EMPLOYEE_ID FROM [dbo].[EMPLOYEE_DATA] SELECT REPLICATE ('*',500) As 'OUTPUT TABLE' SELECT EMPLOYEE_ID , CASE WHEN EMPLOYEE_ID  = (SELECT MIN(EMPLOYEE_ID) FROM [dbo].[EMPLOYEE_DATA]) THEN EMPLOYEE_ID WHEN EMPLOYEE_ID  = (SELECT MAX(EMPLOYEE_ID) FROM [dbo].[EMPLOYEE_DATA]) THEN EMPLOYEE_ID WHEN employee_id %2!=0  THEN EMPLOYEE_ID-1 --Odd  WHEN  employee_id %2=0 THEN EMPLOYEE_ID+1 --EVEN   --ELSE employee_id END 'SWAP_EMP_ID ' FROM [dbo].[EMPLOYEE_DATA]

Tableau Interview question asked by BIG 4

 - -Tableau Interview question asked by BIG 4 Question-Suppose you clicked on the 2018 Year sales data (Sheet 1) & Filtered Data should populate on another sheet(Sheet 2) containing the 2018 sales data by each month of 2018(Monthly trend sales of 2018) within the same dashboard  . When you deselect the 2018 year sheet(sheet 1) the monthly sales sheet(sheet 2) should disappear from the dashboard. Along with this title should disappear when you de select sheet 1 .but the sheet2 title should appear when I clicked on sheet 1. --Used sample superstore data --Tableau Action filter  Hide the clicked sheet & Filtered Data should populate on the another sheet within same dashboard | Tableau Public

Tableau Interview question asked by BIG 4-Visualization to reflect how sales of each category is performing throughout out the Each quarter

Create a Visualization to reflect how sales of each category is performing throughout out the Each quarter  Datasource-Sample super store Published on Tableau public Category sales on each quater | Tableau Public

L&T SQL Interview Problem | Print Highest and Lowest Salary Employees in Each Department

 ----L&T SQL Interview Problem | Print Highest and Lowest Salary Employees in Each Department--------- ---SQL INTERVIEW QUESTION------- - USE [SSIS] create table employee  ( emp_name varchar(10), dep_id int, salary int ); delete from employee; insert into employee values  ('Siva',1,30000),('Ravi',2,40000),('Prasad',1,50000),('Sai',2,20000) SELECT * FROM employee --- Sample Table Creation-------------------- ---Solution------------------------ WITH max_min_salary AS( SELECT *,max(salary)OVER(PARTITION BY dep_id)AS max_salary, min(salary)OVER(PARTITION BY dep_id)AS min_salary FROM employee) --SELECT * FROM max_min_salary SELECT dep_id,max(CASE WHEN salary=max_salary THEN emp_name END) AS max_salary_employee,  max(CASE WHEN salary=min_salary THEN emp_name END) AS min_salary_employee FROM max_min_salary GROUP BY dep_id ------------------END OF THE SOLUTION--------------

Maximum no of records by INNER JOIN,LEFT JOIN,RIGHT JOIN & FULL JOIN

 --Maximum no of records by INNER JOIN,LEFT JOIN,RIGHT JOIN & FULL JOIN --SQL INTREVIEW QUESTION --Asked by Synchron ---------------------------------------------------------------------------------- USE [SSIS] Create table Synechron_TABL (      ID int ,      DepartmentName nvarchar(50),      Location nvarchar(50),      DepartmentHead nvarchar(50) ) Go --DROP TABLE Synechron_TABL Insert into Synechron_TABL values (1, 'IT', 'London', 'Rick') Insert into Synechron_TABL values (1, 'Payroll', 'Delhi', 'Ron') Insert into Synechron_TABL values (1, 'HR', 'New York', 'Christie') Insert into Synechron_TABL values (1, 'Other Department', 'Sydney', 'Cindrella') Go --DROP TABLE Synechron_TABL_2 Create table Synechron_TABL_2 (      ID int ,      Name nvarchar(50),      Gender nvarchar(50),      Salary int       ) Go Insert into Synechron_TABL_2 values (1, 'T...

NOT COMMON RECORDS FROM TWO TABLE

Image
 --NOT COMMON RECORDS FROM TWO TABLE USE [SSIS] SELECT REPLICATE('*',100) as 'INPUT_TABLE' SELECT * FROM [dbo].[emp_2020] SELECT * FROM [dbo].[emp_2021] ------1ST WAY OF SOLUTION----- SELECT REPLICATE('*',100) as 'OUTPUT_TABLE' SELECT * FROM [dbo].[emp_2020] E_20 WHERE E_20.emp_id NOT IN  ( SELECT E_21.emp_id   FROM [dbo].[emp_2021] E_21  ) UNION ALL SELECT * FROM [dbo].[emp_2021] E_20 WHERE E_20.emp_id NOT IN  ( SELECT E_20.emp_id   FROM [dbo].[emp_2020] E_20 ) ----------2ND WAY OF SOLUTION--------------------- SELECT E_20.emp_id,E_21.emp_id FROM [dbo].[emp_2020] E_20 FULL JOIN  [dbo].[emp_2021] E_21 ON E_20.emp_id = E_21.emp_id WHERE E_20.emp_id IS  NULL OR E_21.emp_id IS  NULL