From 2f707b598c8403e7c8148d87b3d63e7efaec1c50 Mon Sep 17 00:00:00 2001 From: Apostolof Date: Fri, 21 Dec 2018 13:39:56 +0200 Subject: [PATCH] Add example entries, Init queries --- .../flavours_without_borders_diet.sql | 7 +++-- ...hout_borders_diet_prohibits_ingredient.sql | 7 +++-- .../flavours_without_borders_drink.sql | 8 +++-- ...s_without_borders_drink_has_ingredient.sql | 7 +++-- .../flavours_without_borders_food.sql | 7 +++-- ...rs_without_borders_food_has_ingredient.sql | 7 +++-- .../flavours_without_borders_ingredient.sql | 7 +++-- .../flavours_without_borders_permission.sql | 7 +++-- .../flavours_without_borders_restaurant.sql | 7 +++-- .../flavours_without_borders_role.sql | 7 +++-- ...rs_without_borders_role_has_permission.sql | 7 +++-- .../flavours_without_borders_user.sql | 8 +++-- ...ours_without_borders_user_follows_diet.sql | 7 +++-- ...hout_borders_user_prohibits_ingredient.sql | 7 +++-- ...vours_without_borders_user_rates_drink.sql | 7 +++-- ...avours_without_borders_user_rates_food.sql | 7 +++-- ..._without_borders_user_rates_restaurant.sql | 8 +++-- .../dumps/Self Contained/dump.sql | 26 ++++++++++++++-- Database implementation/queries/query_1.sql | 31 +++++++++++++++++++ Database implementation/queries/query_11.sql | 6 ++++ Database implementation/queries/query_12.sql | 4 +++ Database implementation/queries/query_2.sql | 3 ++ Database implementation/queries/query_3.sql | 15 +++++++++ Database implementation/queries/query_4.sql | 26 ++++++++++++++++ Database implementation/queries/query_5.sql | 3 ++ Database implementation/queries/query_6.sql | 4 +++ Database implementation/queries/query_7.sql | 5 +++ Database implementation/queries/query_8.sql | 3 ++ Database implementation/queries/query_9.sql | 6 ++++ 29 files changed, 200 insertions(+), 54 deletions(-) create mode 100644 Database implementation/queries/query_1.sql create mode 100644 Database implementation/queries/query_11.sql create mode 100644 Database implementation/queries/query_12.sql create mode 100644 Database implementation/queries/query_2.sql create mode 100644 Database implementation/queries/query_3.sql create mode 100644 Database implementation/queries/query_4.sql create mode 100644 Database implementation/queries/query_5.sql create mode 100644 Database implementation/queries/query_6.sql create mode 100644 Database implementation/queries/query_7.sql create mode 100644 Database implementation/queries/query_8.sql create mode 100644 Database implementation/queries/query_9.sql diff --git a/Database implementation/dumps/Project Folder/flavours_without_borders_diet.sql b/Database implementation/dumps/Project Folder/flavours_without_borders_diet.sql index fc93dec..7c10bdb 100644 --- a/Database implementation/dumps/Project Folder/flavours_without_borders_diet.sql +++ b/Database implementation/dumps/Project Folder/flavours_without_borders_diet.sql @@ -2,9 +2,9 @@ CREATE DATABASE IF NOT EXISTS `flavours_without_borders` /*!40100 DEFAULT CHARA USE `flavours_without_borders`; -- MySQL dump 10.13 Distrib 5.7.24, for Linux (x86_64) -- --- Host: 127.0.0.1 Database: flavours_without_borders +-- Host: 83.212.109.171 Database: flavours_without_borders -- ------------------------------------------------------ --- Server version 5.7.24-0ubuntu0.18.04.1 +-- Server version 5.7.24-0ubuntu0.16.04.1 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -40,6 +40,7 @@ CREATE TABLE `diet` ( LOCK TABLES `diet` WRITE; /*!40000 ALTER TABLE `diet` DISABLE KEYS */; +INSERT INTO `diet` VALUES (2,'Διαβητικός/Διαβητική','Χαρακτηρίζεται από φαγητά χαμηλά σε ζάχαρη',_binary ''),(7,'Vegan','Not found',_binary '\0'),(13,'Bulking','Μόνο κρέας',_binary ''),(18,'Christian Fasting','Όχι τροφές παραγώμενες από ζώα και όχι λάδι',_binary ''),(20,'Vegetarian','Όχι vegan',_binary '\0'); /*!40000 ALTER TABLE `diet` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -52,4 +53,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2018-11-27 12:59:06 +-- Dump completed on 2018-12-21 13:33:51 diff --git a/Database implementation/dumps/Project Folder/flavours_without_borders_diet_prohibits_ingredient.sql b/Database implementation/dumps/Project Folder/flavours_without_borders_diet_prohibits_ingredient.sql index 4daf032..ce4c773 100644 --- a/Database implementation/dumps/Project Folder/flavours_without_borders_diet_prohibits_ingredient.sql +++ b/Database implementation/dumps/Project Folder/flavours_without_borders_diet_prohibits_ingredient.sql @@ -2,9 +2,9 @@ CREATE DATABASE IF NOT EXISTS `flavours_without_borders` /*!40100 DEFAULT CHARA USE `flavours_without_borders`; -- MySQL dump 10.13 Distrib 5.7.24, for Linux (x86_64) -- --- Host: 127.0.0.1 Database: flavours_without_borders +-- Host: 83.212.109.171 Database: flavours_without_borders -- ------------------------------------------------------ --- Server version 5.7.24-0ubuntu0.18.04.1 +-- Server version 5.7.24-0ubuntu0.16.04.1 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -40,6 +40,7 @@ CREATE TABLE `diet_prohibits_ingredient` ( LOCK TABLES `diet_prohibits_ingredient` WRITE; /*!40000 ALTER TABLE `diet_prohibits_ingredient` DISABLE KEYS */; +INSERT INTO `diet_prohibits_ingredient` VALUES (2,'sugar'),(13,'whiskey'),(18,'μοσχαρίσια πόδια'),(18,'ψάρι'); /*!40000 ALTER TABLE `diet_prohibits_ingredient` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -52,4 +53,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2018-11-27 12:59:07 +-- Dump completed on 2018-12-21 13:33:55 diff --git a/Database implementation/dumps/Project Folder/flavours_without_borders_drink.sql b/Database implementation/dumps/Project Folder/flavours_without_borders_drink.sql index 0ed9975..efe2f24 100644 --- a/Database implementation/dumps/Project Folder/flavours_without_borders_drink.sql +++ b/Database implementation/dumps/Project Folder/flavours_without_borders_drink.sql @@ -2,9 +2,9 @@ CREATE DATABASE IF NOT EXISTS `flavours_without_borders` /*!40100 DEFAULT CHARA USE `flavours_without_borders`; -- MySQL dump 10.13 Distrib 5.7.24, for Linux (x86_64) -- --- Host: 127.0.0.1 Database: flavours_without_borders +-- Host: 83.212.109.171 Database: flavours_without_borders -- ------------------------------------------------------ --- Server version 5.7.24-0ubuntu0.18.04.1 +-- Server version 5.7.24-0ubuntu0.16.04.1 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -28,6 +28,7 @@ CREATE TABLE `drink` ( `drink_id` int(11) NOT NULL, `drink_name` varchar(200) NOT NULL, `drink_description` varchar(150) DEFAULT NULL, + `drink_has_alcohol` bit(1) NOT NULL, `drink_is_approved` bit(1) DEFAULT b'0', `restaurant_id` int(11) NOT NULL, PRIMARY KEY (`drink_id`), @@ -43,6 +44,7 @@ CREATE TABLE `drink` ( LOCK TABLES `drink` WRITE; /*!40000 ALTER TABLE `drink` DISABLE KEYS */; +INSERT INTO `drink` VALUES (3,'Κόκκινη πλατεία','Απολαυστικό τσάι με ιβίσκο',_binary '\0',_binary '\0',768),(46,'Long Island',NULL,_binary '',_binary '\0',768),(69,'Πορτοκαλάδα',NULL,_binary '\0',_binary '',9),(494,'La Trappe Quadrupel','Μερικοί υποστηρίζουν ότι είναι η καλύτερη μοναστηριακή μπύρα στον κόσμο',_binary '',_binary '',683),(984,'Long Island','Το πιο βαρή coctail που υπάρχει',_binary '',_binary '\0',1356),(3214,'Mojito','Δροσιστικό κουβανέζικο κοκτέιλ',_binary '',_binary '',1356),(6363,'White Russian','Διάσημο coctail που έπινε ο Jeff Bridges στη ταινία \"The big Lebowski\"',_binary '',_binary '',6211),(26427,'Old Fashioned','Κοκτέιλ με αμερικάνικες ρίζες',_binary '',_binary '\0',6211); /*!40000 ALTER TABLE `drink` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -55,4 +57,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2018-11-27 12:59:06 +-- Dump completed on 2018-12-21 13:33:50 diff --git a/Database implementation/dumps/Project Folder/flavours_without_borders_drink_has_ingredient.sql b/Database implementation/dumps/Project Folder/flavours_without_borders_drink_has_ingredient.sql index 6c9e79f..7f874ab 100644 --- a/Database implementation/dumps/Project Folder/flavours_without_borders_drink_has_ingredient.sql +++ b/Database implementation/dumps/Project Folder/flavours_without_borders_drink_has_ingredient.sql @@ -2,9 +2,9 @@ CREATE DATABASE IF NOT EXISTS `flavours_without_borders` /*!40100 DEFAULT CHARA USE `flavours_without_borders`; -- MySQL dump 10.13 Distrib 5.7.24, for Linux (x86_64) -- --- Host: 127.0.0.1 Database: flavours_without_borders +-- Host: 83.212.109.171 Database: flavours_without_borders -- ------------------------------------------------------ --- Server version 5.7.24-0ubuntu0.18.04.1 +-- Server version 5.7.24-0ubuntu0.16.04.1 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -40,6 +40,7 @@ CREATE TABLE `drink_has_ingredient` ( LOCK TABLES `drink_has_ingredient` WRITE; /*!40000 ALTER TABLE `drink_has_ingredient` DISABLE KEYS */; +INSERT INTO `drink_has_ingredient` VALUES (26427,'Angostura bitters'),(3214,'club soda'),(6363,'coffee liqueur'),(46,'Cola'),(984,'Cola'),(6363,'cream'),(46,'Gin'),(984,'Gin'),(984,'Lemon juice'),(46,'Lemon slice'),(3214,'lime'),(3214,'mint'),(3214,'rum'),(46,'Silver tequila'),(984,'Silver tequila'),(3214,'sugar'),(26427,'sugar'),(46,'Sweet and sour mix'),(46,'Triple sec'),(984,'Triple sec'),(6363,'vodka'),(26427,'whiskey'),(46,'White rum'),(984,'White rum'); /*!40000 ALTER TABLE `drink_has_ingredient` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -52,4 +53,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2018-11-27 12:59:06 +-- Dump completed on 2018-12-21 13:33:48 diff --git a/Database implementation/dumps/Project Folder/flavours_without_borders_food.sql b/Database implementation/dumps/Project Folder/flavours_without_borders_food.sql index 48a1e6b..b4f74df 100644 --- a/Database implementation/dumps/Project Folder/flavours_without_borders_food.sql +++ b/Database implementation/dumps/Project Folder/flavours_without_borders_food.sql @@ -2,9 +2,9 @@ CREATE DATABASE IF NOT EXISTS `flavours_without_borders` /*!40100 DEFAULT CHARA USE `flavours_without_borders`; -- MySQL dump 10.13 Distrib 5.7.24, for Linux (x86_64) -- --- Host: 127.0.0.1 Database: flavours_without_borders +-- Host: 83.212.109.171 Database: flavours_without_borders -- ------------------------------------------------------ --- Server version 5.7.24-0ubuntu0.18.04.1 +-- Server version 5.7.24-0ubuntu0.16.04.1 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -44,6 +44,7 @@ CREATE TABLE `food` ( LOCK TABLES `food` WRITE; /*!40000 ALTER TABLE `food` DISABLE KEYS */; +INSERT INTO `food` VALUES (2,'Κεφτεδάκια με πατάτες',NULL,450,'TRUE',8132),(4,'Κοτομπουκιές',NULL,NULL,'FALSE',4330),(6,'Γεμιστά','Λαχταριστές ντομάτες και πιπεριές γεμιστές',326,'TRUE',8),(8,'Κεφτεδάκια με πατάτες',NULL,NULL,'FALSE',8),(48,'Burger','Είναι σαν να τρως αέρα!',1821,'TRUE',15),(68,'Μπριζολάκια','Χοιρινές μπριζόλες ξεροψημένες!',NULL,'FALSE',8132),(73,'Τυροκαυτερή','Η καλύτερη συνοδεία για τα τηγανητά κολοκυθάκια',276,'TRUE',8132),(124,'Γεμιστά','Παραδοσιακό ελληνικό πιάτο',392,'TRUE',4330),(478,'Πατσάς με σκορδοστούμπι','Ένα πιάτο που θυμίζει πολύ χωριό',450,'TRUE',4330),(548,'Fish&Chips','Μία γεύση από Αγγλία',840,'TRUE',7365); /*!40000 ALTER TABLE `food` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -56,4 +57,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2018-11-27 12:59:06 +-- Dump completed on 2018-12-21 13:33:49 diff --git a/Database implementation/dumps/Project Folder/flavours_without_borders_food_has_ingredient.sql b/Database implementation/dumps/Project Folder/flavours_without_borders_food_has_ingredient.sql index a8fcf0a..1cbd039 100644 --- a/Database implementation/dumps/Project Folder/flavours_without_borders_food_has_ingredient.sql +++ b/Database implementation/dumps/Project Folder/flavours_without_borders_food_has_ingredient.sql @@ -2,9 +2,9 @@ CREATE DATABASE IF NOT EXISTS `flavours_without_borders` /*!40100 DEFAULT CHARA USE `flavours_without_borders`; -- MySQL dump 10.13 Distrib 5.7.24, for Linux (x86_64) -- --- Host: 127.0.0.1 Database: flavours_without_borders +-- Host: 83.212.109.171 Database: flavours_without_borders -- ------------------------------------------------------ --- Server version 5.7.24-0ubuntu0.18.04.1 +-- Server version 5.7.24-0ubuntu0.16.04.1 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -40,6 +40,7 @@ CREATE TABLE `food_has_ingredient` ( LOCK TABLES `food_has_ingredient` WRITE; /*!40000 ALTER TABLE `food_has_ingredient` DISABLE KEYS */; +INSERT INTO `food_has_ingredient` VALUES (2,'αλάτι'),(6,'αλάτι'),(8,'αλάτι'),(124,'αλάτι'),(548,'αλάτι'),(2,'κιμάς'),(8,'κιμάς'),(124,'κιμάς'),(6,'κουκουνάρι'),(2,'κρεμμύδι'),(124,'κρεμμύδι'),(2,'λάδι'),(6,'λάδι'),(8,'λάδι'),(124,'λάδι'),(548,'λάδι'),(8,'μαϊντανός'),(124,'μαϊντανός'),(478,'μοσχαρίσια πόδια'),(478,'μπούκοβο'),(6,'ντομάτα'),(8,'ντομάτα'),(124,'ντομάτα'),(2,'πατάτα'),(8,'πατάτα'),(548,'πατάτα'),(6,'πιπεριά'),(124,'πιπεριά'),(6,'ρύζι'),(124,'ρύζι'),(478,'σκόρδο'),(548,'ψάρι'); /*!40000 ALTER TABLE `food_has_ingredient` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -52,4 +53,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2018-11-27 12:59:07 +-- Dump completed on 2018-12-21 13:34:01 diff --git a/Database implementation/dumps/Project Folder/flavours_without_borders_ingredient.sql b/Database implementation/dumps/Project Folder/flavours_without_borders_ingredient.sql index bef3744..4cb7c0e 100644 --- a/Database implementation/dumps/Project Folder/flavours_without_borders_ingredient.sql +++ b/Database implementation/dumps/Project Folder/flavours_without_borders_ingredient.sql @@ -2,9 +2,9 @@ CREATE DATABASE IF NOT EXISTS `flavours_without_borders` /*!40100 DEFAULT CHARA USE `flavours_without_borders`; -- MySQL dump 10.13 Distrib 5.7.24, for Linux (x86_64) -- --- Host: 127.0.0.1 Database: flavours_without_borders +-- Host: 83.212.109.171 Database: flavours_without_borders -- ------------------------------------------------------ --- Server version 5.7.24-0ubuntu0.18.04.1 +-- Server version 5.7.24-0ubuntu0.16.04.1 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -38,6 +38,7 @@ CREATE TABLE `ingredient` ( LOCK TABLES `ingredient` WRITE; /*!40000 ALTER TABLE `ingredient` DISABLE KEYS */; +INSERT INTO `ingredient` VALUES ('Angostura bitters',_binary ''),('club soda',_binary '\0'),('coffee liqueur',_binary '\0'),('Cola',_binary '\0'),('cream',_binary '\0'),('Gin',_binary ''),('Lemon juice',_binary '\0'),('Lemon slice',_binary '\0'),('lime',_binary '\0'),('mint',_binary '\0'),('rum',_binary ''),('Silver tequila',_binary ''),('sugar',_binary '\0'),('Sweet and sour mix',_binary '\0'),('Triple sec',_binary ''),('vodka',_binary ''),('whiskey',_binary ''),('White rum',_binary ''),('αλάτι',_binary '\0'),('κιμάς',_binary '\0'),('κουκουνάρι',_binary '\0'),('κρεμμύδι',_binary '\0'),('λάδι',_binary '\0'),('μαϊντανός',_binary '\0'),('μοσχαρίσια πόδια',_binary '\0'),('μπούκοβο',_binary '\0'),('ντομάτα',_binary '\0'),('πατάτα',_binary '\0'),('πιπεριά',_binary '\0'),('ρύζι',_binary '\0'),('σκόρδο',_binary '\0'),('ψάρι',_binary '\0'); /*!40000 ALTER TABLE `ingredient` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -50,4 +51,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2018-11-27 12:59:07 +-- Dump completed on 2018-12-21 13:34:02 diff --git a/Database implementation/dumps/Project Folder/flavours_without_borders_permission.sql b/Database implementation/dumps/Project Folder/flavours_without_borders_permission.sql index 840b518..d7bbcf2 100644 --- a/Database implementation/dumps/Project Folder/flavours_without_borders_permission.sql +++ b/Database implementation/dumps/Project Folder/flavours_without_borders_permission.sql @@ -2,9 +2,9 @@ CREATE DATABASE IF NOT EXISTS `flavours_without_borders` /*!40100 DEFAULT CHARA USE `flavours_without_borders`; -- MySQL dump 10.13 Distrib 5.7.24, for Linux (x86_64) -- --- Host: 127.0.0.1 Database: flavours_without_borders +-- Host: 83.212.109.171 Database: flavours_without_borders -- ------------------------------------------------------ --- Server version 5.7.24-0ubuntu0.18.04.1 +-- Server version 5.7.24-0ubuntu0.16.04.1 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -38,6 +38,7 @@ CREATE TABLE `permission` ( LOCK TABLES `permission` WRITE; /*!40000 ALTER TABLE `permission` DISABLE KEYS */; +INSERT INTO `permission` VALUES (2,'Μπορεί να προτείνει νέα δίαιτα'),(4,'Μπορεί να προσθέσει πιάτο χωρίς έγκριση'),(8,'Μπορεί να εγκρίνει κατάστημα'),(16,'Μπορεί να αξιολογήσει καταστήματα'),(32,'Μπορεί να αξιολογήσει ποτό'),(64,'Μπορεί να κάνει ban χρήστη'); /*!40000 ALTER TABLE `permission` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -50,4 +51,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2018-11-27 12:59:06 +-- Dump completed on 2018-12-21 13:33:49 diff --git a/Database implementation/dumps/Project Folder/flavours_without_borders_restaurant.sql b/Database implementation/dumps/Project Folder/flavours_without_borders_restaurant.sql index 43d0ef3..8e8b6df 100644 --- a/Database implementation/dumps/Project Folder/flavours_without_borders_restaurant.sql +++ b/Database implementation/dumps/Project Folder/flavours_without_borders_restaurant.sql @@ -2,9 +2,9 @@ CREATE DATABASE IF NOT EXISTS `flavours_without_borders` /*!40100 DEFAULT CHARA USE `flavours_without_borders`; -- MySQL dump 10.13 Distrib 5.7.24, for Linux (x86_64) -- --- Host: 127.0.0.1 Database: flavours_without_borders +-- Host: 83.212.109.171 Database: flavours_without_borders -- ------------------------------------------------------ --- Server version 5.7.24-0ubuntu0.18.04.1 +-- Server version 5.7.24-0ubuntu0.16.04.1 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -47,6 +47,7 @@ CREATE TABLE `restaurant` ( LOCK TABLES `restaurant` WRITE; /*!40000 ALTER TABLE `restaurant` DISABLE KEYS */; +INSERT INTO `restaurant` VALUES (7,'U Fleků','pub',40.6357,22.9367,'18:00:00','04:00:00',_binary '\0',NULL),(8,'Σ σύγχρονα εστιατόρια','restaurant',40.6173,22.9597,'12:00:00','22:00:00',_binary '',NULL),(9,'U Fleků Garden','pub',40.6354,22.937,'18:00:00','02:00:00',_binary '',NULL),(15,'McDonald\'s','fast_food',40.6463,22.9206,'12:00:00','23:59:00',_binary '',12),(129,'Grill 15','fast_food',40.6215,22.961,'12:00:00','01:30:00',_binary '\0',NULL),(236,'Butterflies and Hurricanes','cafeteria',40.6147,22.9609,'08:00:00','20:00:00',_binary '',356),(683,'The Hoppy Pub','pub',40.6279,22.9489,'17:30:00','01:30:00',_binary '',NULL),(768,'Belleville sin patron','bar',40.6337,22.9518,'12:00:00','02:00:00',_binary '',7),(1356,'Αιθερόπλοο','pub',40.6144,22.9598,'08:00:00','02:00:00',_binary '',356),(4330,'Οδυσσέας','restaurant',40.6369,22.9534,'12:30:00','18:00:00',_binary '',24788),(6211,'Pulp','bar',40.6321,22.9479,'09:00:00','23:59:00',_binary '',NULL),(7365,'McDonald\'s','fast_food',40.5745,22.9715,'12:00:00','23:59:00',_binary '',NULL),(8132,'Γιαννούλα','restaurant',40.64,22.9468,'13:30:00','01:00:00',_binary '',1566); /*!40000 ALTER TABLE `restaurant` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -59,4 +60,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2018-11-27 12:59:07 +-- Dump completed on 2018-12-21 13:33:56 diff --git a/Database implementation/dumps/Project Folder/flavours_without_borders_role.sql b/Database implementation/dumps/Project Folder/flavours_without_borders_role.sql index 0cebcfa..666fba7 100644 --- a/Database implementation/dumps/Project Folder/flavours_without_borders_role.sql +++ b/Database implementation/dumps/Project Folder/flavours_without_borders_role.sql @@ -2,9 +2,9 @@ CREATE DATABASE IF NOT EXISTS `flavours_without_borders` /*!40100 DEFAULT CHARA USE `flavours_without_borders`; -- MySQL dump 10.13 Distrib 5.7.24, for Linux (x86_64) -- --- Host: 127.0.0.1 Database: flavours_without_borders +-- Host: 83.212.109.171 Database: flavours_without_borders -- ------------------------------------------------------ --- Server version 5.7.24-0ubuntu0.18.04.1 +-- Server version 5.7.24-0ubuntu0.16.04.1 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -39,6 +39,7 @@ CREATE TABLE `role` ( LOCK TABLES `role` WRITE; /*!40000 ALTER TABLE `role` DISABLE KEYS */; +INSERT INTO `role` VALUES (0,'user','Απλός χρήστης'),(1,'moderator','Διαχειριστής'),(2,'owner','Ιδιοκτήτης'); /*!40000 ALTER TABLE `role` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -51,4 +52,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2018-11-27 12:59:07 +-- Dump completed on 2018-12-21 13:34:00 diff --git a/Database implementation/dumps/Project Folder/flavours_without_borders_role_has_permission.sql b/Database implementation/dumps/Project Folder/flavours_without_borders_role_has_permission.sql index fb03230..0a02c14 100644 --- a/Database implementation/dumps/Project Folder/flavours_without_borders_role_has_permission.sql +++ b/Database implementation/dumps/Project Folder/flavours_without_borders_role_has_permission.sql @@ -2,9 +2,9 @@ CREATE DATABASE IF NOT EXISTS `flavours_without_borders` /*!40100 DEFAULT CHARA USE `flavours_without_borders`; -- MySQL dump 10.13 Distrib 5.7.24, for Linux (x86_64) -- --- Host: 127.0.0.1 Database: flavours_without_borders +-- Host: 83.212.109.171 Database: flavours_without_borders -- ------------------------------------------------------ --- Server version 5.7.24-0ubuntu0.18.04.1 +-- Server version 5.7.24-0ubuntu0.16.04.1 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -40,6 +40,7 @@ CREATE TABLE `role_has_permission` ( LOCK TABLES `role_has_permission` WRITE; /*!40000 ALTER TABLE `role_has_permission` DISABLE KEYS */; +INSERT INTO `role_has_permission` VALUES (2,4),(1,8),(0,16),(0,32),(1,64); /*!40000 ALTER TABLE `role_has_permission` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -52,4 +53,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2018-11-27 12:59:07 +-- Dump completed on 2018-12-21 13:34:00 diff --git a/Database implementation/dumps/Project Folder/flavours_without_borders_user.sql b/Database implementation/dumps/Project Folder/flavours_without_borders_user.sql index 9e67d33..83fc1ee 100644 --- a/Database implementation/dumps/Project Folder/flavours_without_borders_user.sql +++ b/Database implementation/dumps/Project Folder/flavours_without_borders_user.sql @@ -2,9 +2,9 @@ CREATE DATABASE IF NOT EXISTS `flavours_without_borders` /*!40100 DEFAULT CHARA USE `flavours_without_borders`; -- MySQL dump 10.13 Distrib 5.7.24, for Linux (x86_64) -- --- Host: 127.0.0.1 Database: flavours_without_borders +-- Host: 83.212.109.171 Database: flavours_without_borders -- ------------------------------------------------------ --- Server version 5.7.24-0ubuntu0.18.04.1 +-- Server version 5.7.24-0ubuntu0.16.04.1 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -31,6 +31,7 @@ CREATE TABLE `user` ( `user_hashed_password` char(64) NOT NULL, `user_salt` char(32) NOT NULL, `role_id` int(11) NOT NULL, + `user_age` date NOT NULL, PRIMARY KEY (`user_id`), UNIQUE KEY `user_id_UNIQUE` (`user_id`), KEY `user_is_role_id_idx` (`role_id`), @@ -44,6 +45,7 @@ CREATE TABLE `user` ( LOCK TABLES `user` WRITE; /*!40000 ALTER TABLE `user` DISABLE KEYS */; +INSERT INTO `user` VALUES (7,'gardenia@kyuss.com','Γαρδένιος ο Stoner','A8F08F6BE2B5F7280BFB0EF42850C7AF7DC9F9512655DF960F2CEE86A8734092','cd42e1cafe678f9473e05af4540a92cb',0,'1995-03-25'),(9,'waves@naxatras.gr','johny2012','A2D5D620335018723BCFFE6469CEABCC75B72C180BAD8637B220C43185D28B7A','0AB4E80109BF647D1BD2FA67833E3E30',1,'1983-09-15'),(12,'amail@yahoo.com','marika','97BB101F9ECF31FFD3788D77C1A02C431C1607E8168AAA53E38A89D445324428','e8413a21fbfef293ed80ec5ac0864ab9',0,'1976-10-12'),(215,'mongoose@fumanchu.com','Μαγκούστα','95BDEEACDAE5B9E371976D84387194DE83EB5F58AB7EAF4F4CD533925E9CDB3B','c7bcc1683f9a415188d9cb9bba8023df',0,'1978-11-02'),(356,'nonexistent@noidea.bn','Ανύπαρκτος','09986D06B9EABA0200318069CD372659C6036E2B9F0B1D44083F438E5DDE5821','vjp4a15w7n6806fmhe3x45qxz988xxql',2,'1992-04-14'),(666,'the_trooper@iron.maiden.uk','eddie lives inside you','B87814E1BBF9D5862653659D9EE77F9F9F44A3B88CBDEA4A56A97796F19CE817','f361b8aa332b67eb99c7bb5abcfb33b5',0,'1975-12-25'),(1566,'iamanonymous@not.your.buisness.ελ','Ανώνυμος','5F4783987A5E5B9B2D7FBA6BA5D8879A6EA94D24CE374570BD74CFF205D2E552','7g2pnmg118k9h4h5zphkntixwb4wtyn8',2,'1987-06-23'),(8756,'godzilla@fumanchu.com','Ms Godzila','E9295989293B86B016200A8FFB37F74443BF478BFCEC36266105E83C4455DFBF','5070b798b96b6038d75c0cbf8ae13cb8',1,'1994-08-20'),(24788,'somebody@gmail.com','κάποιος','7D148308053C85B038157848103489FCCFAA628044BC36427EEED94AD2B70E4F','05a700266be1bf1b84dd2c7c4a19f097',2,'1989-03-28'),(75813,'desert_cruiser@truckfighters.se','Νταλίκας','20AE282A6814EF1865E7EDD8D379281001F6E7AA4F8378DA26B6AB0187D61500','43f7cc8bec190e0c20fc2a13cd3dab86',0,'2001-12-24'); /*!40000 ALTER TABLE `user` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -56,4 +58,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2018-11-27 12:59:07 +-- Dump completed on 2018-12-21 13:33:53 diff --git a/Database implementation/dumps/Project Folder/flavours_without_borders_user_follows_diet.sql b/Database implementation/dumps/Project Folder/flavours_without_borders_user_follows_diet.sql index aaffea4..ae723ff 100644 --- a/Database implementation/dumps/Project Folder/flavours_without_borders_user_follows_diet.sql +++ b/Database implementation/dumps/Project Folder/flavours_without_borders_user_follows_diet.sql @@ -2,9 +2,9 @@ CREATE DATABASE IF NOT EXISTS `flavours_without_borders` /*!40100 DEFAULT CHARA USE `flavours_without_borders`; -- MySQL dump 10.13 Distrib 5.7.24, for Linux (x86_64) -- --- Host: 127.0.0.1 Database: flavours_without_borders +-- Host: 83.212.109.171 Database: flavours_without_borders -- ------------------------------------------------------ --- Server version 5.7.24-0ubuntu0.18.04.1 +-- Server version 5.7.24-0ubuntu0.16.04.1 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -40,6 +40,7 @@ CREATE TABLE `user_follows_diet` ( LOCK TABLES `user_follows_diet` WRITE; /*!40000 ALTER TABLE `user_follows_diet` DISABLE KEYS */; +INSERT INTO `user_follows_diet` VALUES (1566,2),(12,18),(1566,18); /*!40000 ALTER TABLE `user_follows_diet` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -52,4 +53,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2018-11-27 12:59:07 +-- Dump completed on 2018-12-21 13:33:58 diff --git a/Database implementation/dumps/Project Folder/flavours_without_borders_user_prohibits_ingredient.sql b/Database implementation/dumps/Project Folder/flavours_without_borders_user_prohibits_ingredient.sql index 8480efd..bf9f484 100644 --- a/Database implementation/dumps/Project Folder/flavours_without_borders_user_prohibits_ingredient.sql +++ b/Database implementation/dumps/Project Folder/flavours_without_borders_user_prohibits_ingredient.sql @@ -2,9 +2,9 @@ CREATE DATABASE IF NOT EXISTS `flavours_without_borders` /*!40100 DEFAULT CHARA USE `flavours_without_borders`; -- MySQL dump 10.13 Distrib 5.7.24, for Linux (x86_64) -- --- Host: 127.0.0.1 Database: flavours_without_borders +-- Host: 83.212.109.171 Database: flavours_without_borders -- ------------------------------------------------------ --- Server version 5.7.24-0ubuntu0.18.04.1 +-- Server version 5.7.24-0ubuntu0.16.04.1 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -40,6 +40,7 @@ CREATE TABLE `user_prohibits_ingredient` ( LOCK TABLES `user_prohibits_ingredient` WRITE; /*!40000 ALTER TABLE `user_prohibits_ingredient` DISABLE KEYS */; +INSERT INTO `user_prohibits_ingredient` VALUES (356,'club soda'),(12,'μπούκοβο'),(12,'σκόρδο'); /*!40000 ALTER TABLE `user_prohibits_ingredient` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -52,4 +53,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2018-11-27 12:59:07 +-- Dump completed on 2018-12-21 13:33:59 diff --git a/Database implementation/dumps/Project Folder/flavours_without_borders_user_rates_drink.sql b/Database implementation/dumps/Project Folder/flavours_without_borders_user_rates_drink.sql index f9aa204..f92b969 100644 --- a/Database implementation/dumps/Project Folder/flavours_without_borders_user_rates_drink.sql +++ b/Database implementation/dumps/Project Folder/flavours_without_borders_user_rates_drink.sql @@ -2,9 +2,9 @@ CREATE DATABASE IF NOT EXISTS `flavours_without_borders` /*!40100 DEFAULT CHARA USE `flavours_without_borders`; -- MySQL dump 10.13 Distrib 5.7.24, for Linux (x86_64) -- --- Host: 127.0.0.1 Database: flavours_without_borders +-- Host: 83.212.109.171 Database: flavours_without_borders -- ------------------------------------------------------ --- Server version 5.7.24-0ubuntu0.18.04.1 +-- Server version 5.7.24-0ubuntu0.16.04.1 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -44,6 +44,7 @@ CREATE TABLE `user_rates_drink` ( LOCK TABLES `user_rates_drink` WRITE; /*!40000 ALTER TABLE `user_rates_drink` DISABLE KEYS */; +INSERT INTO `user_rates_drink` VALUES (12,3214,4,'2018-12-17',NULL,'medium'),(12,6363,5,'2018-07-08','Τέλειο!!1',NULL),(215,3214,5,'2018-05-01',NULL,NULL),(356,26427,2,'2018-06-28','Μετριότης κύριοι.','small'); /*!40000 ALTER TABLE `user_rates_drink` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -56,4 +57,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2018-11-27 12:59:07 +-- Dump completed on 2018-12-21 13:33:54 diff --git a/Database implementation/dumps/Project Folder/flavours_without_borders_user_rates_food.sql b/Database implementation/dumps/Project Folder/flavours_without_borders_user_rates_food.sql index a79dd1c..77dc000 100644 --- a/Database implementation/dumps/Project Folder/flavours_without_borders_user_rates_food.sql +++ b/Database implementation/dumps/Project Folder/flavours_without_borders_user_rates_food.sql @@ -2,9 +2,9 @@ CREATE DATABASE IF NOT EXISTS `flavours_without_borders` /*!40100 DEFAULT CHARA USE `flavours_without_borders`; -- MySQL dump 10.13 Distrib 5.7.24, for Linux (x86_64) -- --- Host: 127.0.0.1 Database: flavours_without_borders +-- Host: 83.212.109.171 Database: flavours_without_borders -- ------------------------------------------------------ --- Server version 5.7.24-0ubuntu0.18.04.1 +-- Server version 5.7.24-0ubuntu0.16.04.1 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -44,6 +44,7 @@ CREATE TABLE `user_rates_food` ( LOCK TABLES `user_rates_food` WRITE; /*!40000 ALTER TABLE `user_rates_food` DISABLE KEYS */; +INSERT INTO `user_rates_food` VALUES (215,548,1,'2018-09-07',NULL,'small'),(1566,124,2,'2018-08-20',NULL,'medium'),(8756,124,3,'2018-11-11','Μέτριο',NULL),(8756,478,5,'2018-03-25','Πολύ γευστικό',NULL); /*!40000 ALTER TABLE `user_rates_food` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -56,4 +57,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2018-11-27 12:59:07 +-- Dump completed on 2018-12-21 13:33:52 diff --git a/Database implementation/dumps/Project Folder/flavours_without_borders_user_rates_restaurant.sql b/Database implementation/dumps/Project Folder/flavours_without_borders_user_rates_restaurant.sql index d5e8df0..fb7c772 100644 --- a/Database implementation/dumps/Project Folder/flavours_without_borders_user_rates_restaurant.sql +++ b/Database implementation/dumps/Project Folder/flavours_without_borders_user_rates_restaurant.sql @@ -2,9 +2,9 @@ CREATE DATABASE IF NOT EXISTS `flavours_without_borders` /*!40100 DEFAULT CHARA USE `flavours_without_borders`; -- MySQL dump 10.13 Distrib 5.7.24, for Linux (x86_64) -- --- Host: 127.0.0.1 Database: flavours_without_borders +-- Host: 83.212.109.171 Database: flavours_without_borders -- ------------------------------------------------------ --- Server version 5.7.24-0ubuntu0.18.04.1 +-- Server version 5.7.24-0ubuntu0.16.04.1 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -31,6 +31,7 @@ CREATE TABLE `user_rates_restaurant` ( `rating_grade` int(11) NOT NULL, `rating_date` date NOT NULL, `rating_text` varchar(150) DEFAULT NULL, + `rating_accessibility` enum('easy','moderate','hard') DEFAULT NULL, PRIMARY KEY (`user_id`,`restaurant_id`), KEY `user_rates_restaurant_id_idx` (`restaurant_id`), KEY `user_rates_restaurant_with_diet_id_idx` (`diet_id`), @@ -46,6 +47,7 @@ CREATE TABLE `user_rates_restaurant` ( LOCK TABLES `user_rates_restaurant` WRITE; /*!40000 ALTER TABLE `user_rates_restaurant` DISABLE KEYS */; +INSERT INTO `user_rates_restaurant` VALUES (215,4330,18,5,'2018-10-02','Χορταστικό φαΐ!','hard'),(215,6211,NULL,4,'2018-04-04','','hard'),(356,4330,NULL,4,'2018-09-16',NULL,NULL),(24788,1356,NULL,5,'2018-06-08','Φιλικότατο προσωπικό!','moderate'),(24788,4330,2,3,'2018-01-04','Λίγες επιλογές για διαβητικούς.',NULL); /*!40000 ALTER TABLE `user_rates_restaurant` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -58,4 +60,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2018-11-27 12:59:07 +-- Dump completed on 2018-12-21 13:33:57 diff --git a/Database implementation/dumps/Self Contained/dump.sql b/Database implementation/dumps/Self Contained/dump.sql index cb15cbc..838e36b 100644 --- a/Database implementation/dumps/Self Contained/dump.sql +++ b/Database implementation/dumps/Self Contained/dump.sql @@ -2,9 +2,9 @@ CREATE DATABASE IF NOT EXISTS `flavours_without_borders` /*!40100 DEFAULT CHARA USE `flavours_without_borders`; -- MySQL dump 10.13 Distrib 5.7.24, for Linux (x86_64) -- --- Host: 127.0.0.1 Database: flavours_without_borders +-- Host: 83.212.109.171 Database: flavours_without_borders -- ------------------------------------------------------ --- Server version 5.7.24-0ubuntu0.18.04.1 +-- Server version 5.7.24-0ubuntu0.16.04.1 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -40,6 +40,7 @@ CREATE TABLE `diet` ( LOCK TABLES `diet` WRITE; /*!40000 ALTER TABLE `diet` DISABLE KEYS */; +INSERT INTO `diet` VALUES (2,'Διαβητικός/Διαβητική','Χαρακτηρίζεται από φαγητά χαμηλά σε ζάχαρη',_binary ''),(7,'Vegan','Not found',_binary '\0'),(13,'Bulking','Μόνο κρέας',_binary ''),(18,'Christian Fasting','Όχι τροφές παραγώμενες από ζώα και όχι λάδι',_binary ''),(20,'Vegetarian','Όχι vegan',_binary '\0'); /*!40000 ALTER TABLE `diet` ENABLE KEYS */; UNLOCK TABLES; @@ -66,6 +67,7 @@ CREATE TABLE `diet_prohibits_ingredient` ( LOCK TABLES `diet_prohibits_ingredient` WRITE; /*!40000 ALTER TABLE `diet_prohibits_ingredient` DISABLE KEYS */; +INSERT INTO `diet_prohibits_ingredient` VALUES (2,'sugar'),(13,'whiskey'),(18,'μοσχαρίσια πόδια'),(18,'ψάρι'); /*!40000 ALTER TABLE `diet_prohibits_ingredient` ENABLE KEYS */; UNLOCK TABLES; @@ -80,6 +82,7 @@ CREATE TABLE `drink` ( `drink_id` int(11) NOT NULL, `drink_name` varchar(200) NOT NULL, `drink_description` varchar(150) DEFAULT NULL, + `drink_has_alcohol` bit(1) NOT NULL, `drink_is_approved` bit(1) DEFAULT b'0', `restaurant_id` int(11) NOT NULL, PRIMARY KEY (`drink_id`), @@ -95,6 +98,7 @@ CREATE TABLE `drink` ( LOCK TABLES `drink` WRITE; /*!40000 ALTER TABLE `drink` DISABLE KEYS */; +INSERT INTO `drink` VALUES (3,'Κόκκινη πλατεία','Απολαυστικό τσάι με ιβίσκο',_binary '\0',_binary '\0',768),(46,'Long Island',NULL,_binary '',_binary '\0',768),(69,'Πορτοκαλάδα',NULL,_binary '\0',_binary '',9),(494,'La Trappe Quadrupel','Μερικοί υποστηρίζουν ότι είναι η καλύτερη μοναστηριακή μπύρα στον κόσμο',_binary '',_binary '',683),(984,'Long Island','Το πιο βαρή coctail που υπάρχει',_binary '',_binary '\0',1356),(3214,'Mojito','Δροσιστικό κουβανέζικο κοκτέιλ',_binary '',_binary '',1356),(6363,'White Russian','Διάσημο coctail που έπινε ο Jeff Bridges στη ταινία \"The big Lebowski\"',_binary '',_binary '',6211),(26427,'Old Fashioned','Κοκτέιλ με αμερικάνικες ρίζες',_binary '',_binary '\0',6211); /*!40000 ALTER TABLE `drink` ENABLE KEYS */; UNLOCK TABLES; @@ -121,6 +125,7 @@ CREATE TABLE `drink_has_ingredient` ( LOCK TABLES `drink_has_ingredient` WRITE; /*!40000 ALTER TABLE `drink_has_ingredient` DISABLE KEYS */; +INSERT INTO `drink_has_ingredient` VALUES (26427,'Angostura bitters'),(3214,'club soda'),(6363,'coffee liqueur'),(46,'Cola'),(984,'Cola'),(6363,'cream'),(46,'Gin'),(984,'Gin'),(984,'Lemon juice'),(46,'Lemon slice'),(3214,'lime'),(3214,'mint'),(3214,'rum'),(46,'Silver tequila'),(984,'Silver tequila'),(3214,'sugar'),(26427,'sugar'),(46,'Sweet and sour mix'),(46,'Triple sec'),(984,'Triple sec'),(6363,'vodka'),(26427,'whiskey'),(46,'White rum'),(984,'White rum'); /*!40000 ALTER TABLE `drink_has_ingredient` ENABLE KEYS */; UNLOCK TABLES; @@ -151,6 +156,7 @@ CREATE TABLE `food` ( LOCK TABLES `food` WRITE; /*!40000 ALTER TABLE `food` DISABLE KEYS */; +INSERT INTO `food` VALUES (2,'Κεφτεδάκια με πατάτες',NULL,450,'TRUE',8132),(4,'Κοτομπουκιές',NULL,NULL,'FALSE',4330),(6,'Γεμιστά','Λαχταριστές ντομάτες και πιπεριές γεμιστές',326,'TRUE',8),(8,'Κεφτεδάκια με πατάτες',NULL,NULL,'FALSE',8),(48,'Burger','Είναι σαν να τρως αέρα!',1821,'TRUE',15),(68,'Μπριζολάκια','Χοιρινές μπριζόλες ξεροψημένες!',NULL,'FALSE',8132),(73,'Τυροκαυτερή','Η καλύτερη συνοδεία για τα τηγανητά κολοκυθάκια',276,'TRUE',8132),(124,'Γεμιστά','Παραδοσιακό ελληνικό πιάτο',392,'TRUE',4330),(478,'Πατσάς με σκορδοστούμπι','Ένα πιάτο που θυμίζει πολύ χωριό',450,'TRUE',4330),(548,'Fish&Chips','Μία γεύση από Αγγλία',840,'TRUE',7365); /*!40000 ALTER TABLE `food` ENABLE KEYS */; UNLOCK TABLES; @@ -177,6 +183,7 @@ CREATE TABLE `food_has_ingredient` ( LOCK TABLES `food_has_ingredient` WRITE; /*!40000 ALTER TABLE `food_has_ingredient` DISABLE KEYS */; +INSERT INTO `food_has_ingredient` VALUES (2,'αλάτι'),(6,'αλάτι'),(8,'αλάτι'),(124,'αλάτι'),(548,'αλάτι'),(2,'κιμάς'),(8,'κιμάς'),(124,'κιμάς'),(6,'κουκουνάρι'),(2,'κρεμμύδι'),(124,'κρεμμύδι'),(2,'λάδι'),(6,'λάδι'),(8,'λάδι'),(124,'λάδι'),(548,'λάδι'),(8,'μαϊντανός'),(124,'μαϊντανός'),(478,'μοσχαρίσια πόδια'),(478,'μπούκοβο'),(6,'ντομάτα'),(8,'ντομάτα'),(124,'ντομάτα'),(2,'πατάτα'),(8,'πατάτα'),(548,'πατάτα'),(6,'πιπεριά'),(124,'πιπεριά'),(6,'ρύζι'),(124,'ρύζι'),(478,'σκόρδο'),(548,'ψάρι'); /*!40000 ALTER TABLE `food_has_ingredient` ENABLE KEYS */; UNLOCK TABLES; @@ -201,6 +208,7 @@ CREATE TABLE `ingredient` ( LOCK TABLES `ingredient` WRITE; /*!40000 ALTER TABLE `ingredient` DISABLE KEYS */; +INSERT INTO `ingredient` VALUES ('Angostura bitters',_binary ''),('club soda',_binary '\0'),('coffee liqueur',_binary '\0'),('Cola',_binary '\0'),('cream',_binary '\0'),('Gin',_binary ''),('Lemon juice',_binary '\0'),('Lemon slice',_binary '\0'),('lime',_binary '\0'),('mint',_binary '\0'),('rum',_binary ''),('Silver tequila',_binary ''),('sugar',_binary '\0'),('Sweet and sour mix',_binary '\0'),('Triple sec',_binary ''),('vodka',_binary ''),('whiskey',_binary ''),('White rum',_binary ''),('αλάτι',_binary '\0'),('κιμάς',_binary '\0'),('κουκουνάρι',_binary '\0'),('κρεμμύδι',_binary '\0'),('λάδι',_binary '\0'),('μαϊντανός',_binary '\0'),('μοσχαρίσια πόδια',_binary '\0'),('μπούκοβο',_binary '\0'),('ντομάτα',_binary '\0'),('πατάτα',_binary '\0'),('πιπεριά',_binary '\0'),('ρύζι',_binary '\0'),('σκόρδο',_binary '\0'),('ψάρι',_binary '\0'); /*!40000 ALTER TABLE `ingredient` ENABLE KEYS */; UNLOCK TABLES; @@ -225,6 +233,7 @@ CREATE TABLE `permission` ( LOCK TABLES `permission` WRITE; /*!40000 ALTER TABLE `permission` DISABLE KEYS */; +INSERT INTO `permission` VALUES (2,'Μπορεί να προτείνει νέα δίαιτα'),(4,'Μπορεί να προσθέσει πιάτο χωρίς έγκριση'),(8,'Μπορεί να εγκρίνει κατάστημα'),(16,'Μπορεί να αξιολογήσει καταστήματα'),(32,'Μπορεί να αξιολογήσει ποτό'),(64,'Μπορεί να κάνει ban χρήστη'); /*!40000 ALTER TABLE `permission` ENABLE KEYS */; UNLOCK TABLES; @@ -258,6 +267,7 @@ CREATE TABLE `restaurant` ( LOCK TABLES `restaurant` WRITE; /*!40000 ALTER TABLE `restaurant` DISABLE KEYS */; +INSERT INTO `restaurant` VALUES (7,'U Fleků','pub',40.6357,22.9367,'18:00:00','04:00:00',_binary '\0',NULL),(8,'Σ σύγχρονα εστιατόρια','restaurant',40.6173,22.9597,'12:00:00','22:00:00',_binary '',NULL),(9,'U Fleků Garden','pub',40.6354,22.937,'18:00:00','02:00:00',_binary '',NULL),(15,'McDonald\'s','fast_food',40.6463,22.9206,'12:00:00','23:59:00',_binary '',12),(129,'Grill 15','fast_food',40.6215,22.961,'12:00:00','01:30:00',_binary '\0',NULL),(236,'Butterflies and Hurricanes','cafeteria',40.6147,22.9609,'08:00:00','20:00:00',_binary '',356),(683,'The Hoppy Pub','pub',40.6279,22.9489,'17:30:00','01:30:00',_binary '',NULL),(768,'Belleville sin patron','bar',40.6337,22.9518,'12:00:00','02:00:00',_binary '',7),(1356,'Αιθερόπλοο','pub',40.6144,22.9598,'08:00:00','02:00:00',_binary '',356),(4330,'Οδυσσέας','restaurant',40.6369,22.9534,'12:30:00','18:00:00',_binary '',24788),(6211,'Pulp','bar',40.6321,22.9479,'09:00:00','23:59:00',_binary '',NULL),(7365,'McDonald\'s','fast_food',40.5745,22.9715,'12:00:00','23:59:00',_binary '',NULL),(8132,'Γιαννούλα','restaurant',40.64,22.9468,'13:30:00','01:00:00',_binary '',1566); /*!40000 ALTER TABLE `restaurant` ENABLE KEYS */; UNLOCK TABLES; @@ -283,6 +293,7 @@ CREATE TABLE `role` ( LOCK TABLES `role` WRITE; /*!40000 ALTER TABLE `role` DISABLE KEYS */; +INSERT INTO `role` VALUES (0,'user','Απλός χρήστης'),(1,'moderator','Διαχειριστής'),(2,'owner','Ιδιοκτήτης'); /*!40000 ALTER TABLE `role` ENABLE KEYS */; UNLOCK TABLES; @@ -309,6 +320,7 @@ CREATE TABLE `role_has_permission` ( LOCK TABLES `role_has_permission` WRITE; /*!40000 ALTER TABLE `role_has_permission` DISABLE KEYS */; +INSERT INTO `role_has_permission` VALUES (2,4),(1,8),(0,16),(0,32),(1,64); /*!40000 ALTER TABLE `role_has_permission` ENABLE KEYS */; UNLOCK TABLES; @@ -326,6 +338,7 @@ CREATE TABLE `user` ( `user_hashed_password` char(64) NOT NULL, `user_salt` char(32) NOT NULL, `role_id` int(11) NOT NULL, + `user_age` date NOT NULL, PRIMARY KEY (`user_id`), UNIQUE KEY `user_id_UNIQUE` (`user_id`), KEY `user_is_role_id_idx` (`role_id`), @@ -339,6 +352,7 @@ CREATE TABLE `user` ( LOCK TABLES `user` WRITE; /*!40000 ALTER TABLE `user` DISABLE KEYS */; +INSERT INTO `user` VALUES (7,'gardenia@kyuss.com','Γαρδένιος ο Stoner','A8F08F6BE2B5F7280BFB0EF42850C7AF7DC9F9512655DF960F2CEE86A8734092','cd42e1cafe678f9473e05af4540a92cb',0,'1995-03-25'),(9,'waves@naxatras.gr','johny2012','A2D5D620335018723BCFFE6469CEABCC75B72C180BAD8637B220C43185D28B7A','0AB4E80109BF647D1BD2FA67833E3E30',1,'1983-09-15'),(12,'amail@yahoo.com','marika','97BB101F9ECF31FFD3788D77C1A02C431C1607E8168AAA53E38A89D445324428','e8413a21fbfef293ed80ec5ac0864ab9',0,'1976-10-12'),(215,'mongoose@fumanchu.com','Μαγκούστα','95BDEEACDAE5B9E371976D84387194DE83EB5F58AB7EAF4F4CD533925E9CDB3B','c7bcc1683f9a415188d9cb9bba8023df',0,'1978-11-02'),(356,'nonexistent@noidea.bn','Ανύπαρκτος','09986D06B9EABA0200318069CD372659C6036E2B9F0B1D44083F438E5DDE5821','vjp4a15w7n6806fmhe3x45qxz988xxql',2,'1992-04-14'),(666,'the_trooper@iron.maiden.uk','eddie lives inside you','B87814E1BBF9D5862653659D9EE77F9F9F44A3B88CBDEA4A56A97796F19CE817','f361b8aa332b67eb99c7bb5abcfb33b5',0,'1975-12-25'),(1566,'iamanonymous@not.your.buisness.ελ','Ανώνυμος','5F4783987A5E5B9B2D7FBA6BA5D8879A6EA94D24CE374570BD74CFF205D2E552','7g2pnmg118k9h4h5zphkntixwb4wtyn8',2,'1987-06-23'),(8756,'godzilla@fumanchu.com','Ms Godzila','E9295989293B86B016200A8FFB37F74443BF478BFCEC36266105E83C4455DFBF','5070b798b96b6038d75c0cbf8ae13cb8',1,'1994-08-20'),(24788,'somebody@gmail.com','κάποιος','7D148308053C85B038157848103489FCCFAA628044BC36427EEED94AD2B70E4F','05a700266be1bf1b84dd2c7c4a19f097',2,'1989-03-28'),(75813,'desert_cruiser@truckfighters.se','Νταλίκας','20AE282A6814EF1865E7EDD8D379281001F6E7AA4F8378DA26B6AB0187D61500','43f7cc8bec190e0c20fc2a13cd3dab86',0,'2001-12-24'); /*!40000 ALTER TABLE `user` ENABLE KEYS */; UNLOCK TABLES; @@ -365,6 +379,7 @@ CREATE TABLE `user_follows_diet` ( LOCK TABLES `user_follows_diet` WRITE; /*!40000 ALTER TABLE `user_follows_diet` DISABLE KEYS */; +INSERT INTO `user_follows_diet` VALUES (1566,2),(12,18),(1566,18); /*!40000 ALTER TABLE `user_follows_diet` ENABLE KEYS */; UNLOCK TABLES; @@ -391,6 +406,7 @@ CREATE TABLE `user_prohibits_ingredient` ( LOCK TABLES `user_prohibits_ingredient` WRITE; /*!40000 ALTER TABLE `user_prohibits_ingredient` DISABLE KEYS */; +INSERT INTO `user_prohibits_ingredient` VALUES (356,'club soda'),(12,'μπούκοβο'),(12,'σκόρδο'); /*!40000 ALTER TABLE `user_prohibits_ingredient` ENABLE KEYS */; UNLOCK TABLES; @@ -421,6 +437,7 @@ CREATE TABLE `user_rates_drink` ( LOCK TABLES `user_rates_drink` WRITE; /*!40000 ALTER TABLE `user_rates_drink` DISABLE KEYS */; +INSERT INTO `user_rates_drink` VALUES (12,3214,4,'2018-12-17',NULL,'medium'),(12,6363,5,'2018-07-08','Τέλειο!!1',NULL),(215,3214,5,'2018-05-01',NULL,NULL),(356,26427,2,'2018-06-28','Μετριότης κύριοι.','small'); /*!40000 ALTER TABLE `user_rates_drink` ENABLE KEYS */; UNLOCK TABLES; @@ -451,6 +468,7 @@ CREATE TABLE `user_rates_food` ( LOCK TABLES `user_rates_food` WRITE; /*!40000 ALTER TABLE `user_rates_food` DISABLE KEYS */; +INSERT INTO `user_rates_food` VALUES (215,548,1,'2018-09-07',NULL,'small'),(1566,124,2,'2018-08-20',NULL,'medium'),(8756,124,3,'2018-11-11','Μέτριο',NULL),(8756,478,5,'2018-03-25','Πολύ γευστικό',NULL); /*!40000 ALTER TABLE `user_rates_food` ENABLE KEYS */; UNLOCK TABLES; @@ -468,6 +486,7 @@ CREATE TABLE `user_rates_restaurant` ( `rating_grade` int(11) NOT NULL, `rating_date` date NOT NULL, `rating_text` varchar(150) DEFAULT NULL, + `rating_accessibility` enum('easy','moderate','hard') DEFAULT NULL, PRIMARY KEY (`user_id`,`restaurant_id`), KEY `user_rates_restaurant_id_idx` (`restaurant_id`), KEY `user_rates_restaurant_with_diet_id_idx` (`diet_id`), @@ -483,6 +502,7 @@ CREATE TABLE `user_rates_restaurant` ( LOCK TABLES `user_rates_restaurant` WRITE; /*!40000 ALTER TABLE `user_rates_restaurant` DISABLE KEYS */; +INSERT INTO `user_rates_restaurant` VALUES (215,4330,18,5,'2018-10-02','Χορταστικό φαΐ!','hard'),(215,6211,NULL,4,'2018-04-04','','hard'),(356,4330,NULL,4,'2018-09-16',NULL,NULL),(24788,1356,NULL,5,'2018-06-08','Φιλικότατο προσωπικό!','moderate'),(24788,4330,2,3,'2018-01-04','Λίγες επιλογές για διαβητικούς.',NULL); /*!40000 ALTER TABLE `user_rates_restaurant` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -495,4 +515,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2018-11-27 12:59:34 +-- Dump completed on 2018-12-21 13:32:09 diff --git a/Database implementation/queries/query_1.sql b/Database implementation/queries/query_1.sql new file mode 100644 index 0000000..cf6ac4d --- /dev/null +++ b/Database implementation/queries/query_1.sql @@ -0,0 +1,31 @@ +SELECT * +FROM ( + SELECT restaurant_id, + restaurant_name, + restaurant_category, + restaurant_longitude, + restaurant_latitude, + restaurant_opening, + restaurant_closing, + restaurant_is_approved, + user_id, p.radius, + p.distance_unit + * DEGREES(ACOS(COS(RADIANS(p.latpoint)) + * COS(RADIANS(z.restaurant_latitude)) + * COS(RADIANS(p.longpoint - z.restaurant_longitude)) + + SIN(RADIANS(p.latpoint)) + * SIN(RADIANS(z.restaurant_latitude)))) AS distance + FROM flavours_without_borders.restaurant AS z + JOIN ( /* these are the query parameters */ + SELECT 22.953012 AS latpoint, 40.635502 AS longpoint, 0.7 AS radius, 111.045 AS distance_unit + ) AS p ON 1=1 + WHERE z.restaurant_latitude + BETWEEN p.latpoint - (p.radius / p.distance_unit) + AND p.latpoint + (p.radius / p.distance_unit) + AND z.restaurant_longitude + BETWEEN p.longpoint - (p.radius / (p.distance_unit * COS(RADIANS(p.latpoint)))) + AND p.longpoint + (p.radius / (p.distance_unit * COS(RADIANS(p.latpoint)))) + ) AS d +WHERE distance <= radius +ORDER BY distance +LIMIT 15 diff --git a/Database implementation/queries/query_11.sql b/Database implementation/queries/query_11.sql new file mode 100644 index 0000000..d119d95 --- /dev/null +++ b/Database implementation/queries/query_11.sql @@ -0,0 +1,6 @@ +SELECT permission.permission_description +FROM flavours_without_borders.user JOIN flavours_without_borders.role_has_permission + ON user.role_id = role_has_permission.role_id +JOIN flavours_without_borders.permission + ON role_has_permission.permission_id = permission.permission_id +WHERE user_id = 12 diff --git a/Database implementation/queries/query_12.sql b/Database implementation/queries/query_12.sql new file mode 100644 index 0000000..4dfd88b --- /dev/null +++ b/Database implementation/queries/query_12.sql @@ -0,0 +1,4 @@ +SELECT DISTINCT restaurant.restaurant_name +FROM flavours_without_borders.food JOIN flavours_without_borders.restaurant + ON food.restaurant_id = restaurant.restaurant_id +WHERE food.food_calories < 500 diff --git a/Database implementation/queries/query_2.sql b/Database implementation/queries/query_2.sql new file mode 100644 index 0000000..268e316 --- /dev/null +++ b/Database implementation/queries/query_2.sql @@ -0,0 +1,3 @@ +SELECT restaurant.restaurant_name +FROM flavours_without_borders.restaurant +WHERE restaurant_is_approved = FALSE diff --git a/Database implementation/queries/query_3.sql b/Database implementation/queries/query_3.sql new file mode 100644 index 0000000..f15db88 --- /dev/null +++ b/Database implementation/queries/query_3.sql @@ -0,0 +1,15 @@ +SELECT ingredient.ingredient_name, ingredient.ingredient_has_alcohol +FROM flavours_without_borders.user_follows_diet +JOIN flavours_without_borders.diet + ON user_follows_diet.diet_id = diet.diet_id +JOIN flavours_without_borders.diet_prohibits_ingredient + ON diet.diet_id = diet_prohibits_ingredient.diet_id +JOIN flavours_without_borders.ingredient + ON diet_prohibits_ingredient.ingredient_name = ingredient.ingredient_name +WHERE user_follows_diet.user_id = 12 +UNION +SELECT ingredient.ingredient_name, ingredient.ingredient_has_alcohol +FROM flavours_without_borders.user_prohibits_ingredient +JOIN flavours_without_borders.ingredient + ON user_prohibits_ingredient.ingredient_name = ingredient.ingredient_name +WHERE user_prohibits_ingredient.user_id = 12 diff --git a/Database implementation/queries/query_4.sql b/Database implementation/queries/query_4.sql new file mode 100644 index 0000000..193886b --- /dev/null +++ b/Database implementation/queries/query_4.sql @@ -0,0 +1,26 @@ +SELECT * +FROM flavours_without_borders.food +WHERE food.food_id NOT IN ( + SELECT food.food_id + FROM ( + SELECT ingredient.ingredient_name + FROM flavours_without_borders.user_follows_diet + JOIN flavours_without_borders.diet + ON user_follows_diet.diet_id = diet.diet_id + JOIN flavours_without_borders.diet_prohibits_ingredient + ON diet.diet_id = diet_prohibits_ingredient.diet_id + JOIN flavours_without_borders.ingredient + ON diet_prohibits_ingredient.ingredient_name = ingredient.ingredient_name + WHERE user_follows_diet.user_id = 12 + UNION + SELECT ingredient.ingredient_name + FROM flavours_without_borders.user_prohibits_ingredient + JOIN flavours_without_borders.ingredient + ON user_prohibits_ingredient.ingredient_name = ingredient.ingredient_name + WHERE user_prohibits_ingredient.user_id = 12 + ) AS z + JOIN flavours_without_borders.food_has_ingredient + ON z.ingredient_name = food_has_ingredient.ingredient_name + JOIN flavours_without_borders.food + ON food_has_ingredient.food_id = food.food_id +) diff --git a/Database implementation/queries/query_5.sql b/Database implementation/queries/query_5.sql new file mode 100644 index 0000000..cb4316f --- /dev/null +++ b/Database implementation/queries/query_5.sql @@ -0,0 +1,3 @@ +SELECT drink_name +FROM flavours_without_borders.drink +WHERE restaurant_id = 1356 diff --git a/Database implementation/queries/query_6.sql b/Database implementation/queries/query_6.sql new file mode 100644 index 0000000..1313dc6 --- /dev/null +++ b/Database implementation/queries/query_6.sql @@ -0,0 +1,4 @@ +SELECT ingredient_name +FROM flavours_without_borders.drink JOIN flavours_without_borders.drink_has_ingredient +ON drink.drink_id = drink_has_ingredient.drink_id +WHERE drink.drink_id = 6363 diff --git a/Database implementation/queries/query_7.sql b/Database implementation/queries/query_7.sql new file mode 100644 index 0000000..d35546f --- /dev/null +++ b/Database implementation/queries/query_7.sql @@ -0,0 +1,5 @@ +SELECT user.user_email +FROM flavours_without_borders.user_rates_restaurant +JOIN flavours_without_borders.user + ON user_rates_restaurant.user_id = user.user_id +WHERE restaurant_id = 4330 \ No newline at end of file diff --git a/Database implementation/queries/query_8.sql b/Database implementation/queries/query_8.sql new file mode 100644 index 0000000..eab6d47 --- /dev/null +++ b/Database implementation/queries/query_8.sql @@ -0,0 +1,3 @@ +SELECT AVG(user_rates_drink.rating_grade) +FROM flavours_without_borders.user_rates_drink +WHERE drink_id = 3214 \ No newline at end of file diff --git a/Database implementation/queries/query_9.sql b/Database implementation/queries/query_9.sql new file mode 100644 index 0000000..f285f2d --- /dev/null +++ b/Database implementation/queries/query_9.sql @@ -0,0 +1,6 @@ +SELECT user_follows_diet.diet_id, AVG(user_rates_restaurant.rating_grade) AS 'Average rating' +FROM flavours_without_borders.user_rates_restaurant +JOIN flavours_without_borders.user_follows_diet + ON user_rates_restaurant.diet_id = user_follows_diet.diet_id +WHERE user_follows_diet.user_id = 1566 AND restaurant_id = 4330 +GROUP BY user_follows_diet.diet_id \ No newline at end of file