-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLoad Data Infile
52 lines (39 loc) · 945 Bytes
/
Load Data Infile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
CREATE DATABASE HousingProject
SELECT *
FROM housingnashville
DROP TABLE Nashvillehousing
SHOW VARIABLES LIKE 'sql_mode'
SET sql_mode = ' '
SHOW VARIABLES LIKE 'sql_mode'
DROP TABLE nashvillehousing2
CREATE TABLE NashvilleHousing (
UniqueID INT,
ParcelID VARCHAR(250),
LandUse VARCHAR(250),
PropertyAddress VARCHAR(250),
SaleDate VARCHAR(250),
SalePrice INT,
LegalReference VARCHAR(250),
OwnerName VARCHAR(250),
OwnerAddress VARCHAR(250),
Acreage FLOAT,
TaxDistrict VARCHAR(250),
LandValue INT,
BuildingValue INT,
TotalValue INT,
YearBuilt INT,
Bedrooms INT,
FullBath INT,
HalfBath INT
);
LOAD DATA LOCAL INFILE
'/Users/Wale/Downloads/Projects/Housing'
INTO TABLE NashvilleHousing
FIELDS TERMINATED BY ','
IGNORE 1 ROWS;
SHOW VARIABLES LIKE "secure_file_priv"
SHOW VARIABLES LIKE "local_infile"
SET GLOBAL local_infile = true
SET GLOBAL local_infile = false
SHOW GLOBAL VARIABLES LIKE 'local_infile'
SET GLOBAL local_infile = 'ON'