-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDATABASE.sql
More file actions
53 lines (41 loc) · 1.15 KB
/
DATABASE.sql
File metadata and controls
53 lines (41 loc) · 1.15 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
drop DATABASE if exists Dietation;
CREATE DATABASE Dietation;
use Dietation;
create table if not exists Users (
UserID int not null auto_increment,
FirstName varchar(255) not null,
LastName varchar(255),
LoginID varchar(255),
userPassword varchar(255),
EmailAddress varchar(255) not null,
Primary key (UserID)
);
create table if not exists FoodFilter (
FoodID int not null auto_increment,
FoodName varchar(255) not null,
FoodBrand varchar(255),
GlutenFree int not null,
DairyFree int not null,
NutFree int not null,
CornFree int not null,
Vegan int not null,
Vegetarian int not null,
Pescatarian int not null,
Primary key (FoodID)
);
create table if not exists UserHistory (
OrderID int not null auto_increment,
UserID int not null,
FoodID int not null,
Primary key (OrderID),
foreign key(UserID)
references Users(UserID),
foreign key(FoodID)
references Foodfilter(FoodID)
);
create table if not exists ingredients (
ingredientID int not null auto_increment,
foodName varchar (255) not null,
ingredient varchar(255) not null,
primary key (ingredientID)
);