TGViewer
SQL Programming Resources SQL Programming Resources @sqlanalyst · 76.7K subscribers
Post #2385 4.45K
✅ Basic SQL Queries Interview Questions With Answers 🖥️

1. What does SELECT do
– SELECT fetches data from a table
– You choose columns you want to see
Example: SELECT name, salary FROM employees;

2. What does FROM do
– FROM tells SQL where data lives
– It specifies the table name
Example: SELECT * FROM customers;

3. What is WHERE clause
– WHERE filters rows
– It runs before aggregation
Example: SELECT * FROM orders WHERE status = 'Delivered';

4. Difference between WHERE and HAVING
– WHERE filters rows before GROUP BY
– HAVING filters groups after aggregation
Example: WHERE filters orders, HAVING filters total_sales

5. How do you sort data
– Use ORDER BY
– Default order is ASC
Example: SELECT * FROM employees ORDER BY salary DESC;

6. How do you sort by multiple columns
– SQL sorts left to right
Example: SELECT * FROM students ORDER BY class ASC, marks DESC;

7. What is LIMIT
– LIMIT restricts number of rows returned
– Useful for top N queries
Example: SELECT * FROM products LIMIT 5;

8. What is OFFSET
– OFFSET skips rows
– Used with LIMIT for pagination
Example: SELECT * FROM products LIMIT 5 OFFSET 10;

9. How do you filter on multiple conditions
– Use AND, OR
Example: SELECT * FROM users WHERE city = 'Delhi' AND age > 25;

10. Difference between AND and OR
– AND needs all conditions true
– OR needs one condition true

Quick interview advice
• Always say execution order: FROM → WHERE → SELECT → ORDER BY → LIMIT
• Write clean examples
• Speak logic first, syntax next¹

Double Tap ❤️ For More
  • ❤ 8
More from @sqlanalyst
  1. Oct 12, 2026SQL Interview Series — Part 6 📌 Question 6: Find the Top 2 Highest-Paid Employees in Each…
  2. Oct 12, 2026🚀 𝗪𝗵𝗶𝗰𝗵 𝗧𝗲𝗰𝗵 𝗦𝗸𝗶𝗹𝗹 𝗪𝗶𝗹𝗹 𝗬𝗼𝘂 𝗠𝗮𝘀𝘁𝗲𝗿 𝗶𝗻 𝟮𝟬𝟮𝟲? Want to buil…
  3. Oct 9, 2026SQL Interview Series — Part 5 📌 Question 5: Find Employees Who Earn More Than Their Manag…
  4. Oct 9, 2026🇮🇳 𝗚𝗢𝗩𝗘𝗥𝗡𝗠𝗘𝗡𝗧 𝗢𝗙 𝗜𝗡𝗗𝗜𝗔 — 𝗔𝗜𝗖𝗧𝗘 𝗜𝗡𝗧𝗘𝗥𝗡𝗦𝗛𝗜𝗣𝗦 𝟮𝟬𝟮𝟲 🚀…
  5. Oct 8, 2026🎓 𝗠𝗶𝗰𝗿𝗼𝘀𝗼𝗳𝘁 𝗙𝗥𝗘𝗘 𝗖𝗼𝘂𝗿𝘀𝗲𝘀 𝘄𝗶𝘁𝗵 𝗖𝗲𝗿𝘁𝗶𝗳𝗶𝗰𝗮𝘁𝗲𝘀! 🚀🔥 Upgr…
  6. Oct 7, 2026🚀𝗣𝗮𝘆 𝗔𝗳𝘁𝗲𝗿 𝗣𝗹𝗮𝗰𝗲𝗺𝗲𝗻𝘁 𝗧𝗿𝗮𝗶𝗻𝗶𝗻𝗴 | 𝗕𝗲𝗰𝗼𝗺𝗲 𝗮 𝗙𝘂𝗹𝗹𝘀𝘁𝗮𝗰…
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 →