-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMVC-Bebidas.sql
32 lines (27 loc) · 1005 Bytes
/
MVC-Bebidas.sql
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
CREATE DATABASE PREFERENCIAS;
USE PREFERENCIAS;
CREATE TABLE USERS(
id INTEGER (11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
name VARCHAR (100) NOT NULL,
age INTEGER (3) NOT NULL,
email VARCHAR(100) NOT NULL UNIQUE
)ENGINE=MyIsam AUTO_INCREMENT=0 DEFAULT CHARSET=LATIN1;
CREATE TABLE DRINKS(
idDrinks INTEGER (11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
drink VARCHAR (100) NOT NULL,
priceDrinks INTEGER (11)
)ENGINE=MyIsam AUTO_INCREMENT=0 DEFAULT CHARSET=LATIN1;
CREATE TABLE FOODS(
idFoods INTEGER (11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
eat VARCHAR (100) NOT NULL,
priceFoods INTEGER (11)
)ENGINE=MyIsam AUTO_INCREMENT=0 DEFAULT CHARSET=LATIN1;
CREATE TABLE SHOPPING(
idShopping INTEGER (11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
idFoods INTEGER (11),
idDrinks INTEGER (11),
id INTEGER (11),
FOREIGN KEY ( idDrinks ) REFERENCES DRINKS( idDrinks ) ,
FOREIGN KEY ( idFoods) REFERENCES FOODS( idFoods ) ,
FOREIGN KEY ( id ) REFERENCES USERS( id )
)ENGINE=MyIsam AUTO_INCREMENT=0 DEFAULT CHARSET=LATIN1;