LOAD DATA INFILE
LOAD DATA INFILE is a SQL statement in the MySQL Specific category. Bulk imports data from a file into a table — much faster than many INSERT statements. The syntax is LOAD DATA [LOCAL] INFILE 'file_path' INTO TABLE table_name [FIELDS TERMINATED BY ','];. It returns rows affected. A typical example: LOAD DATA INFILE '/tmp/employees.csv' INTO TABLE employees FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\ ' IGNORE 1 ROWS; -- Imports CSV file, skipping header row A close relative is AUTO_INCREMENT, which mySQL auto-generates sequential integer values for this column. Commonly used with PRIMARY KEY. A close relative is ENGINE, which specifies the MySQL storage engine. InnoDB (default) supports transactions and foreign keys. MyISAM is faster for read-heavy. A close relative is LAST_INSERT_ID(), which returns the AUTO_INCREMENT value generated by the most recent INSERT in the current connection. More about this category: MySQL-specific features — AUTO_INCREMENT, ENGINE, SHOW TABLES, LIMIT.