String MAKE_SET() function
Last Updated : 17 Mar 2025
MAKE_SET(bits,str1,str2,...) is a String function of MySQL. This method returns values from set for the given bit.
Syntax
Example 1
Explanation: On execution of the above statement, the make_set function is used to converts the 'bits' value to binary. The binary value of 1 is 1.
Output: The output of this example is given below.

Example 2
Explanation: On execution of the above statement, the make_set function is used to converts the 'bits' value to binary. The binary value of 3 is 11.
Output: The output of this example is given below.

Example 3
Explanation: On execution of the above statement, the make_set function is used to convert the 'bits' value to binary. The binary value of 1 is 001, where the rightmost digit is 1. Therefore, it returns 'apple'. The second bit is 4, i.e., 100, and the third position is 1, so it returns 'grapes'.
Output: The output of this example is given below.

Example 4
Explanation: On execution of the above statement, the make_set function is used to convert the 'bits' value to binary. The binary value of 4, i.e., 100, and the third position is 1, so it returns 'grapes'.
Output: The output of this example is given below.

Using the MySQL MAKE_SET() function in a Table column
We can use the MAKE_SET() function in a table is used to used to convert the 'bits' value to binary value in a given column. Follow the steps below to perform the MySQL MAKE_SET() functionality in a column of the table.
Step 1: First, create a table named EMP_INFO using the CREATE TABLE statement.
Step 2: After that INSERT data into a table using the INSERT TABLE statement.
Step 3: To check the information with the use of SELECT statement, whether the data is inserted or not.
| ID | Name | Address | Department | Salary | Phone |
|---|---|---|---|---|---|
| 1 | Anjana | Islam Ganj Ludhiana | Purchase | 30000 | 9878453481 |
| 2 | Priyanka | Anderhi East WestBengal | Sales | 40000 | 8673193472 |
| 3 | Bobby | Golden Temple Amritsar | Marketing | 34000 | 8154538525 |
| 4 | Alisha | Siliguri WestBengal | Finance | 35000 | 9378753481 |
| 5 | Eshant | Phase 10 Mohali | HR | 40000 | 9878253481 |
Example:
Output: The output of this example is given below.
| ID | Name | Address | Department | Salary | Phone | Result |
|---|---|---|---|---|---|---|
| 1 | Anjana | Islam Ganj Ludhiana | Purchase | 30000 | 9878453481 | Islam |
| 2 | Priyanka | Anderhi East WestBengal | Sales | 40000 | 8673193472 | Anderhi |
| 3 | Bobby | Golden Temple Amritsar | Marketing | 34000 | 8154538525 | Golden |
| 4 | Alisha | Siliguri WestBengal | Finance | 35000 | 9378753481 | Siliguri |
| 5 | Eshant | Phase 10 Mohali | HR | 40000 | 9878253481 | Phase |
Frequently Asked Questions on MySQL MAKE_SET Function
1. What are the features of MySQL MAKE_SET Function?
Answer: Following are the features of MySQL MAKE_SET Function are given below.
- This function is used to create a string set representation based on a set of bit values.
- It can be used to convert bit values into a more readable and manageable string format.
Next TopicMySQL String