RPAD() Function in MySQL Last Updated : 21 Jun, 2021 Comments Improve Suggest changes Like Article Like Report RPAD() function in MySQL is used to pad or add a string to the right side of the original string. Syntax : RPAD(str, len, padstr) Parameter : This function accepts three parameter as mentioned above and described below : str : The actual string which is to be padded. If the length of the original string is larger than the len parameter, this function removes the overfloating characters from string. len : This is the length of a final string after the right padding. padstr : String that to be added to the right side of the Original Str. Returns : It returns a new string of length len after padding. Example-1 : Applying RPAD() Function to a string to get a new padded string. SELECT RPAD("geeksforgeeks", 20, "*") AS RightPaddedString; Output : RightPaddedStringgeeksforgeeks******* Example-2 : Applying RPAD() Function to a string when the original string is larger than the len parameter. SELECT RPAD("geeksforgeeks", 10, "*") AS RightPaddedString; Output : RightPaddedStringgeeksforge Example-3 : Applying RPAD() Function to a string column in a table : Table - Student_Details : Student_IdNameMarks1Tarun Saha4302Nilima Mondal4253Sanya Jain4504Amit Sharma460 SELECT RPAD(Name, 15, "#") AS RightPadStudentName FROM Student_Details; Output : RightPadStudentNameTarun Saha#####Nilima Mondal##Sanya Jain#####Amit Sharma#### Comment More infoAdvertise with us Next Article RPAD() Function in MySQL jana_sayantan Follow Improve Article Tags : DBMS SQL mysql Similar Reads RAND() Function in MySQL The RAND() function in MySQL is used to a return random floating-point value V in the range 0 <= V < 1.0. If we want to obtain a random integer R in the range i <= R < j, we have to use the expression : FLOOR(i + RAND() * (j â i)). Syntax : RAND(N) Parameter : This method accepts only on 3 min read ORD() Function in MySQL ORD() function in MySQL is used to find the code of the leftmost character in a string . If the leftmost character is not a multibyte character, it returns ASCII value. And if the leftmost character of the string str is a multibyte character, ORD returns the code for that character, calculated from 3 min read ROUND() Function in MySQL The ROUND() function in MySQL is used to round a number to a specified number of decimal places. If no specified number of decimal places is provided for round-off, it rounds off the number to the nearest integer. Syntax ROUND(X, D) Parameter Explanation This method accepts two parameters in the syn 2 min read REPLACE() Function in MySQL The REPLACE() function in MySQL is a powerful tool for string manipulation, allowing users to substitute specific substrings within a larger string. This functionality is particularly useful in various applications such as updating text data, cleaning up input or adjusting content in a database. In 3 min read SPACE() Function in MySQL SPACE() function in MySQL is used to return a string consisting of specified empty space characters. Syntax : SPACE(num) Parameter : This method accepts one parameter as mentioned above and described below : num : It is an integer which indicates how many spaces are being contained. Returns : It ret 1 min read RADIANS() Function in MySQL RADIANS() function in MySQL is used to convert the degree values into radians. The formula for converting degree to radian is : 180 degrees = Ï radian Syntax : RADIANS(X) Parameter : This method accepts only one parameter. X : The degree value which we convert to radian. Returns : It returns equival 2 min read TAN() Function in MySQL TAN() function : This function in MySQL is used to return the tangent of a specified number. In any right triangle, the tangent of an angle is the length of the opposite side divided by the length of the adjacent side. Similarly, this can also be defined as tangent of x is the sine of x divided by t 1 min read STRCMP() Function in MySQL STRCMP() function in MySQL is used to compare two strings. If both of the strings are same then it returns 0, if the first argument is smaller than the second according to the defined order it returns -1 and it returns 1 when the second one is smaller the first one. Syntax : STRCMP(Str1, Str2) Param 3 min read SQRT() Function in MySQL The SQRT() function in MySQL calculates the square root of a non-negative number, returning NULL for negative inputs. It is a built-in function that provides high precision and is optimized for performance and making it ideal for mathematical and scientific applications.In the article, we will cover 3 min read TRIM() Function in MySQL TRIM() function in MySQL is used to clean up data. It is also used to remove the unwanted leading and trailing characters in a string. Syntax : TRIM([{BOTH | LEADING | TRAILING} [remstr] FROM] str) Parameter : This method accepts three-parameter as mentioned above and described below : BOTH | LEADIN 2 min read Like