This repository has been archived by the owner on Aug 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sirene.sql
108 lines (106 loc) · 3.5 KB
/
sirene.sql
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
CREATE DATABASE IF NOT EXISTS `sirene`;
USE sirene;
CREATE TABLE IF NOT EXISTS `etablissements` (
`SIREN` VARCHAR(9) NOT NULL,
`NIC` VARCHAR(5) NOT NULL,
`L1_NORMALISEE` VARCHAR(38) NOT NULL,
`L2_NORMALISEE` VARCHAR(38) NOT NULL,
`L3_NORMALISEE` VARCHAR(38) NOT NULL,
`L4_NORMALISEE` VARCHAR(38) NOT NULL,
`L5_NORMALISEE` VARCHAR(38) NOT NULL,
`L6_NORMALISEE` VARCHAR(38) NOT NULL,
`L7_NORMALISEE` VARCHAR(38) NOT NULL,
`L1_DECLAREE` VARCHAR(38) NOT NULL,
`L2_DECLAREE` VARCHAR(38) NOT NULL,
`L3_DECLAREE` VARCHAR(38) NOT NULL,
`L4_DECLAREE` VARCHAR(38) NOT NULL,
`L5_DECLAREE` VARCHAR(38) NOT NULL,
`L6_DECLAREE` VARCHAR(38) NOT NULL,
`L7_DECLAREE` VARCHAR(38) NOT NULL,
`NUMVOIE` VARCHAR(4) NOT NULL,
`INDREP` VARCHAR(1) NOT NULL,
`TYPVOIE` VARCHAR(4) NOT NULL,
`LIBVOIE` VARCHAR(32) NOT NULL,
`CODPOS` VARCHAR(5) NOT NULL,
`CEDEX` VARCHAR(5) NOT NULL,
`RPET` VARCHAR(2) NOT NULL,
`LIBREG` VARCHAR(70) NOT NULL,
`DEPET` VARCHAR(2) NOT NULL,
`ARRONET` VARCHAR(2) NOT NULL,
`CTONET` VARCHAR(3) NOT NULL,
`COMET` VARCHAR(3) NOT NULL,
`LIBCOM` VARCHAR(32) NOT NULL,
`DU` VARCHAR(2) NOT NULL,
`TU` VARCHAR(1) NOT NULL,
`UU` VARCHAR(2) NOT NULL,
`EPCI` VARCHAR(9) NOT NULL,
`TCD` VARCHAR(2) NOT NULL,
`ZEMET` VARCHAR(4) NOT NULL,
`SIEGE` VARCHAR(1) NOT NULL,
`ENSEIGNE` VARCHAR(50) NOT NULL,
`IND_PUBLIPO` VARCHAR(1) NOT NULL,
`DIFFCOM` VARCHAR(1) NOT NULL,
`AMINTRET` VARCHAR(6) NOT NULL,
`NATETAB` VARCHAR(1) NOT NULL,
`LIBNATETAB` VARCHAR(30) NOT NULL,
`APET700` VARCHAR(5) NOT NULL,
`LIBAPET` VARCHAR(65) NOT NULL,
`DAPET` VARCHAR(4) NOT NULL,
`TEFET` VARCHAR(2) NOT NULL,
`LIBTEFET` VARCHAR(23) NOT NULL,
`EFETCENT` VARCHAR(6) NOT NULL,
`DEFET` VARCHAR(4) NOT NULL,
`ORIGINE` VARCHAR(2) NOT NULL,
`DCRET` VARCHAR(8) NOT NULL,
`DDEBACT` VARCHAR(8) NOT NULL,
`ACTIVNAT` VARCHAR(2) NOT NULL,
`LIEUACT` VARCHAR(2) NOT NULL,
`ACTISURF` VARCHAR(2) NOT NULL,
`SAISONAT` VARCHAR(2) NOT NULL,
`MODET` VARCHAR(1) NOT NULL,
`PRODET` VARCHAR(1) NOT NULL,
`PRODPART` VARCHAR(1) NOT NULL,
`AUXILT` VARCHAR(1) NOT NULL,
`NOMEN_LONG` VARCHAR(131) NOT NULL,
`SIGLE` VARCHAR(20) NOT NULL,
`NOM` VARCHAR(100) NOT NULL,
`PRENOM` VARCHAR(30) NOT NULL,
`CIVILITE` VARCHAR(1) NOT NULL,
`RNA` VARCHAR(10) NOT NULL,
`NICSIEGE` VARCHAR(5) NOT NULL,
`RPEN` VARCHAR(2) NOT NULL,
`DEPCOMEN` VARCHAR(5) NOT NULL,
`ADR_MAIL` VARCHAR(80) NOT NULL,
`NJ` VARCHAR(4) NOT NULL,
`LIBNJ` VARCHAR(100) NOT NULL,
`APEN700` VARCHAR(5) NOT NULL,
`LIBAPEN` VARCHAR(65) NOT NULL,
`DAPEN` VARCHAR(4) NOT NULL,
`APRM` VARCHAR(6) NOT NULL,
`ESS` VARCHAR(1) NOT NULL,
`DATEESS` VARCHAR(8) NOT NULL,
`TEFEN` VARCHAR(2) NOT NULL,
`LIBTEFEN` VARCHAR(23) NOT NULL,
`EFENCENT` VARCHAR(6) NOT NULL,
`DEFEN` VARCHAR(4) NOT NULL,
`CATEGORIE` VARCHAR(5) NOT NULL,
`DCREN` VARCHAR(8) NOT NULL,
`AMINTREN` VARCHAR(6) NOT NULL,
`MONOACT` VARCHAR(1) NOT NULL,
`MODEN` VARCHAR(1) NOT NULL,
`PRODEN` VARCHAR(1) NOT NULL,
`ESAANN` VARCHAR(4) NOT NULL,
`TCA` VARCHAR(1) NOT NULL,
`ESAAPEN` VARCHAR(5) NOT NULL,
`ESASEC1N` VARCHAR(5) NOT NULL,
`ESASEC2N` VARCHAR(5) NOT NULL,
`ESASEC3N` VARCHAR(5) NOT NULL,
`ESASEC4N` VARCHAR(5) NOT NULL,
`VMAJ` VARCHAR(1) NOT NULL,
`VMAJ1` VARCHAR(1) NOT NULL,
`VMAJ2` VARCHAR(1) NOT NULL,
`VMAJ3` VARCHAR(1) NOT NULL,
`DATEMAJ` VARCHAR(19) NOT NULL,
PRIMARY KEY `SIRET` (`SIREN`, `NIC`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOAD DATA LOCAL INFILE 'path/to/file.csv' INTO TABLE etablissements FIELDS TERMINATED BY ';' ENCLOSED BY '"' LINES TERMINATED BY '\r\n' IGNORE 1 LINES \W;