A Beautiful SQL Question from My Business Analyst Interview
2 min readMay 2, 2024
I was asked this sql question in the interview for the business analyst role.
There is a table named attendance with columns id, date, and present.
present: This column has the value of either 1 or 0, 1 represents present, and 0 represents absent.
In CTE y you can find what is discussed in step 2.
In CTE z and CTE a you can find what is discussed in step 3.
Here is the final Query and it’s result.