 Hello, welcome to SS Unitech, so still decide and this is continuation of SQL Server interview questions and answers. So today we are going to discuss few more questions which was asked in FIS Global that is Fidelity. So one of my friend has attended interview with Fidelity and these questions was asked over there. So let's start with the questions. So here we have total 11 questions and that was the written exam in the FIS. So first question is select care index S from Ram Singh. So what would be the value for this? Second question, select case when null equals to null then one else zero and so what would be the output for this query? Next is select null union all then select null that is string then again union all then null so what would be the output for this query? Next is select sub string 1, 2, 3, 4, 5, 6, 7, 8 and 9 then care index x, y, z, a, b, c then z then comma 4 so what would be the output for this query? So here we have total 11 questions so let's move to SQL Server management studio so where we will check the output for these queries. As I am using SQL 2017 you may have another version of SQL Server. So first of all let me execute the first query like select care index and we want to S then Ram Singh. So what would be the output for this query? So in care index it will be going to search from the left side and get that character that is S and it will going to return the location of that character. So as we can see R, A, M then S so S is placed at 4th location so output should be 4 so as we can see 4. Next question so here we can see select case when null equals to null then 1 else 0. So in this case null cannot be equals to null like this if we want to compare null equals to null then we have to use null is null. Here it should be going to return as 0 so we can execute the query and we can check the output that is 0. Let's move to next question. So as we can see in this question select null then union all then select null in string then again union all then select null. So what would be the output for this query? So let me execute this query and we can check the output. So here we can see we are getting the null values here we can check the second null value. This is the string and first is the null and last is the null. Let's move to next question. So here as we can see in this question select substring 1, 2, 3, 4, 5, 7, 8, 9 then care index and here x, y, z, a, b, c, z. So as we can see if we will going to calculate the care index for this. So here this x, y, z, a, b, c is going to check inside this z that is not all able. So don't confuse about this because first what character we want to search and last from where we want to search in the care index. So we can execute and we can check the output for this. So that is 0 because x, y, z, a, b, c is not inside z. So it will start from 0 and will pick the 4 character. So we can execute and we can check the output. So it's going to written 1, 2 and 3. So this is the output but here don't confuse because here it is going to start from 0 and then 4 character. So 0 is the first character so here we don't have anything in the 0 then first, second and third. So we have 1, 2 and 3. That's why this is tricky question. Next is here we just want to get the left side 3 characters and right side 3 characters. So this is very simple query. So we can execute and we can see 1, 2, 3 and here 3, 2, 1. So this is the output. Next in this question as we can see stuff. So stuff function is going to put the stuff value from the specific position. So let me execute the query. So here as we can see we are getting FIS global, India limited. So as we can see it will be going to stuff India inside this string and starting position would be 12 and how many characters? It's 3. We can count the position of 12. So 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 and 12. So it will be going to put India instead of this PVT. So this is for stuff. So we are getting the output FIS global, India limited. Let's move to next question. In the seventh question as we can see it's going to replicate the value of XYZ 3 times. So we will get the output like XYZ, XYZ, XYZ. So let me execute and check the output. As we can see we are getting XYZ 3 times. So this is the output and this is very simple query. Here we just want to reverse the value of this 12, 3, 4, 3, 2, 1. If we will execute then we will get the same output because if we will reverse this string then it will be going to start from right side then 12, 3, 4, 3, 2, 1. So output would be 12, 3, 4, 3, 2, 1. Move to next question. So here as we can see we just want to replace ABC from XYZ and our input string is ABC, XYZ. So ABC should be replaced by XYZ. So in the output we will get XYZ, XYZ 2 times. So let me execute and check the output. So we are getting XYZ, XYZ. Move to next question. So this is the 10th question. So here as we can see we are having care index. So we want to find out IND inside this string that is FIS Global India Private Limited then again India and starting position should be 15. So first of all we need to move to 15th position and then we will search for IND. So 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15. So it will be going to start search from this position. So it is going to get the IND or this position. So now it is going to return the position of IND which is present after the limited. So we can count and that would be the output. So 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27. So output should be 27. So let me execute the query and check the output. So this is 27. So this is the output. Let's move to last question. So that is the last question. As we can see we just want to search out for PAT index. And inside this PAT index what is the searching value that is again India and then we can check FIS Global India Private Limited again India. So it will be going to search from the left side and return the first occurrence of IND. So that is available in this first India. So 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 that output should be 12. So we can execute and we are getting 12. So this is the output for PAT index. So these are the questions asked in FIS. So thank you so much for watching this video. If you like this video please subscribe our channel to get many more videos. Don't forget to press the bell icon to get the notification of our newly uploaded videos. Thank you so much.