Uploaded August 2026 | Updated September 2026, 2 weeks ago
πΉNotes: gatesmashers.com/resources/sql-interview-questions
Complete SQL Roadmap π: gatesmashers.com/roadmaps/dbms-sql
00:00 Q-1: Write a query to display all Engineering employees ordered by salary from highest to lowest.
05:40 Q-2: Write a query to find the number of employees in each department.
08:50 Q-3: Write a query to find the second-highest distinct salary.
11:02 Q-4: Write a query to find employees earning more than the company average salary.
11:56 Q-5: Write a query to find the highest salary in each department.
13:55 Q-6: Write a query to find employees whose salary is higher than their manager salary.
17:31 Q-7: Write a query to display each order with the customer name.
19:50 Q-8: Write a query to find customers who have never placed an order.
21:43 Q-9: Write a query to find customers who placed more than one order.
24:28 Q-10: Write a query to find the highest-spending customer based only on delivered orders.
26:36 Q-11: TRUNCATE vs DELETE β Remove all rows quickly while keeping the table.
28:15 Q-12: GRANT SELECT β Give an intern read-only access to the Employees table.
30:05 Q-13: SQL Logical Execution Order β Why can't SELECT aliases be used in WHERE?
31:55 Q-14: ROW_NUMBER() vs RANK() vs DENSE_RANK()
33:50 Q-15: COUNT(*) vs COUNT(email) vs COUNT(DISTINCT email)
35:54 Q-16: COALESCE() β Return the first available non-NULL value.
38:06 Q-17: LAG() β Find each user's previous login date.
42:45 Q-18: CASE β Classify employees into Low, Medium, and High salary bands.
43:45 Q-19: NULLIF() β Prevent divide-by-zero errors.
45:22 Q-20: Delete duplicate records while keeping the newest record for each email.
π MASTER COMPUTER SCIENCE | INTERVIEWS | EXAMS
Gate Smashers β Learn Computer Science through free lectures, structured playlists, interview resources, important questions, notes & exam preparation. π»π
π FREE CS RESOURCES & INTERVIEW PREPARATION : gatesmashers.com
ββββββββββββββββββββββ
π SUBJECT-WISE COMPUTER SCIENCE PLAYLISTS
βΊ Placement Interview Questions: youtube.com/playlist?list=PLUDPUBNI7KL4
βΊ System Design: youtube.com/playlist?list=PLxCzCOWd7aiHanm1nA5_fMwbx5dCNFkDX
βΊ Deep Learning: youtube.com/playlist?list=PLxCzCOWd7aiHQ9Qyo70JCTkTxczPnVC6s
βΊ Machine Learning:
youtube.com/playlist?list=PLxCzCOWd7aiEXg5BV10k9THtjnS48yI-T&si=qPGIoiBrziIFs6CJ
βΊ Design and Analysis of Algorithms (DAA): youtube.com/playlist?list=PLxCzCOWd7aiHcmS4i14bI0VrMbZTUvlTa
βΊ Software Engineering: youtube.com/playlist?list=PLxCzCOWd7aiEed7SKZBnC6ypFDWYLRvB2
βΊ Database Management System (DBMS): youtube.com/playlist?list=PLxCzCOWd7aiFAN6I8CuViBuCdJgiOkT2Y
βΊ Cloud Computing: youtube.com/playlist?list=PLxCzCOWd7aiHRHVUtR-O52MsrdUSrzuy4
βΊ Theory of Computation (TOC): youtube.com/playlist?list=PLxCzCOWd7aiFM9Lj5G9G_76adtyb4ef7i
βΊ Artificial Intelligence: youtube.com/playlist?list=PLxCzCOWd7aiHGhOHV-nwb0HR5US5GFKFI
βΊ Computer Networks (CN): youtube.com/playlist?list=PLxCzCOWd7aiGFBD2-2joCpWOLUrDLvVV_
βΊ Operating System (OS): youtube.com/playlist?list=PLxCzCOWd7aiGz9donHRrE9I3Mwn6XdP8p
βΊ Structured Query Language (SQL): youtube.com/playlist?list=PLxCzCOWd7aiHqU4HKL7-SITyuSIcD93id
βΊ Discrete Mathematics: youtube.com/playlist?list=PLxCzCOWd7aiH2wwES9vPWsEL6ipTaUSl3
βΊ Compiler Design: youtube.com/playlist?list=PLxCzCOWd7aiEKtKSIHYusizkESC42diyc
βΊ Number System: youtube.com/playlist?list=PLxCzCOWd7aiFOet6KEEqDff1aXEGLdUzn
βΊ Programming in C: youtube.com/playlist?list=PLxCzCOWd7aiGmiGl_DOuRMJYG8tOVuapB
βΊ Data Structures: youtube.com/playlist?list=PLxCzCOWd7aiEwaANNt3OqJPVIxwp2ebiT
βΊ Computer Architecture: youtube.com/playlist?list=PLxCzCOWd7aiHMonh3G6QNKq53C6oNXGrX
βΊ Graph Theory: youtube.com/playlist?list=PLxCzCOWd7aiG0M5FqjyoqB20Edk0tyzVt
βΊ Digital Logic: youtube.com/playlist?list=PLxCzCOWd7aiGmXg4NoX6R31AsC5LeCPHe
ββββββββββββββββββββββ
π CONNECT WITH GATE SMASHERS
βΊ Website: gatesmashers.com
βΊ YouTube: youtube.com/gatesmashers
βΊ Instagram: instagram.com/gate.smashers
βΊ Telegram: https://t.me/gatesmashersofficial
βΊ Facebook: facebook.com/gatesmashers
βΊ Threads: threads.net/@gate.smashers
GsetGo
βΊ YouTube: youtube.com/@GSetgoofficial
βΊ Instagram: instagram.com/gsetgo_
VarunNainaShots
βΊ YouTube: youtube.com/@varunainashots
βΊ Instagram: instagram.com/varunainashots
ββββββββββββββββββββββ
Subscribe to Gate Smashers and start your Computer Science learning journey today! ππ»
πΉNotes: gatesmashers.com/resources/sql-interview-questions
Complete SQL Roadmap π: gatesmashers.com/roadmaps/dbms-sql
00:00 Q-1: Write a query to display all Engineering employees ordered by salary from highest to lowest.
05:40 Q-2: Write a query to find the number of employees in each department.
08:50 Q-3: Write a query to find the second-highest distinct salary.
11:02 Q-4: Write a query to find employees earning more than the company average salary.
11:56 Q-5: Write a query to find the highest salary in each department.
13:55 Q-6: Write a query to find employees whose salary is higher than their manager salary.
17:31 Q-7: Write a query to display each order with the customer name.
19:50 Q-8: Write a query to find customers who have never placed an order.
21:43 Q-9: Write a query to find customers who placed more than one order.
24:28 Q-10: Write a query to find the highest-spending customer based only on delivered orders.
26:36 Q-11: TRUNCATE vs DELETE β Remove all rows quickly while keeping the table.
28:15 Q-12: GRANT SELECT β Give an intern read-only access to the Employees table.
30:05 Q-13: SQL Logical Execution Order β Why can't SELECT aliases be used in WHERE?
31:55 Q-14: ROW_NUMBER() vs RANK() vs DENSE_RANK()
33:50 Q-15: COUNT(*) vs COUNT(email) vs COUNT(DISTINCT email)
35:54 Q-16: COALESCE() β Return the first available non-NULL value.
38:06 Q-17: LAG() β Find each user's previous login date.
42:45 Q-18: CASE β Classify employees into Low, Medium, and High salary bands.
43:45 Q-19: NULLIF() β Prevent divide-by-zero errors.
45:22 Q-20: Delete duplicate records while keeping the newest record for each email.
π MASTER COMPUTER SCIENCE | INTERVIEWS | EXAMS
Gate Smashers β Learn Computer Science through free lectures, structured playlists, interview resources, important questions, notes & exam preparation. π»π
π FREE CS RESOURCES & INTERVIEW PREPARATION : gatesmashers.com
ββββββββββββββββββββββ
π SUBJECT-WISE COMPUTER SCIENCE PLAYLISTS
βΊ Placement Interview Questions: youtube.com/playlist?list=PLUDPUBNI7KL4
βΊ System Design: youtube.com/playlist?list=PLxCzCOWd7aiHanm1nA5_fMwbx5dCNFkDX
βΊ Deep Learning: youtube.com/playlist?list=PLxCzCOWd7aiHQ9Qyo70JCTkTxczPnVC6s
βΊ Machine Learning:
youtube.com/playlist?list=PLxCzCOWd7aiEXg5BV10k9THtjnS48yI-T&si=qPGIoiBrziIFs6CJ
βΊ Design and Analysis of Algorithms (DAA): youtube.com/playlist?list=PLxCzCOWd7aiHcmS4i14bI0VrMbZTUvlTa
βΊ Software Engineering: youtube.com/playlist?list=PLxCzCOWd7aiEed7SKZBnC6ypFDWYLRvB2
βΊ Database Management System (DBMS): youtube.com/playlist?list=PLxCzCOWd7aiFAN6I8CuViBuCdJgiOkT2Y
βΊ Cloud Computing: youtube.com/playlist?list=PLxCzCOWd7aiHRHVUtR-O52MsrdUSrzuy4
βΊ Theory of Computation (TOC): youtube.com/playlist?list=PLxCzCOWd7aiFM9Lj5G9G_76adtyb4ef7i
βΊ Artificial Intelligence: youtube.com/playlist?list=PLxCzCOWd7aiHGhOHV-nwb0HR5US5GFKFI
βΊ Computer Networks (CN): youtube.com/playlist?list=PLxCzCOWd7aiGFBD2-2joCpWOLUrDLvVV_
βΊ Operating System (OS): youtube.com/playlist?list=PLxCzCOWd7aiGz9donHRrE9I3Mwn6XdP8p
βΊ Structured Query Language (SQL): youtube.com/playlist?list=PLxCzCOWd7aiHqU4HKL7-SITyuSIcD93id
βΊ Discrete Mathematics: youtube.com/playlist?list=PLxCzCOWd7aiH2wwES9vPWsEL6ipTaUSl3
βΊ Compiler Design: youtube.com/playlist?list=PLxCzCOWd7aiEKtKSIHYusizkESC42diyc
βΊ Number System: youtube.com/playlist?list=PLxCzCOWd7aiFOet6KEEqDff1aXEGLdUzn
βΊ Programming in C: youtube.com/playlist?list=PLxCzCOWd7aiGmiGl_DOuRMJYG8tOVuapB
βΊ Data Structures: youtube.com/playlist?list=PLxCzCOWd7aiEwaANNt3OqJPVIxwp2ebiT
βΊ Computer Architecture: youtube.com/playlist?list=PLxCzCOWd7aiHMonh3G6QNKq53C6oNXGrX
βΊ Graph Theory: youtube.com/playlist?list=PLxCzCOWd7aiG0M5FqjyoqB20Edk0tyzVt
βΊ Digital Logic: youtube.com/playlist?list=PLxCzCOWd7aiGmXg4NoX6R31AsC5LeCPHe
ββββββββββββββββββββββ
π CONNECT WITH GATE SMASHERS
βΊ Website: gatesmashers.com
βΊ YouTube: youtube.com/gatesmashers
βΊ Instagram: instagram.com/gate.smashers
βΊ Telegram: https://t.me/gatesmashersofficial
βΊ Facebook: facebook.com/gatesmashers
βΊ Threads: threads.net/@gate.smashers
GsetGo
βΊ YouTube: youtube.com/@GSetgoofficial
βΊ Instagram: instagram.com/gsetgo_
VarunNainaShots
βΊ YouTube: youtube.com/@varunainashots
βΊ Instagram: instagram.com/varunainashots
ββββββββββββββββββββββ
Subscribe to Gate Smashers and start your Computer Science learning journey today! ππ»










