SQL Junction
2.92K subscribers
17 photos
1 video
7 files
90 links
Download Telegram
❄️ Snowflake + dbt Interview Question of the Day πŸ”§

Q: Your dbt incremental model processes only new records based on updated_at. What happens if data arrives 2 days late? πŸ‘€

A simple filter like:

WHERE updated_at > (
SELECT MAX(updated_at) FROM {{ this }}
)

can potentially miss late-arriving records.
My approach πŸ‘‡
Instead of processing only records newer than the absolute MAX timestamp,

I’d use a lookback window:

{% if is_incremental() %}

WHERE updated_at >= (
SELECT DATEADD(day, -3, MAX(updated_at))
FROM {{ this }}
)

{% endif %}

Now every incremental run reprocesses a small overlap of recent data. πŸ”„

But that introduces another problem:

πŸ‘‰ Duplicates.

So I’d pair the lookback with a reliable unique key / merge strategy and appropriate deduplication logic.

The idea is simple:

⚑ Incremental processing for performance
βͺ Lookback window for late-arriving data
πŸ”‘ Unique key / MERGE for idempotency
πŸ§ͺ dbt tests for data quality

Because in production...
Incremental doesn't just mean β€œprocess less data.”
It means process less data without losing correctness. 🎯
❀1πŸ‘1πŸ‘1
🚨 SQL Interview Question I Was Asked yesterday

Yesterday,I faced this SQL question in an interview, and the JOIN requirement made it more interesting than it initially looked.

You have two tables:
SalesOrder
β€’ prodId
β€’ orderDate
β€’ amount
Product
β€’ prodId
β€’ description

The requirement:
πŸ‘‰ Show all products, even if they have no sales β†’ amount should be 0

πŸ‘‰ Also show sales where the prodId has no matching product description β†’ display β€œNo Description”

πŸ€” The question is: Which JOIN would you use?
Don’t overthink it. Look at the two requirements carefully before voting πŸ‘‡
❀3
Which join would you use?
Final Results
11%
Inner
22%
Left
19%
Right
56%
Full Outer
7%
Cross
For those of you wondering
The correct answer is Full outer join

This question is covering both edge cases of left join and right join

So to get desired result the correct answer is full outer join

I did not expect any one to hit cross join🫠
πŸ‘3
Top 100 Data Analyst Interview Questions

βœ… Data Analytics Basics
1. What is data analytics?
2. Difference between data analytics and data science?
3. What problems does a data analyst solve?
4. What are the types of data analytics?
5. What tools do data analysts use daily?
6. What is a KPI?
7. What is a metric vs KPI?
8. What is descriptive analytics?
9. What is diagnostic analytics?
10. What does a typical day of a data analyst look like?

Data and Databases
11. What is structured data?
12. What is semi-structured data?
13. What is unstructured data?
14. What is a database?
15. Difference between OLTP and OLAP?
16. What is a primary key?
17. What is a foreign key?
18. What is a fact table?
19. What is a dimension table?
20. What is a data warehouse?

SQL for Data Analysts
21. What is SELECT used for?
22. Difference between WHERE and HAVING?
23. What is GROUP BY?
24. What are aggregate functions?
25. Difference between INNER and LEFT JOIN?
26. What are subqueries?
27. What is a CTE?
28. How do you handle duplicates in SQL?
29. How do you handle NULL values?
30. What are window functions?

Excel for Data Analysis
31. What are pivot tables?
32. Difference between VLOOKUP and XLOOKUP?
33. What is conditional formatting?
34. What are COUNTIFS and SUMIFS?
35. What is data validation?
36. How do you remove duplicates in Excel?
37. What is IF formula used for?
38. Difference between relative and absolute reference?
39. How do you clean data in Excel?
40. What are common Excel mistakes analysts make?

