-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathqueries.sql
More file actions
39 lines (24 loc) · 1.89 KB
/
queries.sql
File metadata and controls
39 lines (24 loc) · 1.89 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
#1). Add a new user to db, email, firstName, lastName, password,
insert into users (FirstName,LastName,LoginID,userPassword,EmailAddress)
values('bob','rob','10102','121321312','acb'); #use own variables instead of these sample values
#2). Add a new foodProduct with accompanying tables of information, predefined filters, ingredients table, ectara,
#foodfilter
insert into foodfilter (FoodName, GlutenFree, DairyFree, NutFree, Vegan, Pescatarian)
values ('chicken pot pie', 0, 1, 1, 0, 0); #use own variables instead of these sample values
#ingredients table
insert into ingredients (foodName, ingredient)
values ('chicken alfredo', 'chicken'); #use own variables instead of these sample values
#3). Query the database for every food ingredient of particular product
select ingredient from ingredients where foodName='chicken alfredo'; #use own variables instead of these sample values
#4). query the database for an email and encrypted password.
select EmailAddress, userpassword from users where UserID=1; #use own variables instead of these sample values
#5). Query the database for a food product and its predefined filters
select FoodName, GlutenFree, DairyFree, NutFree, Vegan, Pescatarian from foodfilter where FoodName='chicken pot pie'; #use own variables instead of these sample values
#6 query to make user history upon search
insert into userhistory (UserID, FoodID)
values (1,1); #use own variables instead of these sample values, in this case instead of using the 1 and 1 would need to get the ascertaining values first
#7 get userid and food id
select UserID from users where EmailAddress='acb'; #use own variables instead of these sample values
select FoodID from foodfilter where FoodName='chicken pot pie'; #use own variables instead of these sample values
#8 get all user history
select OrderID, UserID, FoodID from userhistory where UserID=1; #use own variables instead of these sample values