-
Notifications
You must be signed in to change notification settings - Fork 0
/
SQLite commands.txt
23 lines (16 loc) · 1.97 KB
/
SQLite commands.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
SQLite commands
# Create eyeshadow table
create table eyeshadow(id integer not null primary key, texture varchar(10), company varchar(30), name varchar(30), style varchar(10), temperature varchar(10), focus_red integer, focus_green integer, focus_blue integer, secondary_red integer, secondary_green integer, secondary_blue integer, likes integer, dislikes integer, score integer, wears integer);
create table tempe(id integer, texture varchar(10), company varchar(30), name varchar(30), style varchar(10), temperature varchar(10), focus_red integer, focus_green integer, focus_blue integer, secondary_red integer, secondary_green integer, secondary_blue integer, likes integer, dislikes integer, score integer, wears integer);
Create lipstick table
create table lipstick(id integer not null primary key, texture varchar(10), company varchar(30), name varchar(30), intensity varchar(10), colour_family varchar(10), red integer, green integer, blue integer, likes integer, dislikes integer, wear integer, score real);
create table templ(id integer, texture varchar(10), company varchar(30), name varchar(30), intensity varchar(10), colour_family varchar(10), red integer, green integer, blue integer, likes integer, dislikes integer, wear integer, score real);
Import eyeshadows into temp
.import makeup.csv temp
insert into eyeshadow(texture, company, name, style, temperature, focus_red, focus_green, focus_blue, secondary_red, secondary_green, secondary_blue) select texture, company, name, style, temperature, focus_red, focus_green, focus_blue, secondary_red, secondary_green, secondary_blue from temp;
# Import lipsticks into temp
.separator ","
.import lipstick.csv temp
insert into lipstick(texture, company, name, intensity, colour_family, red, green, blue) select texture, company, name, intensity, colour_family, red, green, blue from temp;
# Create the scores table
create table score(eyeshadow_id integer, lipstick_id integer, score real, popularity real, primary key (eyeshadow_id, lipstick_id));