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#### Create Quiz Comment J jana_sayantan Follow 0 Improve J jana_sayantan Follow 0 Improve Article Tags : MySQL mysql Explore MySQL BasicsWhat is MySQL?5 min readMySQL DATE Data Type2 min readHow to Install MySQL on Windows?4 min readHow to Install MySQL on Linux?5 min readHow to Install MySQL on macOS?5 min readHow to Install MySQL on Fedora?5 min readHow to Install SQL Workbench For MySQL on Windows?5 min readHow to Install MySQL WorkBench on Ubuntu?3 min readHow to Install SQL Workbench For MySQL on Linux?2 min readConnecting to MySQL Using Command Options3 min readJava Database Connectivity with MySQL2 min readConnect MySQL database using MySQL-Connector Python2 min readHow to make a connection with MySQL server using PHP ?3 min readHow to Connect to Mysql Server Using VS Code and Fix errors?4 min readHow to Connect Node.js Application to MySQL ?2 min readMySQL User ManagementMySQL CREATE USER Statement4 min readMySQL | DROP USER3 min readMySQL | USER( ) Function3 min readMySQL | Change User Password3 min readMySQL Managing DatabasesMySQL Create Database Statement4 min readMySQL Drop Database3 min readPython MySQL - Create Database2 min readNodeJS MySQL Create Database2 min readMySQL Managing TablesMySQL CREATE TABLE4 min readMySQL RENAME TABLE Statement5 min readMySQL Temporary Table5 min readDrop Multiple Tables in MySQL3 min readInserting data into a new column of an already existing table in MySQL using Python2 min readPython: MySQL Create Table3 min readPHP | MySQL ( Creating Table )3 min readNode.js MySQL Create Table2 min readCreate Table From CSV in MySQL3 min readNode.js MySQL Drop Table2 min readPython MySQL - Drop Table2 min readHow to Rename a MySQL Table in Python?3 min readMySQL QueryNested Select Statement in MySQL5 min readMySQL DISTINCT Clause4 min readINSERT() function in MySQL2 min readMySQL Derived Table5 min readMySQL Insert Multiple Rows5 min readMySQL INSERT INTO SELECT Statement5 min readMySQL INSERT ON DUPLICATE KEY UPDATE Statement3 min readMySQL Insert Date Time4 min readMySQL UPDATE Statement6 min readMySQL DELETE Statement6 min readHow to Delete Duplicate Rows in MySQL?4 min readMySQL - ON DELETE CASCADE Constraint3 min readTruncate All Tables in MySQL2 min readPHP | Inserting into MySQL database6 min readPython MySQL - Update Query2 min readPHP | MySQL UPDATE Query2 min readNode.js MySQL Update Statement2 min readMySQL ClausesMySQL WHERE Clause5 min readMySQL ORDER BY Clause5 min readMySQL | PARTITION BY Clause2 min readQueries using AND ,OR ,NOT operators in MySQL2 min readMySQL EXISTS Operator6 min readMySQL Aggregate FunctionsCOUNT() Function in MySQL3 min readSUM() Function in MySQL4 min readAVG() Function in MySQL2 min readMySQL Data ConstraintsMySQL NOT NULL Constraint4 min readMySQL Primary Key4 min readMySQL FOREIGN KEY Constraint7 min readMySQL COMPOSITE KEY4 min readMySQL UNIQUE Constraint4 min readMySQL DEFAULT Constraint3 min readMySQL Joining DataMySQL Inner Join7 min readMySQL LEFT JOIN5 min readMySQL RIGHT JOIN5 min readMySQL SELF JOIN5 min readMySQL CROSS JOIN5 min readMySQL UPDATE JOIN6 min readMySQL DELETE JOIN4 min readMySQL | Recursive CTE (Common Table Expressions)5 min readMySQL FunctionsDATE() in MySQL2 min readTRUNCATE() Function in MySQL6 min readMathematical functions in MySQL3 min readMySQL | CONVERT( ) Function2 min readLTRIM() Function in MySQL2 min readUCASE() or UPPER() Function in MySQL1 min readRTRIM() Function in MySQL3 min readMySQL ISNULL( ) Function2 min readIFNULL in MySQL1 min readMySQL CASE() Function4 min readMySQL | CAST( ) Function3 min readMYSQL View11 min read Like