 Hello everyone, today we have another important topic which is like mostly asked a scale questions in the recent interviews and which you might get in your next interview, so it is one or two right. So without any further ado, let's get into the topic. First question will be the finding nth highest salary or nth highest marks or something like that. So basically you have to find nth highest row from a table based on a specific column. So here the column is a salary column. So there are multiple ways you can solve this question or like write this query. So I listed two ways here using one is the dense rank function and the other one is the limit class. So dense rank will work across the databases like MySQL, SQL Server and for RKL. But the limit class we it's not available in like RKL database right. So I think this is useful in only MySQL case but if you want to write a generic query then you can write the first one. So the second question is like subset of the first one. So basically here we have to find the second highest salary of employee. So if you go to the first question here you can see nth highest right. So if you replace this n with 2 then this will be our second question right. So in this first query you can put 2 in place of ampersand n then we got our answer. But if you want to write a specific query for this question then you can write this way. Basically you have to select the max salary which is not in the max salary of the employee. So this might be a bit confusing but let me clear that out for you. So first what we are doing in this condition query is we are selecting the max salary of the employee from the table and from the outer query left side we are actually skipping that one. So basically we are skipping the highest salary so that we get second highest in the result. And the same with second query also but instead of not in class we are using less than operator. And third one is using a limit statement as I said which is not available in all the databases. So you can stick to any like one of these first two. The third question is about like how to show max and min marks together from a student table. This is a simple query that's why I didn't put the answer here. This is you can use max and min a great function right and fourth one is how to do fetch details of duplicate records from a table. So you can use having the class combining with the count function then you will get duplicate records. If whatever first you have to use group by operator on name and then using count if it is greater than one then you have multiple rows which are like having same name. And the fifth one is a query to find year from a date, year or month or date anything like that. So this is easy you can use year function or extract function to get whatever field date or month or year from a date object. And this one is looks big but this is very simple the summary of this question is basically like list all the students who has like got marks more than average of that class. So basically you have to select average in the condition query and we have to apply that on max, marks greater than average of that class. So that is easy so let's go to next question which is this is like simple question and this is very old question so people might not ask this one but some some companies will ask one or two companies. So this is basically we store employee information and manager information everything in a single table right because manager also an employee. Further we have to select manager to select manager right we have to apply condition on manager column of employee. So manager equal to employee number then that guy is the manager. So this condition is very important selecting this query because we applied the join also right. So because for employee reference we used E and for manager reference we used M and this is another important question where user can enter any value like after letters, small letters or combination of both but while selecting you have to select properly. So using upper or lower functions you can first convert the case of whatever user entered text to specific lower or upper case and then apply like operator on that case. For example I selected upper life. So I gave value here as a capital if you put lower here then you have to put join small letters. And the ninth question is this is simple but logical right so basically you have to group by all the genders from a table then we have to apply a conditional data like between 1960 to 1975 how many people are there based on according to gender. So first I have to select count of that gender and gender and group by gender and the date between data birth between these two. The tenth one is find max salary from each department this is very again like very common and very old position. So basically you have to select the department ID and max salary where you have to group by department ID. So yeah apart from this there are like some other questions also I listed out in the like one article I will be putting a link in description below right you can follow if you want to know more. So that's it for today. Thanks guys please subscribe to us and we will be posting like new content every week and follow us thank you.