 Hello, welcome to SSUnitex Social Decide and this is continuation of PySpark tutorial. So in this video we are going to see about the greatest and max function. As per the today's agenda first we will see about the greatest and then we will see about the max. So what is the greatest function? So in PySpark SQL function greatest method return the maximum value each row in specified columns and it should be having at least two or more than two columns and second is the max. So max function can be used to return the maximum value in a single column. So as we can see in this data set if we want to check the maximum value on the row wise. So like in math, physics and chemistry if we want to check the maximum between the rows like what will be the maximum value on this row that is 90. So if you want to check the maximum value between the rows then we should be going to use the greatest function. If we want to check the maximum value on the particular column then we have to use the max function. So this is the only difference between greatest and the max function. So as per your requirement we can use max or the greatest function. So let me quickly go inside the browser and we will try to understand in practical. So here let me try to create this data frame. It is having the same data set as we have seen in slide. So first is the name column then math, physics and chemistry. Now the requirement is we are going to use the maximum on the row wise as well as maximum on the total marks column. So let me use the max function first. So let me use df. I am going to select and after that first let me try to add the value for these three columns for getting the total marks. So for that we can use df.math plus df.physics plus df.chemistry. Let me try to execute this and we will see the output of. So let me use the display function for checking the output. So here we can see it is having a single column for the total marks and here we could use the max function. So inside this select we can simply use the max function and let me execute. So what it will be returning it is turning 272. It means the total marks that we are having 272 between these three employees. So we are checking the total marks on that particular column. Then let me use the greatest function. So df. I am going to use select and here I am going to select all the column first. Then let me use the greatest function and inside the greatest function here we are required to specify the columns by which we need to check the maximum. So the first column that is the math then the second column that is the physics and third column that is the chemistry. Let me try to use the display function. Let me execute it. So we will see the greatest value between these three. So the greatest is physics that is 90 we can see here and here for chemistry 93 we can see here and here again 91 for Sundeha it is coming like this. So according to our need we can use this. So I hope guys you have understood about the greatest and max function. So thank you so much for watching this video. See you in the next video.