Data Cleaning and Preparation
41. What is data cleaning?
42. How do you handle missing data?
43. How do you treat outliers?
44. What is data normalization?
45. What is data standardization?
46. How do you check data quality?
47. What is duplicate data?
48. How do you validate source data?
49. What is data transformation?
50. Why is data preparation important?

Statistics for Data Analysts
51. Difference between mean and median?
52. What is standard deviation?
53. What is variance?
54. What is correlation?
55. Difference between correlation and causation?
56. What is an outlier?
57. What is sampling?
58. What is distribution?
59. What is skewness?
60. When do you use median over mean?

Data Visualization
61. Why is data visualization important?
62. Difference between bar and line chart?
63. When do you use a pie chart?
64. What is a dashboard?
65. What makes a good dashboard?
66. What is a KPI card?
67. Common visualization mistakes?
68. How do you choose the right chart?
69. What is drill down?
70. What is data storytelling?

Power BI or Tableau
71. What is Power BI or Tableau used for?
72. What is a data model?
73. What is a relationship?
74. What is DAX?
75. Difference between measure and calculated column?
76. What is Power Query?
77. What are filters and slicers?
78. What is row level security?
79. What is refresh schedule?
80. How do you optimize reports?

Business and Case Questions
81. How do you analyze a sales drop?
82. How do you define success metrics?
83. What business metrics have you worked on?
84. How do you prioritize insights?
85. How do you validate insights?
86. What questions do you ask stakeholders?
87. How do you handle vague requirements?
88. How do you measure business impact?
89. How do you explain numbers to managers?
90. How do you recommend actions?

Projects and Real World
91. Explain your best project.
92. What data sources did you use?
93. How did you clean the data?
94. What insight had the most impact?
95. What challenge did you face?
96. How did you solve it?
97. How did stakeholders use your dashboard?
98. What would you improve in your project?
99. How do you handle tight deadlines?
100. Why should we hire you as a data analyst?

Stay Tuned β€οΈπŸ‘
πŸ”₯2❀1πŸ‘1
Top Data Analyst Projects That Impress Recruiters πŸ“ˆπŸ’Ό

1. Sales Data Analysis
β†’ Analyze monthly/quarterly sales trends
β†’ Segment by product, region, and sales reps
β†’ Tools: Excel, SQL, Power BI/Tableau

2. Customer Retention Dashboard
β†’ Churn analysis and retention KPIs
β†’ Use cohort analysis, funnel visualization
β†’ Tools: Python, Tableau

3. E-commerce Data Exploration
β†’ Study user behavior, conversion rate
β†’ Analyze cart abandonment, top-selling products
β†’ Tools: SQL, Python (Pandas, Matplotlib)

4. HR Data Insights
β†’ Track hiring trends, attrition, diversity metrics
β†’ Build dashboards showing tenure, department stats
β†’ Tools: Excel, Power BI

5. Financial Data Modeling
β†’ Actual vs. forecasted revenue/costs
β†’ Include profitability ratios and variance analysis
β†’ Tools: Excel, Power BI, SQL

6. Web Traffic Analysis
β†’ Analyze Google Analytics or log data
β†’ Focus on user paths, bounce rates, session duration
β†’ Tools: Python, SQL

7. Survey Data Insights
β†’ Clean raw survey data, visualize trends
β†’ Sentiment analysis on feedback (optional NLP)
β†’ Tools: Excel, Python, Tableau

Tips:
β€’ Explain the business impact of your insights
β€’ Show your workflow: data cleaning β†’ analysis β†’ visualization
β€’ Host projects on GitHub or portfolio site

Stay Tunedβ€οΈπŸ‘

#Dataanalyst #SQL #InterviewPrep
❀1
πŸ”₯ New YouTube Video Alert

Can You Solve This Deloitte SQL Interview Question?

You’re given a products table where the category is available only for the first product, while the following rows contain NULL.

Beverages β†’ Coca Cola
NULL β†’ Pepsi
NULL β†’ Sprite
NULL β†’ Fanta

Snacks β†’ Lays
NULL β†’ Doritos
NULL β†’ Kurkure

