Back to Browse

EY SQL Interview Question Solved Step-by-Step

681 views
Jan 28, 2025
10:09

In this video, we solve an advanced SQL question that involves using Common Table Expressions (CTEs), ROW_NUMBER(), and DENSE_RANK() to track consecutive attendance records. This type of question is common in EY (Ernst & Young) SQL interviews and helps you understand: ✅ How to use ROW_NUMBER() and DENSE_RANK() effectively. ✅ Grouping attendance periods with calculated differences (RN - DN). ✅ Finding consecutive attendance start and end dates with MIN() and MAX(). ✅ Writing efficient and optimized SQL queries. Whether you're preparing for EY interviews or want to master advanced SQL techniques, this video is packed with practical examples and explanations. 📢 Don’t forget to like, comment, and subscribe for more SQL tutorials and interview prep videos! . . . . #eyinterview #sqlinterview #sqlcte #rownumber #denserank #advancedsql #sqlqueries #databasemanagement #sqlskills #sqlinterviewprep #sqltutorial #digitalmarketer . . . . . --------------------------CREATE TABLE ---------------------------------------------------- CREATE TABLE ATTENDANCE (EMPLOYEE VARCHAR(10), DATES DATE, STATUS VARCHAR (20)) INSERT INTO ATTENDANCE VALUES('A1', '2024-01-01','PRESENT') INSERT INTO ATTENDANCE VALUES('A1', '2024-01-02','PRESENT') INSERT INTO ATTENDANCE VALUES('A1', '2024-01-03','PRESENT') INSERT INTO ATTENDANCE VALUES('A1', '2024-01-04','ABSENT') INSERT INTO ATTENDANCE VALUES('A1', '2024-01-05','PRESENT') INSERT INTO ATTENDANCE VALUES('A1', '2024-01-06','PRESENT') INSERT INTO ATTENDANCE VALUES('A1', '2024-01-07','ABSENT') INSERT INTO ATTENDANCE VALUES('A1', '2024-01-08','ABSENT') INSERT INTO ATTENDANCE VALUES('A1', '2024-01-09','ABSENT') INSERT INTO ATTENDANCE VALUES('A1', '2024-01-10','PRESENT') INSERT INTO ATTENDANCE VALUES('A2', '2024-01-11','PRESENT') INSERT INTO ATTENDANCE VALUES('A2', '2024-01-12','PRESENT') INSERT INTO ATTENDANCE VALUES('A2', '2024-01-13','ABSENT') INSERT INTO ATTENDANCE VALUES('A2', '2024-01-14','PRESENT') INSERT INTO ATTENDANCE VALUES('A2', '2024-01-15','ABSENT')

Download

1 formats

Video Formats

360pmp413.4 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

EY SQL Interview Question Solved Step-by-Step | NatokHD