forked from alyssaq/usda-sqlite
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathload_food.sql
More file actions
22 lines (21 loc) · 732 Bytes
/
load_food.sql
File metadata and controls
22 lines (21 loc) · 732 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
DROP TABLE IF EXISTS `food`;
CREATE TABLE `food` (
id int PRIMARY KEY NOT NULL,
food_group_id int REFERENCES food_group(id) NOT NULL,
long_desc text NOT NULL DEFAULT '',
short_desc text NOT NULL DEFAULT '',
common_names text NOT NULL DEFAULT '',
manufac_name text NOT NULL DEFAULT '',
survey text NOT NULL DEFAULT '',
ref_desc text NOT NULL DEFAULT '',
refuse int NOT NULL,
sci_name text NOT NULL DEFAULT '',
nitrogen_factor float NOT NULL,
protein_factor float NOT NULL,
fat_factor float NOT NULL,
calorie_factor float NOT NULL
);
CREATE INDEX food_short_desc_search_index ON food(short_desc);
CREATE INDEX food_long_desc_search_index ON food(long_desc);
.separator "^"
.import data/FOOD_DES.txt food