MySQL Basic codes

DROP TABLE data._01_abc;

CREATE TABLE data._01_abc (

var1(22) NULL,

var2 int NULL,
var3 char(2) NULL);

LOAD DATA INFILE “sql.csv”
INTO TABLE data._01_abc
COLUMNS TERMINATED BY ‘,’
LINES TERMINATED BY ‘\n’
IGNORE 1 LINES;

SQL: Create Table and Bulk Insert

 

CREATE TABLE DFC3
(
xxx VARCHAR(30),
xxx INT ,
xxx VARCHAR(30),
xxx VARCHAR(19),
xxx VARCHAR(6),
xxx INT,
xxx INT ,
xxx VARCHAR(19),
xxx INT ,
x  INT ,
xxx VARCHAR(33),
xx INT ,
x INT ,

)

GO
BULK
INSERT DFC3
FROM ‘xxxx.csv’
WITH
(
FIELDTERMINATOR = ‘,’,
ROWTERMINATOR = ‘\n’
)
GO
SELECT TOP 10 *
FROM DFC3
GO
SELECT *
FROM DFC3
GO