TGViewer
Channel Public Channel
Data Analytics

Data Analytics

@sqlspecialist

Perfect channel to learn Data Analytics

Learn SQL, Python, Alteryx, Tableau, Power BI and many more

For Promotions: @coderfun @love_data
Subscribers
111K
Photos
224
Videos
1
Links
951

Showing posts older than #2941 · Back to latest

Older Posts 20 shown
Post #2940 4.41K
GigaChat 3.5 Ultra Publicly Released — The New Generation of the Flagship Model

The GigaChat team has released GigaChat 3.5 Ultra as open source—a new 432B model under the MIT license. This is the first open-source hybrid of GatedDeltaNet and MLA scaled to hundreds of billions of parameters, featuring a proprietary training recipe we refined through more than 1,500 experiments. The model has grown in terms of code, mathematics, agent scenarios, and application domains—yet it’s 40% smaller than GigaChat 3.1 Ultra.


What’s inside:

🔘A proprietary hybrid MLA + Gated DeltaNet architecture with a dedicated stabilization framework, without which this hybrid setup would not train reliably at this scale;
🔘 Gated Attention: the model can locally down-weight overly strong signals from the attention layer;
🔘GatedNorm: normalization with an explicit gate that controls signal magnitude across features;
🔘Approximately 4x lower KV cache per token: with the same memory budget, the model can support 2.14x longer context and deliver a 20% throughput increase under load;
🔘Two MTP heads, enabling up to 2.2x faster generation;
🔘FP8 across all training stages with no quality degradation compared with bf16, enabled by custom Triton and CUDA kernels;
🔘A new online RL stage after SFT and DPO.

Results:

🔘 GigaChat-3.5-Ultra-Base outperforms DeepSeek V3.2 Exp Base and DeepSeek V4 Flash Base on average across a set of general, math, and code benchmarks:
🔘 GigaChat-3.5-Ultra-Instruct is comparable to DeepSeek V3.2 in terms of average score, despite having half the size;
🔘 According to the MiniMax-M2.7 LLM judge, the average win rate against GigaChat 3.1 Ultra is 75.9%, and against GPT-5 is 68.7%.

The entire stack — data (our own LLM-filtered Common Crawl, 600+ programming languages in the code), architecture, training methodology, and infrastructure — was built end-to-end by GigaChat team.

➡️ HuggingFace
  • ❤ 4
  • 👏 1
Post #2939 4.07K
𝗜𝗻𝘁𝗲𝗿𝘃𝗶𝗲𝘄𝗲𝗿:
You have 2 minutes to solve this SQL query.

Find employees whose salary is higher than the average salary of all other departments (excluding their own department).

Assume the table structure:
employees(employee_id, employee_name, department, salary)

𝗠𝗲: Challenge accepted! 💪

SELECT
employee_id,
employee_name,
department,
salary
FROM employees e1
WHERE salary > (
SELECT AVG(salary)
FROM employees e2
WHERE e2.department <> e1.department
);

💡 Explanation:
This query compares each employee's salary against the average salary of all employees outside their own department.

• The outer query processes each employee.
• The correlated subquery calculates the average salary of employees in all other departments.
• Employees whose salary exceeds that average are returned.

This question tests your understanding of:
✅ Correlated Subqueries
✅ Aggregate Functions (AVG)
✅ Conditional Filtering
✅ Cross-group Comparisons

🎯 Expected Output Example
Employee: John | Department: IT | Salary: 95,000
Employee: Sarah | Department: HR | Salary: 82,000


🚀 Alternative Using Common Table Expressions (CTEs)
WITH dept_avg AS (
SELECT
department,
AVG(salary) AS avg_salary
FROM employees
GROUP BY department
)
SELECT
e.employee_id,
e.employee_name,
e.department,
e.salary
FROM employees e
WHERE e.salary > (
SELECT AVG(avg_salary)
FROM dept_avg d
WHERE d.department <> e.department
);

This version first computes department-level averages and then compares each employee's salary with the average of the other departments' averages.

🚀 Tip for SQL Job Seekers:
Interviewers often ask questions that compare data within a group versus outside a group. These problems test your understanding of correlated subqueries and aggregate calculations across multiple levels.

❤️ React with ❤️ for more SQL interview challenges!
  • ❤ 11
