Last active
August 9, 2021 01:43
-
-
Save flaviomicheletti/8359890 to your computer and use it in GitHub Desktop.
Exercício LOAD DATA LOCAL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE pet ( | |
name VARCHAR(20), | |
owner VARCHAR(20), | |
species VARCHAR(20), | |
sex CHAR(1), | |
birth DATE, | |
death DATE | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fluffy Harold cat f 1993-02-04 \N | |
Claws Gwen cat m 1994-03-17 \N | |
Buffy Harold dog f 1989-05-13 \N | |
Fang Benny dog m 1990-08-27 \N | |
Bowser Diane dog m 1979-08-31 1995-07-29 | |
Chirpy Gwen bird f 1998-09-11 \N | |
Whistler Gwen bird \N 1997-12-09 \N | |
Slim Benny snake m 1996-04-29 \N |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LOAD DATA LOCAL INFILE '~/pet.txt' INTO TABLE pet; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Gist complementar da matéria:
www.devfuria.com.br/sql/populando-tabela-a-partir-de-um-arquivo-de-texto-no-mysql/