 Hello, welcome to SSUniTech. So, see this side and this is continuation of sequence of interview questions and answers. So, today we are going to discuss about these three questions. So, one of my friend has attended interview in Optum that is united health group. So, these questions was asked over there. So, in this video we will discuss about these three questions and in the next video we will also discuss few questions which was asked in Optum. So, first question is write one single update statement to update all the null values to 10. So, as we can see we have input table and it has two columns first is A and second is B. So, column A is having two null values and column B is having three null values. So, we just want to update all these null values which is available in column A and column B in a single update statement to 10. In the next question what will be the value of at the rate at the rate row count variable after the update statement as we can see we are having total five null values. So, will the output of this at the rate at the rate row count variable would be five or three because null values are available only in three rows. Next is what would be the output of the following query. So, here as we can see we are having select sum of A plus B from the table. So, these three questions we will see in practical. So, first of all I would like to discuss about the third question that is select sum of A plus B from the table. So, let's move to SQL Server Management Studio to see in practical. As I am using SQL 2017 you may have another version of SQL Server. So, first of all let me execute the create table statement to create the table. So, command completed successfully. So, table has been created successfully. Now, let me execute this insert statement to insert the data into the table. So, as we can see 10 rows affected. So, data have been inserted successfully into the table. Now, let me check the data. So, we can execute this select a stick from the table. So, here we can check the data. So, we are having all the data from the column A and column B which was a label in the slide. So, first of all I would like to check the data which is a label in the column A and in the column B. So, we can use the sum of A and where A is not null. Now, we can execute. So, here we can see we are getting 24. So, sum of this is 24. Now, we need to check for B. So, here we can see and this time sum of B and where B is not null. Now, let me execute this statement and here we can see we are getting 30. So, total sum should be 54 but seen practical. So, select from table and then sum of A plus B. So, this is the question. Now, let me execute and we just want to check the output. So, as we can see we are getting 51 only and in column A we are having 24 and in column B we are having 30. So, why we are getting this 51 instead of 54? So, we can check the data which is available in the table. So, select A stick from table. Now, let me execute these two statements. So, as we can see here we are having null value in the column B and in column A we are having 53. So, if we will add anything with the null then that value will be null and if we are going to use the aggregate functions then null value is skipped. That's why we are getting 51 instead of 54 and rest of null values are null in the column A and column B both. That's why we are getting 51. So, this is the third question. Now, I just want to write a update statement to update the columns which is null in A and B. Now, let me write the update statement. So, update then we want to update the table is optimum part 1 then set and here we just want to update A and we also want to update B and in the where condition what will be the where condition? So, A is null or B is null. So, if A is null or B is null then we want to update. So, what will be the value in column A? That should be 10 but directly we can't update because if we will update then if any null value is available in B and A doesn't have the null value for the same row then that will be updated in the both. That's why here we need to check. So, we can write the case when A is null then we just want to get 10 then in the else we just want A and and now this is for A same thing we need to do for B as well. So, we can see for B. So, this would be for B and here B. So, this is the update statement by which we can update all the values which is null in column A and column B at the same time and we just want to also check the at the rate at the rate row count variable value. So, we can use at the rate at the rate row count. Now, we can execute these two statements first for the updating rows which is null in the table and second for checking the at the rate at the rate row count. So, we can execute and we can check. Go to one messages tab. So, three rows affected. So, data have been updated successfully which was null and one was affected for the row count. So, as we can see row count value is three. Let me check the table which is updated successfully or not. So, let me execute this selected statement. So, here we can see firstly it was null and these four values was null. So, now we are having 10 instead of null. Go to one slide and here we can see for the at the rate at the rate row count variable which is three because here we are having only three rows. We are going to update five null values but total number of rows is three. That's why at the rate at the rate row count variable is going to return three. So, I hope you have understand how we can resolve these three problems. In the next video, we will also discuss few more questions which was asked in Optum. 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. If you need this script, it will be available on the description of this video. So, you can copy from there. Thank you so much.