Post #2938 4.29K
𝗙𝗥𝗘𝗘 𝗩𝗶𝗿𝘁𝘂𝗮𝗹 𝗖𝗲𝗿𝘁𝗶𝗳𝗶𝗰𝗮𝘁𝗲 𝗜𝗻𝘁𝗲𝗿𝗻𝘀𝗵𝗶𝗽𝘀 | 𝗕𝗼𝗼𝘀𝘁 𝗬𝗼𝘂𝗿 𝗥𝗲𝘀𝘂𝗺𝗲🎓

These FREE virtual certificate internships can help you build practical skills, industry exposure, and resume value from top companies and global platforms — all from home.

💫Perfect for students, freshers, and career starters

- PwC Power BI Virtual Internship
- British Airways Data Science Virtual Internship
- Quantium Data Analytics Virtual Internship

🔗 𝗘𝗻𝗿𝗼𝗹𝗹 𝗙𝗼𝗿 𝗙𝗥𝗘𝗘👇:

https://pdlink.in/44PEjcL

🚀 Start learning today. Build experience. Collect certificates. Make your resume stronger.
  • ❤ 2
Post #2937 4.47K
If you are interested to learn SQL for data analytics purpose and clear the interviews, just cover the following topics

1)Install MYSQL workbench
2) Select
3) From
4) where
5) group by
6) having
7) limit
8) Joins (Left, right , inner, self, cross)
9) Aggregate function ( Sum, Max, Min , Avg)
9) windows function ( row num, rank, dense rank, lead, lag, Sum () over)
10)Case
11) Like
12) Sub queries
13) CTE
14) Replace CTE with temp tables
15) Methods to optimize Sql queries
16) Solve problems and case studies at Ankit Bansal youtube channel

Trick: Just copy each term and paste on youtube and watch any 10 to 15 minute on each topic and practise it while learning , By doing this , you get the basics understanding

17) Now time to go on youtube and search data analysis end to end project using sql

18) Watch them and practise them end to end.

17) learn integration with power bi

In this way , you will not only memorize the concepts but also learn how to implement them in your current working and projects and will be able to defend it in your interviews as well.
  • ❤ 13
  • 👍 4
Post #2936 4.48K
📊 𝗗𝗮𝘁𝗮 𝗔𝗻𝗮𝗹𝘆𝘁𝗶𝗰𝘀 𝗙𝗥𝗘𝗘 𝗖𝗲𝗿𝘁𝗶𝗳𝗶𝗰𝗮𝘁𝗶𝗼𝗻 𝗖𝗼𝘂𝗿𝘀𝗲𝘀 🚀

✅ 100% FREE learning opportunities
✅ Great for students, freshers, and beginners
✅ Help you build a stronger resume with recognized names like Cisco, Google, and Microsoft
✅ Useful for analytics internships, off-campus drives, and fresher hiring

🔗 𝗘𝗻𝗿𝗼𝗹𝗹 𝗙𝗼𝗿 𝗙𝗥𝗘𝗘👇:

https://pdlink.in/4eRA6eF

🚀 Start learning today. Build your analytics foundation. Earn free certifications. Move one step closer to your Data Analyst career.
  • ❤ 3
Post #2935 4.79K
𝗜𝗻𝘁𝗲𝗿𝘃𝗶𝗲𝘄𝗲𝗿:
You have 2 minutes to solve this SQL query.

Find the second most recent order placed by each customer.

Assume the table structure:
orders(order_id, customer_id, order_date)

𝗠𝗲: Challenge accepted! 💪

SELECT
order_id,
customer_id,
order_date
FROM (
SELECT
order_id,
customer_id,
order_date,
ROW_NUMBER() OVER (
PARTITION BY customer_id
ORDER BY order_date DESC
) AS rn
FROM orders
) ranked
WHERE rn = 2;

💡 Explanation:

The query assigns a rank to each order based on its order date for every customer.

• PARTITION BY customer_id creates a separate ranking for each customer
• ORDER BY order_date DESC ranks the most recent order as 1
• ROW_NUMBER() ensures each order gets a unique rank
• The outer query returns only the order with rn = 2, i.e., the second most recent order

This question tests your understanding of:
✅ Window Functions (ROW_NUMBER)
✅ Ranking Records
✅ Partitioning Data
✅ Top N per Group

🎯 Expected Output Example
Customer ID | Order ID | Order Date
101 | 2056 | 2026-06-15
102 | 2074 | 2026-06-18

