-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschema.sql
More file actions
59 lines (56 loc) · 1.17 KB
/
schema.sql
File metadata and controls
59 lines (56 loc) · 1.17 KB
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
drop table if exists entries;
create table entries (
id integer primary key autoincrement,
title text not null,
'text' text not null
);
drop table if exists users;
create table users (
id integer primary key autoincrement,
name text not null,
lastname text not null,
mail text not null,
street text,
num text,
edo text,
municipio text,
cp integer
);
drop table if exists products;
create table products (
id integer primary key autoincrement,
name text not null,
catego text not null,
img_file text not null,
price integer not null,
description text not null,
quantity integer default 100
);
drop table if exists sales;
create table sales (
id integer primary key autoincrement,
products text not null,
'text' text not null
);
CREATE TABLE if not exists sales (
CREATE TABLE sales (
id INTEGER NOT NULL,
id_usr INTEGER NOT NULL,
id_prod INTEGER NOT NULL,
qty INTEGER,
price INTEGER,
total INTEGER,
PRIMARY KEY (
id,
id_usr,
id_prod
)
);
CREATE TABLE searches (
id_usr INTEGER NOT NULL,
key_word TEXT,
PRIMARY KEY (
id_usr,
key_word
)
);