Complete SQL Topics for Data Analysis
-> https://t.me/sqlspecialist/523
Today, we will learn about Data Import and Export:
SQL provides mechanisms to import data into a database or export it to external files.
#### Importing Data:
-- Using INSERT INTO SELECT to import data from one table to another#### Exporting Data:
INSERT INTO destination_table (column1, column2)
SELECT column3, column4 FROM source_table;
-- Using SELECT INTO OUTFILE to export data to a fileThese operations are useful for transferring data between databases, archiving, or exchanging information with other systems.
SELECT column1, column2 INTO OUTFILE 'file_path.csv'
FIELDS TERMINATED BY ',' FROM table_name;
Share with credits: https://t.me/sqlspecialist
Hope it helps :)