Customers with fewer than two orders are automatically excluded.

🚀 Alternative Using a Correlated Subquery
SELECT
o1.order_id,
o1.customer_id,
o1.order_date
FROM orders o1
WHERE 1 = (
SELECT COUNT(*)
FROM orders o2
WHERE o2.customer_id = o1.customer_id
AND o2.order_date > o1.order_date
);

This approach counts how many orders are more recent than the current order. If exactly one order is more recent, the current order is the second most recent.

🚀 Tip for SQL Job Seekers:
Questions involving the Nth latest or Nth earliest record appear frequently in interviews. Practice solving them using:
• ROW_NUMBER()
• RANK()
• DENSE_RANK()
• Correlated Subqueries

Understanding when to use each approach is a valuable interview skill.

❤️ React with ❤️ for more interview challenges!
  • ❤ 5
  • 👍 3
Post #2934 4.35K
🎓 𝗧𝗼𝗽 𝟱 𝗙𝗥𝗘𝗘 𝗖𝗼𝘂𝗿𝘀𝗲𝘀 𝗧𝗼 𝗜𝗺𝗽𝗿𝗼𝘃𝗲 𝗬𝗼𝘂𝗿 𝗦𝗸𝗶𝗹𝗹𝘀𝗲𝘁 🚀

These 5 FREE courses that can help you stand out in interviews and job applications! 💼✨

📊 Microsoft Excel
📈 Power BI
💫 Python for Data Science
⏰Time Management
💰 Basic Financial Accounting

🎯 Invest a few hours today to unlock better career opportunities tomorrow!

🔗 𝗟𝗲𝗮𝗿𝗻 𝗙𝗼𝗿 𝗙𝗥𝗘𝗘 👇:-

https://pdlink.in/4dPjz92

📌 Save this post and share it with friends looking to upskill in 2026.
  • ❤ 5
  • 👍 1
  • 👏 1
Post #2933 5.12K
Interviewer: 
You have 2 minutes to solve this SQL query. 

Find the employee(s) with the highest salary in each department without using window functions.

Assume the table structure: 
employees(employee_id, employee_name, department, salary)

Me: Challenge accepted! 💪 
SELECT 
    employee_id, 
    employee_name, 
    department, 
    salary 
FROM employees e1 
WHERE salary = ( 
    SELECT MAX(salary) 
    FROM employees e2 
    WHERE e2.department = e1.department 
);

💡 Explanation: 
This query uses a correlated subquery instead of a window function.

• The outer query processes each employee
• The correlated subquery finds the maximum salary within that employee's department
• If the employee's salary matches the maximum salary, the employee is returned
• If multiple employees share the highest salary in a department, they are all included

This question tests your understanding of: 
• Correlated Subqueries
• Aggregate Functions (MAX)
• Filtering with Subqueries
• Handling Ties

🎯 Expected Output Example: 
John     | IT      | 95,000 
Alice    | IT      | 95,000 
Sarah    | HR      | 82,000 
David    | Finance | 91,000 

John and Alice are both returned because they share the highest salary in the IT department.

🚀 Alternative Using a Self Join 
SELECT 
    e1.employee_id, 
    e1.employee_name, 
    e1.department, 
    e1.salary 
FROM employees e1 
LEFT JOIN employees e2 
    ON e1.department = e2.department 
   AND e1.salary < e2.salary 
WHERE e2.employee_id IS NULL; 

This solution works by eliminating employees who have someone in the same department with a higher salary. The remaining employees are the highest-paid in their respective departments.

🚀 Tip for SQL Job Seekers: 
Interviewers often restrict certain SQL features like window functions or CTEs to evaluate your understanding of alternative approaches. Be prepared to solve the same problem using: 
• Correlated Subqueries
• Self Joins
• CTEs
• Window Functions

Knowing multiple solutions demonstrates strong SQL fundamentals.

❤️ React with ❤️ for more SQL interview challenges!
  • ❤ 5
  • 🎉 4
Post #2931 4.67K
Interviewer: 
You have 2 minutes to solve this SQL query. 
Find the employee or employees who earn more than the average salary of their department and have been with the company for more than 5 years.

Assume the table structure: 
employees(employee_id, employee_name, department, salary, joining_date)

Me: Challenge accepted! 

SELECT
    employee_id,
    employee_name,
    department,
    salary,
    joining_date