🎯 Challenge:
How would you fill those NULL category values with the correct category?

πŸ’‘ Hint: Think about Window Functions πŸ‘€

This is a great SQL problem to test your understanding of NULL handling + data transformation.

πŸ‘‡ What would you use?

πŸ…°οΈ LAG()
πŸ…±οΈ LEAD()
πŸ…²οΈ LAST_VALUE()
πŸ…³οΈ ROW_NUMBER()

🎬 Solution video
Fill Missing Categories in SQL | Hard Deloitte Interview Question
https://youtu.be/IX9NBK3Yx-M
πŸš€

Check it out now and let me know in comments ,What did you learn?

#SQL #SQLInterview #Deloitte #SQLChallenge #DataEngineering #Snowflake
πŸ‘1
SQL Junction pinned Β«πŸ”₯ New YouTube Video Alert Can You Solve This Deloitte SQL Interview Question? You’re given a products table where the category is available only for the first product, while the following rows contain NULL. Beverages β†’ Coca Cola NULL β†’ Pepsi NULL…»
SQL Junction pinned Β«πŸ”₯ New YouTube Video Alert Can You Solve This Deloitte SQL Interview Question? You’re given a products table where the category is available only for the first product, while the following rows contain NULL. Beverages β†’ Coca Cola NULL β†’ Pepsi NULL…»
πŸš€ Azure and ETL data engineering roles worth exploring

If you are working with SQL, Spark, Airflow, Databricks, or cloud pipelines, these roles align well with practical data engineering workflows.

πŸ’Ό Role: Azure Data Engineer
🏒 Company: Tata Consultancy Services
πŸ“ Location: Bengaluru
🌎 Work mode: onsite
✨ Why it is worth checking: Strong Azure stack with ADF, Databricks, Synapse, PySpark, ETL/ELT, and data warehousing exposure.
πŸ”— https://artha.link/@adityabansal095/jobs/azure-data-engineer-tata-consultancy-bengaluru-abb0b3eb

πŸ’Ό Role: Senior Data Engineer
🏒 Company: Satwic
πŸ“ Location: India
🌎 Work mode: remote
✨ Why it is worth checking: Good fit for engineers working on Azure migrations, Synapse, Databricks, Spark, and large-scale data pipelines.
πŸ”— https://artha.link/@adityabansal095/jobs/senior-data-engineer-satwic-inc-india-8610633d

πŸ’Ό Role: Data Engineer
🏒 Company: TIGI HR
πŸ“ Location: Gurugram
🌎 Work mode: remote
✨ Why it is worth checking: Covers Airflow, ADF, SQL, Python, ETL workflows, and data warehouse projects.
πŸ”— https://artha.link/@adityabansal095/jobs/data-engineer-tigi-hr-gurugram-e0612e8f

Share with someone preparing for their next data engineering move.

#DataEngineering #AzureDataEngineer #SQL #Databricks #ETL #Airflow #CloudDataEngineering
❀4
Are jobs shared by me helping you out?
Final Results
45%
Yes
36%
No
18%
Not sure
Are the jobs irrelevant? Please let me know
Final Results
17%
Yes
67%
No
17%
Something else
This is me @adityabansal095

You can ping me directly here if you need any assistance or any help.
πŸ‘1
Power BI Roadmap: Step-by-Step Guide to Master Power BI πŸ“ŠπŸ’»

Whether you're aiming to be a data analyst, business intelligence pro, or dashboard expert - this roadmap has you covered πŸ‘‡

πŸ“ 1. Power BI Basics
⦁ Get familiar with Power BI Desktop interface
⦁ Connect to data sources (Excel, CSV, databases)
⦁ Learn Basic visualizations: tables, charts, slicers

πŸ“ 2. Data Transformation & Modeling
⦁ Use Power Query Editor to clean & shape data
⦁ Create relationships between tables
⦁ Understand data types & formats

