Веб-версияОткрыть в Telegram

ПостHere are some tricky🧩 SQL interview questions!

8 июля 2026
P
Python Projects & Free Books
Here are some tricky🧩 SQL interview questions! 1. Find the second-highest salary in a table without using LIMIT or TOP. 2. Write a SQL query to find all employees who earn more than their managers. 3. Find the duplicate rows in a table without using GROUP BY. 4. Write a SQL query to find the top 10% of earners in a table. 5. Find the cumulative sum of a column in a table. 6. Write a SQL query to find all employees who have never taken a leave. 7. Find the difference between the current row and the next row in a table. 8. Write a SQL query to find all departments with more than one employee. 9. Find the maximum value of a column for each group without using GROUP BY. 10. Write a SQL query to find all employees who have taken more than 3 leaves in a month. These questions are designed to test your SQL skills, including your ability to write efficient queries, think creatively, and solve complex problems. Here are the answers to these questions: 1. SELECT MAX(salary) FROM table WHERE salary NOT IN (SELECT MAX(salary) FROM table) 2. SELECT e1.* FROM employees e1 JOIN employees e2 ON e1.manager_id = (link unavailable) WHERE e1.salary > e2.salary 3. SELECT * FROM table WHERE rowid IN (SELECT rowid FROM table GROUP BY column HAVING COUNT(*) > 1) 4. SELECT * FROM table WHERE salary > (SELECT PERCENTILE_CONT(0.9) WITHIN GROUP (ORDER BY salary) FROM table) 5. SELECT column, SUM(column) OVER (ORDER BY rowid) FROM table 6. SELECT * FROM employees WHERE id NOT IN (SELECT employee_id FROM leaves) 7. SELECT *, column - LEAD(column) OVER (ORDER BY rowid) FROM table 8. SELECT department FROM employees GROUP BY department HAVING COUNT(*) > 1 9. SELECT MAX(column) FROM table WHERE column NOT IN (SELECT MAX(column) FROM table GROUP BY group_column) Here you can find essential SQL Interview Resources👇 https://t.me/mysqldata Like this post if you need more 👍❤️ Hope it helps :)
6 · 2.7K ·

Рядом в ленте

PPython Projects & Free Books15 Best Project Ideas for Python : 🐍 🚀 Beginner Level: 1. Simple Calculator 2. To-Do List 3. Number Guessing Game 4. Dice Rolling Simulator 5. Word Counter 🌟 InPPython Projects & Free Books📊 𝗗𝗮𝘁𝗮 𝗔𝗻𝗮𝗹𝘆𝘁𝗶𝗰𝘀 𝗙𝗥𝗘𝗘 𝗖𝗲𝗿𝘁𝗶𝗳𝗶𝗰𝗮𝘁𝗶𝗼𝗻 𝗖𝗼𝘂𝗿𝘀𝗲𝘀 🚀 ✅ 100% FREE learning opportunities ✅ Great for students, freshers, and beginners ✅ Help you build a stronger resum
это сообщение
PPython Projects & Free BooksAaj hi ek certified Hackar bano!💻 Shuru se saari cheeze seekho bilkul basic se!! PW skills leke aaya h certified Ethical Hacking ka course!! Isme milega : ✅ HanPPython Projects & Free Books🔰 Comprehensions in python with example
PPython Projects & Free BooksPython Projects & Free Books@pythonfreebootcamp · канал · Технологии
40 695подписчиков1 176средний охват поста
Лента площадки Открыть в Telegram

Открытая публичная лента из поискового индекса ChatCrawler — «Google по публичному Telegram»; обновляется по мере обхода площадки. Время — UTC.

Только публичный контент, официальный API Telegram. О проекте · Вопросы · Чего мы не делаем · Убрать страницу из выдачи · Каталог · Поиск · Как мы считаем