FROM employees e
WHERE salary > (
    SELECT AVG(salary)
    FROM employees
    WHERE department = e.department
)
AND joining_date <= CURRENT_DATE - INTERVAL '5 years';


Explanation: 
This query applies two conditions to identify experienced, high-performing employees.

• The correlated subquery calculates the average salary for each employee's department.
• The first condition returns employees earning above their department's average salary.
• The second condition filters employees who joined the company more than 5 years ago.
• Only employees satisfying both conditions are included in the final result.

This question tests your understanding of: 
• Correlated Subqueries
• Aggregate Functions using AVG
• Date Arithmetic
• Multiple Filtering Conditions

Expected Output Example 
Employee: John, Department: IT, Salary: 95,000, Joining Date: 2018-01-10 

Employee: Sarah, Department: HR, Salary: 82,000, Joining Date: 2017-06-15 

Alternative Using Window Functions 

SELECT
    employee_id,
    employee_name,
    department,
    salary,
    joining_date
FROM (
    SELECT
        *,
        AVG(salary) OVER (PARTITION BY department) AS dept_avg_salary
    FROM employees
) e
WHERE salary > dept_avg_salary
AND joining_date <= CURRENT_DATE - INTERVAL '5 years';


This approach avoids a correlated subquery by calculating the departmental average once using a window function, which can be more efficient on large datasets.

Tip for SQL Job Seekers: 
Real-world interview questions often combine multiple SQL concepts in a single problem. Practice writing queries that use: 
• Window Functions
• Correlated Subqueries
• Date Functions
• Aggregate Functions
• Complex WHERE conditions

These combined-concept questions are common in mid-level and senior SQL interviews.

❤️ React with ❤️ for more SQL interview challenges!
  • ❤ 11
Post #2930 4.13K
𝗙𝗥𝗘𝗘 𝗣𝘆𝘁𝗵𝗼𝗻 𝗣𝗿𝗼𝗴𝗿𝗮𝗺𝗺𝗶𝗻𝗴 𝗖𝗼𝘂𝗿𝘀𝗲𝘀 | 𝟰 𝗠𝘂𝘀𝘁-𝗧𝗮𝗸𝗲 𝗖𝗼𝘂𝗿𝘀𝗲𝘀 🚀

✅ Python is one of the most beginner-friendly and in-demand programming languages

🎓Perfect For
👨‍🎓 Students
💼 Freshers
💫Coding Beginners
📊 Data / AI / Automation aspirants
🚀 Anyone planning to start a tech career with Python

🔗 𝗘𝗻𝗿𝗼𝗹𝗹 𝗙𝗼𝗿 𝗙𝗥𝗘𝗘👇:

https://pdlink.in/4wjwEz2

🚀 Build Python skills for free. Take your first step toward a stronger tech career.
  • ❤ 2
Post #2929 4.38K
Interviewer:

You have 2 minutes to solve this SQL query. 

Find the employee or employees with the highest salary in the company without using MAX().

Me: Challenge accepted!

SELECT
    employee_id,
    employee_name,
    salary
FROM (
    SELECT
        employee_id,
        employee_name,
        salary,
        DENSE_RANK() OVER (ORDER BY salary DESC) AS salary_rank
    FROM employees
) ranked
WHERE salary_rank = 1;


Explanation:

This query finds the highest-paid employee or employees without using the MAX() aggregate function.

• DENSE_RANK() ranks salaries in descending order.

• The highest salary receives a rank of 1.

• The outer query filters only employees with salary_rank = 1.

• If multiple employees share the highest salary, they are all returned.

This question tests your understanding of:

• Window Functions using DENSE_RANK

• Ranking Data

• Handling Ties

• Alternatives to Aggregate Functions

Expected Output Example

Employee: John, Salary: 120,000

Employee: Alice, Salary: 120,000 

Both employees are returned because they share the highest salary.

Alternative Solution using NOT EXISTS

SELECT
    employee_id,
    employee_name,
    salary
FROM employees e1
WHERE NOT EXISTS (
    SELECT 1
    FROM employees e2
    WHERE e2.salary > e1.salary
);


This solution works by returning employees for whom no other employee has a higher salary.

Tip for SQL Job Seekers:

Interviewers often ask you to solve problems without using aggregate functions like MAX() or MIN(). Learn multiple approaches using: 

