-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcfc_script.sql
More file actions
110 lines (90 loc) · 3.64 KB
/
cfc_script.sql
File metadata and controls
110 lines (90 loc) · 3.64 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
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
109
110
-- MySQL Workbench Synchronization
-- Generated: 2021-03-7 23:20
-- Model: Coffee For Code
-- Version: 1.1
-- Project: Sync with restAPI by SystemStrength
-- Author: SystemStrength
/****** Comandos abaixo devem ser utilizados apenas em conexao direta com a api ******/
drop database heroku_88863b9257990d2;
create database `heroku_88863b9257990d2` DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci ;
use heroku_88863b9257990d2;
/****** Para test local utilizar os comandos a baixo ******/
create database `db_cfc` DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci ;
use db_cfc;
/**********************************************************************************/
create table tbl_account(
id_user int primary key auto_increment,
email varchar(256) not null,
nm_user varchar(60) not null,
rg_user varchar(12) not null,
phone_user VARCHAR(15),
password varchar(256) not null,
partner BIT
) DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
create table tbl_category(
cd_cat int primary key auto_increment,
nm_cat varchar(50) not null
) DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
create table tbl_menu(
cd_prod int primary key auto_increment,
img_prod mediumblob not null,
nm_prod varchar(50) not null,
price_prod decimal(10, 2) not null,
qntd_prod int not null,
cat_prod varchar(50) not null,
date_prod date
) DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
insert into tbl_menu (nm_prod, price_prod, cat_prod, qntd_prod, img_prod) values ( "Expresso", "5.00", "Café", "1", "/expresso.jpg");
create table tbl_purchase(
cd_purchase int primary key auto_increment,
cpf_user varchar(14),
address_user varchar(50),
HomeNumber_user varchar(40),
apt_block_user varchar(10),
PayFormat_user varchar(20) not null
) DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
create table tbl_WorkWithUS(
cd_user int not null primary key auto_increment,
nm_user varchar(50) not null,
phone_user varchar(20) not null,
email_user varchar(40) not null
) DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
create table tbl_manager(
nm_manager varchar(50) not null,
cpf_manager varchar(14) not null,
password_manager varchar(12) primary key not null
) DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
create table tbl_employees(
id_employees int primary key auto_increment,
nm_employees varchar(50) not null,
cg_employees varchar(50) not null,
email_employees varchar(40) not null,
cpf_employees varchar(14) not null,
addres_employees varchar(50) not null,
phone_employees varchar(15) not null
) DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
/*
create table tbl_partners(
cd_parc int not null primary key auto_increment,
nm_parc varchar(50) not null,
empresa_parc varchar(50) not null,
cnpj_parc varchar(17) not null,
email_parc varchar(40) not null,
site_parc varchar(40),
end_parc varchar(50),
tel_parc varchar(30) not null,
redeSocial_parc varchar(40),
descr_parc varchar(2000)
); */
/******************** Inserts ********************/
insert into tbl_category (nm_cat) values ("Café");
insert into tbl_category (nm_cat) values ("Chocolate");
insert into tbl_category (nm_cat) values ("MilkShake");
insert into tbl_category (nm_cat) values ("Sanduíche");
insert into tbl_category (nm_cat) values ("Cookies");
insert into tbl_category (nm_cat) values ("Hambúrguer");
/******************** Selects ********************/
select * from tbl_account;
select * from tbl_employees;
select * from tbl_menu;
select * from tbl_category;