Azure Cloud Advocate • My tweets will help you get into tech and be an amazing Data Engineer • 210K+ Audience on LinkedIn • Check my Online Courses👇academy.azurelib.com/enquiry My Work & WebsiteJoined November 2009
10. Find all employees whose names contain the letters "a" exactly twice
SELECT * FROM employees
WHERE LENGTH(name) -
LENGTH(REPLACE(LOWER(name),'a','')) = 2
11. Running total of sales by date
SELECT date, sales,
SUM(sales) OVER (ORDER BY date) AS RunningTotal
FROM sales_data
9. Get Employee Details with Department Names
SELECT e.name, d.department_name
FROM employees e
JOIN departments d ON e.department_id = d.department_id
7. Get Total Salary by Department
SELECT department, SUM(salary) AS
total_salary
FROM employees
GROUP BY department
8. Find Nth Highest Salary (Nth = 3)
SELECT DISTINCT salary
FROM employees
ORDER BY salary DESC
LIMIT 1 OFFSET 2
5. Find Employees Who joined in 2024
SELECT * FROM employees
WHERE YEAR(joining date) = 2024
6. Find Customers Without Orders
SELECT c.customer_id, c.name
FROM customers c
LEFT JOIN orders o ON c.customer_id = o.customer_id
WHERE o.customer_id IS NULL
5. Find Employees Who joined in 2024
SELECT * FROM employees
WHERE YEAR(joining date) = 2024
6. Find Customers Without Orders
SELECT c.customer_id, c.name
FROM customers c
LEFT JOIN orders o ON c.customer_id = o.customer_id
WHERE o.customer_id IS NULL
4. How can you delete duplicate records
WITH CTE AS (
SELECT column_name,
ROW_NUMBER() OVER (PARTITION BY column_name ORDER BY
column_name) AS row_num
FROM table_name
)
DELETE FROM CTE WHERE row_num > 1
SQL INTERVIEW QUESTIONS SERIES :
1. Find the 2nd Highest Salary
SELECT MAX(salary) FROM employees
WHERE salary < (SELECT MAX(salary) FROM employees)
2. Count Of Employees in Each Department
SELECT department, COUNT(*) AS
employee_count
FROM employees
GROUP BY department
How do you find the 2nd highest salary from an employees table?
SELECT MAX(salary)
FROM employees
WHERE salary < (SELECT MAX(salary) FROM employees);
💡Explanation: This filters out the max salary, then finds the next highest.
🎯 Tip: Use DENSE_RANK() for general Nth salary.
To start your Data engineering / Data Analyst / Data Science journey
I am starting a free live BootCamp to teach Python
Starting from 04th August 2025
Mon to Fri
08:00 AM to 10:00 AM
Register here for free: lnkd.in/dRAVwVHn
Do share, it might help someone else too.
✅ Top 7 SQL Mistakes You Should Avoid🚫🛠️
1️⃣ Not Using Indexes Properly
2️⃣ Using SELECT Instead of Specific Columns
3️⃣ Ignoring NULL Values
4️⃣ Not Using JOINs Correctly
5️⃣ Poor Query Optimization
6️⃣ Not Using Aliases for Tables/Columns
7️⃣ Ignoring Data Types and Conversions
My biggest fear isn't failure.
It's staying the same.
Most people wake up every year with:
same job
same dreams
Why?
Because risk feels scary.
Because comfort feels good.
But here's the truth:
Comfort is the enemy of growth.
Start your journey to become a data pro—learn Python live, from basics to advanced, absolutely free
Course url: academy.azurelib.com/checkout/Cours…
@deepakgoyalcloud
367 Followers 1K Followingلا اله الا الله محمد رسول الله
صلى الله عليه وسلم
न घबराओ मुसलमानों ख़ुदा की शान बाकी है
अभी इस्लाम जिन्दा है अभी कुरान बाकी है!!!
109 Followers 717 FollowingLeads Buy and Sell Team, We are selling all kinds of leads and buying too! Lead Generation, SEO, and Online Marketing & Promotion Team.
8 Followers 30 FollowingHi there, I’m a passionate e-commerce and video editing with cover expert dedicated to helping business or author owners succeed online.
19 Followers 98 FollowingLearner of Life | Past ≠ Chains, It's Data
🔍Analyzing Past, Acting on Present, To Building Future
“Follow the Thoughts, Not the Person.”
🔄 Everything Cha
104 Followers 1K Followingकर्मण्येवाधिकारस्ते मां फलेषु कदाचन। Banaras Hindu University||FOC-BHU||Data Science||Apolitical||Damn good cook||Optimistic||Fighter||Never give up attitude
403 Followers 2K FollowingData Analyst | Data Engineer | Data Scientist
Manasyekam vachasyekam karmanyekam mahaatmanaam - one mind, one speech, one action.
72K Followers 158 FollowingOpen for DevRel roles!
Data Nerd | Technical Writer | SQL Obsessed | Python Possessed | Let's dig into data the simple, effective and no nonsense way 📊
1.8M Followers 428 FollowingHonoured to be followed by Shri @narendramodi Ji, PM of India | Editor in Chief - Chanakya Forum, The Chanakya Diaries, The Chanakya Dialouges
9K Followers 761 FollowingMadhava Kannada Brahmin, Vedic Astrologer,Mystery, Very Kind, Loving, Caring, Devotional, Born for Higher Purpose. Shri krishna Bhakta will rule this Universe
23.3M Followers 3 FollowingBharatiya Janata Party, the world's largest political party, on a mission to empower 1.4 Billion Indians for building a #ViksitBharat by 2047... 🇮🇳
1.1M Followers 2K FollowingFlaneur: probability (philosophy), probability (mathematics), probability (real life),Phoenician wine, deadlifts & dead languages. Greco-Levantine.Canaan. #RWRI
200K Followers 173 FollowingBuilt ad campaigns for multiple billion-dollar companies. Spending over $100K per month on ads and need help? Let's work together here: https://t.co/1NdyfF4HyV
33K Followers 1K FollowingFounder, Goldilocks Research | CMT, CFTe, MSTA (Dist.)| Three-time winner at the Global Technical Analyst Awards, London | Support : +971 581786966
177K Followers 2K FollowingCommon Indian Citizen.!
Spent 23 days in jail for calling EX CM UT Modern Day Aurangzeb & his Son Baby 🐧.
Honoured To Be Followed By PM Modi.
हर हर महादेव🙏
21K Followers 180 FollowingFollow our Azure Developer Advocates for all the info on how to get your tech stack on @Azure the way you like to develop apps. https://t.co/cTZJnUtNs9
1K Followers 1K FollowingHeading SQL Server & Azure SQL R&D India | Cofounder @ShrotaHouse |
Past: Microsoft Research India, Microsoft Gray Systems Lab, IIT Bombay, ThoughtWorks, BMSCE.
216K Followers 3K FollowingProfessor in Finance with Acute acumen in Politics & International Affairs. Speak Truth even if Bitter. Compelled to Swim Against Tide sometimes...to say FACTS.
1K Followers 142 FollowingI am not sebi register advisor. I am giving call for educational purpose only.
Disclaimer: Investing in the stock market, futures, and options can be risky.
1K Followers 4 FollowingBuilt a 7-figure Amazon Business from home | Now helping 250+ students start & scale their Amazon Business | Learn how to do the same ⬇️
9K Followers 38 FollowingI write about data engineering | SQL | Python | Distributed systems. Get my free data engineering course at https://t.co/sZTEcV0Q9W