• Window Functions 

• NOT EXISTS 

• Correlated Subqueries 

• Self Joins 

Demonstrating alternative solutions shows strong SQL problem-solving skills.

❤️ React with ❤️ for more SQL interview challenges!
  • ❤ 11
Post #2928 4.21K
🚀 𝗙𝗥𝗘𝗘 𝗧𝗖𝗦 𝗖𝗲𝗿𝘁𝗶𝗳𝗶𝗰𝗮𝘁𝗶𝗼𝗻 | 𝗕𝗼𝗼𝘀𝘁 𝗬𝗼𝘂𝗿 𝗖𝗮𝗿𝗲𝗲𝗿🎓

A FREE TCS certification can be a smart way to strengthen your profile, improve job readiness, and stand out in internships, placements, and fresher hiring.

✅ Learn from one of India’s top IT companies
✅ Add a recognized certification to your resume + LinkedIn profile
✅ Great for students, freshers, and placement preparation
✅ Free certifications from trusted brands add real value to your profile

🔗 𝗘𝗻𝗿𝗼𝗹𝗹 𝗙𝗼𝗿 𝗙𝗥𝗘𝗘👇:

https://pdlink.in/4fjeMPe

🎓Earn your free TCS certification. Make your resume stronger.
Post #2927 4.37K
𝗜𝗻𝘁𝗲𝗿𝘃𝗶𝗲𝘄𝗲𝗿: 
You have 2 minutes to solve this SQL query.

Find the product(s) that have never been ordered.

Tables: 
products(product_id, product_name) 
order_details(order_id, product_id, quantity)

𝗠𝗲: Challenge accepted! 💪 
SELECT 
    p.product_id, 
    p.product_name 
FROM products p 
LEFT JOIN order_details od 
    ON p.product_id = od.product_id 
WHERE od.product_id IS NULL;

💡 Explanation: 
This query finds all products that do not have a matching record in the order_details table.

LEFT JOIN returns all products, regardless of whether they've been ordered. Products without matching orders will have NULL values for columns from order_details. WHERE od.product_id IS NULL filters only those products that have never been ordered.

This question tests your understanding of: LEFT JOIN, NULL handling, Finding unmatched records

🎯 Expected Output Example 
Product ID   Product Name 
104   Wireless Mouse 
118   USB Hub 
125   Laptop Stand 

🚀 Alternative Using NOT EXISTS 
SELECT 
    p.product_id, 
    p.product_name 
FROM products p 
WHERE NOT EXISTS ( 
    SELECT 1 
    FROM order_details od 
    WHERE od.product_id = p.product_id 
);

NOT EXISTS is often preferred because it handles NULL values correctly and can perform better than other approaches in many database systems.

🚀 Tip for SQL Job Seekers: 
Whenever you're asked to find records that don't exist in another table, consider these approaches: 

LEFT JOIN ... IS NULL, NOT EXISTS ✅ (often the best choice), NOT IN (be cautious with NULL values)

Knowing the pros and cons of each approach is a common interview discussion point.

❤️ React with ❤️ for more SQL interview challenges!
  • ❤ 8
Post #2926 4.44K
📊 𝗕𝗲𝘀𝘁 𝗬𝗼𝘂𝗧𝘂𝗯𝗲 𝗖𝗵𝗮𝗻𝗻𝗲𝗹𝘀 𝘁𝗼 𝗟𝗲𝗮𝗿𝗻 𝗗𝗮𝘁𝗮 𝗔𝗻𝗮𝗹𝘆𝘁𝗶𝗰𝘀 🚀

You don’t need expensive courses to learn SQL, Excel, Python, Power BI, Tableau, and real-world analytics projects.

The Best YouTube channels for Data Analytics can help you build job-ready skills for internships, placements, and full-time analyst roles — all for FREE.

🔗 𝗘𝗻𝗿𝗼𝗹𝗹 𝗙𝗼𝗿 𝗙𝗥𝗘𝗘👇:

https://pdlink.in/3QO3MQB

🚀Start with one channel, stay consistent, build projects, and your Data Analytics career can genuinely take off.
  • ❤ 4
Post #2925 4.39K
𝗜𝗻𝘁𝗲𝗿𝘃𝗶𝗲𝘄𝗲𝗿:
You have 2 minutes to solve this SQL query.