πŸ“ 3. DAX Fundamentals
⦁ Master calculated columns & measures
⦁ Learn core functions: SUM, CALCULATE, FILTER, RELATED
⦁ Use variables and time intelligence functions

πŸ“ 4. Advanced Visualizations
⦁ Build interactive reports and dashboards
⦁ Use bookmarks, buttons & drill-throughs
⦁ Customize visuals & layouts for storytelling

πŸ“ 5. Data Refresh & Gateway
⦁ Set up scheduled refresh with data gateways
⦁ Understand live vs import modes
⦁ Manage refresh performance

πŸ“ 6. Row-Level Security (RLS)
⦁ Learn to restrict data access by user roles
⦁ Implement roles & test security in reports

πŸ“ 7. Power BI Service & Collaboration
⦁ Publish reports to Power BI Service
⦁ Share dashboards and collaborate with teams
⦁ Use workspaces, apps, and permissions

πŸ“ 8. Power BI Mobile & Embedded
⦁ Optimize reports for mobile devices
⦁ Embed Power BI visuals in apps or websites

πŸ“ 9. Performance Optimization
⦁ Use Performance Analyzer to tune reports
⦁ Optimize data models & DAX queries
⦁ Best practices for large datasets

πŸ“ 10. Power BI API & Automation
⦁ Use Power BI REST API for automation
⦁ Integrate with Power Automate & Azure services

πŸ“ 11. Real Projects & Practice
⦁ Build sample dashboards: Sales, Marketing, Finance
⦁ Join challenges on platforms like Enterprise DNA, Radacad

πŸ“ 12. Certification & Career Growth
⦁ Prepare for DA-100 / PL-300 certification
⦁ Build portfolio & LinkedIn presence
⦁ Apply for BI Analyst & Power BI Developer roles

πŸ’‘ Pro Tip: Combine Power BI skills with SQL and Python for a powerful data career combo!
❀2
Pandas Interview Q&A (Frequently Asked)

πŸ“Š Q1. What is Pandas and why is it used?

πŸ‘‰ Python library for data manipulation & analysis
πŸ‘‰ Provides powerful data structures like DataFrame & Series
πŸ‘‰ Used for cleaning, transforming, and analyzing data

πŸ“Š Q2. What is the difference between Series and DataFrame?

πŸ‘‰ Series β†’ 1D labeled array (single column)
πŸ‘‰ DataFrame β†’ 2D tabular structure (rows & columns)
πŸ‘‰ DataFrame is a collection of multiple Series

πŸ“Š Q3. How do you handle missing values in Pandas?

πŸ‘‰ isnull() / notnull() to detect missing values
πŸ‘‰ fillna() to replace missing data
πŸ‘‰ dropna() to remove missing records

πŸ“Š Q4. What is the difference between loc[] and iloc[]?

πŸ‘‰ loc[] β†’ Label-based indexing
πŸ‘‰ iloc[] β†’ Integer position-based indexing
πŸ‘‰ Use loc for named indexes, iloc for numeric positions

πŸ“Š Q5. What is groupby() in Pandas?

πŸ‘‰ Used for splitting data into groups
πŸ‘‰ Apply aggregation functions (sum, mean, count)
πŸ‘‰ Essential for data summarization

πŸ“Š Q6. What is the difference between merge() and concat()?

πŸ‘‰ merge() β†’ SQL-like joins (inner, left, right, outer)
πŸ‘‰ concat() β†’ Stacks data vertically or horizontally
πŸ‘‰ Use merge for relational data combining

πŸ“Š Q7. How do you filter data in Pandas?

πŸ‘‰ Use boolean conditions (df[df['col'] > value])
πŸ‘‰ Multiple conditions using & and |
πŸ‘‰ Helps in extracting specific insights

πŸ“Š Q8. What is apply() function?

πŸ‘‰ Applies a function across rows or columns
πŸ‘‰ Used for custom transformations
πŸ‘‰ More flexible than built-in functions
❀1