LINES
LINES is a reserved keyword in SQL, mainly used in conjunction with the LOAD DATA INFILE command. It specifies the starting and ending points for data record importing from a text file into a table. It helps SQL efficiently identify lines in the text file that constitute a single record within the table.
Example
Output
Explanation
This code creates a new table example_table
with two columns id
and text
. Then it loads data from a local file 'file.txt'
. Each line in the input file is considered as a new record. Therefore the LINES TERMINATED BY '\n'
clause is used to indicate end of a record.