Find the customers who placed orders on three or more consecutive days.

Assume the table structure:
orders(order_id, customer_id, order_date)

𝗠𝗲: Challenge accepted! 💪

WITH consecutive_orders AS (
SELECT
customer_id,
order_date,
DATE_SUB(
order_date,
INTERVAL ROW_NUMBER() OVER (
PARTITION BY customer_id
ORDER BY order_date
) DAY
) AS grp
FROM (
SELECT DISTINCT
customer_id,
order_date
FROM orders
) t
)
SELECT
customer_id
FROM consecutive_orders
GROUP BY
customer_id,
grp
HAVING COUNT(*) >= 3;

💡 Explanation:
This query identifies sequences of consecutive order dates for each customer.

• ROW_NUMBER() assigns a sequence number to each order date per customer.
• Subtracting the row number from the order date creates the same grp value for consecutive dates.
• GROUP BY customer_id, grp groups each consecutive streak.
• **HAVING COUNT(*) >= 3** returns customers with a streak of at least three consecutive days.

This question tests your understanding of: Common Table Expressions (CTEs), Window Functions (ROW_NUMBER()), Gaps and Islands Problem, Date Arithmetic.

🎯 Expected Output Example
Customer ID
101
205

(Customer 101 ordered on June 1, 2, and 3. Customer 205 ordered on July 10, 11, and 12.)

🚀 Tip for SQL Job Seekers:
The Gaps and Islands pattern is one of the most advanced and frequently discussed SQL interview topics.

Master it for solving:
• Consecutive login days
• Consecutive purchases
• Attendance streaks
• Consecutive transactions
• User activity analysis

Being comfortable with this pattern can set you apart in technical interviews.

❤️ React with ❤️ for more SQL interview challenges!
  • ❤ 8
Post #2924 4.11K
🎯𝗙𝗥𝗘𝗘 𝗜𝗻𝘁𝗲𝗿𝘃𝗶𝗲𝘄 𝗣𝗿𝗲𝗽𝗮𝗿𝗮𝘁𝗶𝗼𝗻 𝗖𝗼𝘂𝗿𝘀𝗲𝘀 | 𝗨𝗻𝗹𝗼𝗰𝗸 𝗬𝗼𝘂𝗿 𝗖𝗮𝗿𝗲𝗲𝗿 𝗣𝗼𝘁𝗲𝗻𝘁𝗶𝗮𝗹 🚀

— Perfect for students, freshers, and job seekers preparing for placements or their next big opportunity.

✅ 100% FREE learning resources
✅ Helps improve interview confidence + job readiness
✅ Great for placements, internships, off-campus drives, and fresher hiring

🔗 𝗘𝗻𝗿𝗼𝗹𝗹 𝗙𝗼𝗿 𝗙𝗥𝗘𝗘👇:

https://pdlink.in/4fjeMPe

🚀 Start learning today. Build confidence. Crack interviews smarter. Move closer to your dream job.
  • ❤ 6
Post #2923 4.77K
𝗜𝗻𝘁𝗲𝗿𝘃𝗶𝗲𝘄𝗲𝗿:
You have 2 minutes to solve this SQL query.

Find the customers who placed orders on three or more consecutive days.

Assume the table structure:
orders(order_id, customer_id, order_date)

𝗠𝗲: Challenge accepted! 💪

WITH consecutive_orders AS (
SELECT
customer_id,
order_date,
DATE_SUB(
order_date,
INTERVAL ROW_NUMBER() OVER (
PARTITION BY customer_id
ORDER BY order_date
) DAY
) AS grp
FROM (
SELECT DISTINCT
customer_id,
order_date
FROM orders
) t
)
SELECT
customer_id
FROM consecutive_orders
GROUP BY
customer_id,
grp
HAVING COUNT(*) >= 3;

💡 Explanation:
This query identifies sequences of consecutive order dates for each customer.

• ROW_NUMBER() assigns a sequence number to each order date per customer.
• Subtracting the row number from the order date creates the same grp value for consecutive dates.
• GROUP BY customer_id, grp groups each consecutive streak.
• **HAVING COUNT(*) >= 3** returns customers with a streak of at least three consecutive days.

🎯 Expected Output Example
Customer ID
101
205

(Customer 101 ordered on June 1, 2, and 3. Customer 205 ordered on July 10, 11, and 12.)

