Skip to content

SET

SET @name = 'John Doe';
SELECT @name;
+-----------+
| @name |
+-----------+
| John Doe |
+-----------+

The SET command in the SQL statement is used to assign a value to the variable @name. The SELECT command is then executed to display the value of the @name variable, which in this case is ‘John Doe’.