-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschema_data_load.sql
More file actions
33 lines (26 loc) · 910 Bytes
/
schema_data_load.sql
File metadata and controls
33 lines (26 loc) · 910 Bytes
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
CREATE TABLE parts (
id integer,
description character varying,
code character varying,
manufacturer_id integer
);
CREATE TABLE locations (
id integer,
part_id integer,
location varchar(3),
qty integer
);
create table manufacturers (
id integer PRIMARY KEY,
name varchar
);
create table reorder_options (
id integer PRIMARY KEY,
part_id integer,
price_usd numeric(8,2),
quantity integer
);
COPY parts FROM 'D:\PostgreSQL_data\Project_build_DB\parts.csv' DELIMITER ',' NULL AS 'NULL' CSV HEADER;
COPY locations FROM 'D:\PostgreSQL_data\Project_build_DB\locations.csv' DELIMITER ',' NULL AS 'NULL' CSV HEADER;
COPY manufacturers FROM 'D:\PostgreSQL_data\Project_build_DB\manufacturers.csv' DELIMITER ',' NULL AS 'NULL' CSV HEADER;
COPY reorder_options FROM 'D:\PostgreSQL_data\Project_build_DB\reorder_options.csv' DELIMITER ',' NULL AS 'NULL' CSV HEADER;