🚀 Tip for SQL Job Seekers:
The Gaps and Islands pattern is one of the most advanced and frequently discussed SQL interview topics. Master it for solving:
Consecutive login days, Consecutive purchases, Attendance streaks, Consecutive transactions, User activity analysis

Being comfortable with this pattern can set you apart in technical interviews.

❤️ React with ❤️ for more SQL interview challenges!
  • ❤ 13
Post #2922 5.26K
🎓𝟳 𝗙𝗥𝗘𝗘 𝗠𝗶𝗰𝗿𝗼𝘀𝗼𝗳𝘁 & 𝗟𝗶𝗻𝗸𝗲𝗱𝗜𝗻 𝗖𝗲𝗿𝘁𝗶𝗳𝗶𝗰𝗮𝘁𝗶𝗼𝗻𝘀 🚀

Learn job-ready skills from Microsoft + LinkedIn and add recognized certificates to your resume without spending money

✅ 100% FREE to access
✅ Learn from Microsoft + LinkedIn Learning
✅ Beginner-friendly and career-focused
✅ Great for students, freshers, and career switchers

🔗 𝗘𝗻𝗿𝗼𝗹𝗹 𝗙𝗼𝗿 𝗙𝗥𝗘𝗘👇:

https://pdlink.in/4wmXdTY

🚀 Start learning today. Collect free certifications. Build your skills. Make your resume stand out.
  • ❤ 2
Post #2921 4.88K
𝗜𝗻𝘁𝗲𝗿𝘃𝗶𝗲𝘄𝗲𝗿:
You have 2 minutes to solve this SQL query.
Find the month with the highest total sales.

Assume the table structure: sales(sale_id, sale_date, amount)

𝗠𝗲: Challenge accepted! 💪
SELECT
EXTRACT(YEAR FROM sale_date) AS year,
EXTRACT(MONTH FROM sale_date) AS month,
SUM(amount) AS total_sales
FROM sales
GROUP BY
EXTRACT(YEAR FROM sale_date),
EXTRACT(MONTH FROM sale_date)
ORDER BY total_sales DESC
LIMIT 1;

💡 Explanation:
This query groups sales by year and month, calculates the total sales for each month, and returns the month with the highest sales.

Key parts:
• EXTRACT YEAR FROM sale_date gets the year.
• EXTRACT MONTH FROM sale_date gets the month.
• SUM amount calculates total monthly sales.
• ORDER BY total_sales DESC sorts from highest to lowest.
• LIMIT 1 returns the top-performing month.

This question tests your understanding of:
Date Functions, Aggregate Functions SUM, GROUP BY, ORDER BY

🎯 Expected Output Example
Year: 2026, Month: 5, Total Sales: 245,000

🚀 Alternative Handles Ties
SELECT
year,
month,
total_sales
FROM (
SELECT
EXTRACT(YEAR FROM sale_date) AS year,
EXTRACT(MONTH FROM sale_date) AS month,
SUM(amount) AS total_sales,
DENSE_RANK() OVER (
ORDER BY SUM(amount) DESC
) AS rnk
FROM sales
GROUP BY
EXTRACT(YEAR FROM sale_date),
EXTRACT(MONTH FROM sale_date)
) ranked
WHERE rnk = 1;

This version returns all months tied for the highest total sales.

🚀 Date-based aggregation questions are among the most common in SQL interviews. Practice grouping data by Day, Week, Month, Quarter, Year. You'll encounter these patterns frequently in analytics and reporting roles.

❤️ React with ❤️ for more SQL interview challenges!
  • ❤ 13
Post #2920 4.81K
I see so many people jump into data analytics, excited by its popularity, only to feel lost or uninterested soon after. I get it, data isn’t for everyone, and that’s okay.

Data analytics requires a certain spark or say curiosity. You need that drive to dig deeper, to understand why things happen, to explore how data pieces connect to reveal a bigger picture. Without that spark, it’s easy to feel overwhelmed or even bored.

Before diving in, ask yourself, Do I really enjoy solving puzzles? Am I genuinely excited about numbers, patterns, and insights? If you’re curious and love learning, data can be incredibly rewarding. But if it’s just about following a trend, it might not be a fulfilling path for you.

Be honest with yourself. Find your passion, whether it’s in data or somewhere else and invest in something that truly excites you.

Hope this helps you 😊
  • ❤ 25
Older posts →
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →