ENCLOSED BY
ENCLOSED BY is a keyword used in SQL that indicates the character or characters that surround a field value in a CSV or similarly structured data file during the operation of data import or export. It is often used in the LOAD DATA INFILE statement and the FIELDS clause.
Example
Output
Explanation
The above SQL code is loading data from a CSV file into a MySQL table. The ENCLOSED BY '"'
keyword is used to indicate that the values inside the file are enclosed by double quotes. It ensures that these quoted values are treated as single entities even if they contain the field terminator character (in this case, a comma).