0% found this document useful (0 votes)
5 views13 pages

Recepie Finder Project (Sohaib)

The document outlines the design and implementation of a Recipe Finder Database Management System, which allows users to manage recipes through a web interface. It details the database structure, including tables for users, recipes, ingredients, and categories, along with SQL implementation and sample queries. The conclusion highlights the system's achievements and suggests future improvements such as advanced filters and user login features.

Uploaded by

zalasonline2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views13 pages

Recepie Finder Project (Sohaib)

The document outlines the design and implementation of a Recipe Finder Database Management System, which allows users to manage recipes through a web interface. It details the database structure, including tables for users, recipes, ingredients, and categories, along with SQL implementation and sample queries. The conclusion highlights the system's achievements and suggests future improvements such as advanced filters and user login features.

Uploaded by

zalasonline2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Project Title: Design and Implementation of

a Recipe Finder Database Management


System

Name Sohaib Arshid


Roll number F23-0215
Subject Database
Program BS AI (4th)
Section A
Table of Contents

1. Introduction--------------------------------------------------------------------3

1.1. Purpose of the project-------------------------------------------------3

1.2. Importance of databases in healthcare-----------------------------3

2. Objectives----------------------------------------------------------------------4

3. Tools & Technologies--------------------------------------------------------4

4. Database Design--------------------------------------------------------------5

5. ERD Diagram-----------------------------------------------------------------6

6. SQL Implementation---------------------------------------------------------7

7. Sample Queries---------------------------------------------------------------8

8. Conclusion---------------------------------------------------------------------9

8.1. Summary of what was achieved--------------------------------------9

8.2. Limitations and future improvements-------------------------------9


• Introduction:

Purpose of the Project

The project aims to create a digital platform where users can add, browse, and manage recipes
through a simple web interface. It offers features like ingredient listing, user accounts, and recipe
categorization for easy access and organization.

Importance of Databases

A well-structured database ensures efficient storage, retrieval, and management of recipe data. It
maintains relationships between users, recipes, and categories, enabling smooth and accurate
operation of the platform.

• Objectives:
➢ To design a relational database structure for recipe management
➢ To implement data operations using SQL
➢ To provide a UI for interacting with the database using Node.js and Express.js
➢ To categorize recipes using a many-to-many relationship model
➢ To test database integrity through meaningful queries

• Tools & Technologies:


1. MySQL or any relational database system.
2. SQL Workbench or command-line interface.
3. HTML, CSS, JavaScript for UIHTML, CSS, JavaScript for UI.
4. Node.js and express.js to connect frontend with SQL.
5. Operating System: Windows/Linux/Mac.
6. Minimum 4GB RAM and MySQL Server.

• Database design:
The database includes five core tables:
- Users
- Recipes
- Ingredients
- Categories
- RecipeCategories (for many-to-many mapping)
Each table is linked through primary and foreign key constraints. The structure is simple and
easy to understand. There is a main Database and then there are 5 tables in that database.

• ER diagram:
The ER Diagram represents the relationships among the five main entities in the system.

• SQL Implementation
The database is implemented using SQL commands such as CREATE TABLE, INSERT
INTO, and SELECT. Primary keys, foreign keys, and constraints are defined to enforce data
integrity.

SQL Code:
-- Create Database
CREATE DATABASE RecipeFinder;
USE RecipeFinder;
USE RecipeFinder;

CREATE TABLE Users (


UserID INT PRIMARY KEY,
Name VARCHAR(100),
Email VARCHAR(100),
Password VARCHAR(100)
);

CREATE TABLE Recipes (


RecipeID INT PRIMARY KEY,
Title VARCHAR(100),
Description TEXT,
UserID INT,
FOREIGN KEY (UserID) REFERENCES Users(UserID)
);

CREATE TABLE Ingredients (


IngredientID INT PRIMARY KEY,
Name VARCHAR(100),
Quantity VARCHAR(50),
RecipeID INT,
FOREIGN KEY (RecipeID) REFERENCES Recipes(RecipeID)
);

CREATE TABLE Categories (


CategoryID INT PRIMARY KEY,
CategoryName VARCHAR(100)
);

CREATE TABLE RecipeCategories (


RCID INT PRIMARY KEY,
RecipeID INT,
CategoryID INT,
FOREIGN KEY (RecipeID) REFERENCES Recipes(RecipeID),
FOREIGN KEY (CategoryID) REFERENCES Categories(CategoryID)
);

INSERT INTO Users VALUES


(1, 'Ali Khan', '[email protected]', 'pass123'),
(2, 'Sara Malik', '[email protected]', 'abc123'),
(3, 'Umer Javed', '[email protected]', 'xyz789'),
(4, 'Nida Farooq', '[email protected]', 'nida456'),
(5, 'Zain Ahmad', '[email protected]', 'zain789'),
(6, 'Fatima Ali', '[email protected]', 'fatima123'),
(7, 'Adeel Sheikh', '[email protected]', 'adeel321'),
(8, 'Hira Munir', '[email protected]', 'hira456'),
(9, 'Bilal Shah', '[email protected]', 'bilal789'),
(10, 'Komal Raza', '[email protected]', 'komal987');

INSERT INTO Recipes VALUES


(1, 'Chicken Biryani', 'Spicy layered rice with chicken', 1),
(2, 'Beef Karahi', 'Beef cooked in tomatoes and spices', 2),
(3, 'Aloo Paratha', 'Flatbread stuffed with potatoes', 3),
(4, 'Chicken Curry', 'Chicken in creamy masala gravy', 4),
(5, 'Daal Chawal', 'Lentils served with rice', 5),
(6, 'Palak Paneer', 'Spinach with paneer cubes', 6),
(7, 'Kheer', 'Sweet rice dessert', 7),
(8, 'Pulao', 'Rice cooked with mild spices', 8),
(9, 'Haleem', 'Slow-cooked meat and grains', 9),
(10, 'Chapli Kebab', 'Minced meat spicy patties', 10);

INSERT INTO Ingredients VALUES


(1, 'Chicken', '500g', 1),
(2, 'Rice', '2 cups', 1),
(3, 'Beef', '1 kg', 2),
(4, 'Potato', '2 pieces', 3),
(5, 'Flour', '1 cup', 3),
(6, 'Lentils', '1 cup', 5),
(7, 'Spinach', '250g', 6),
(8, 'Milk', '1 liter', 7),
(9, 'Sugar', '1 cup', 7),
(10, 'Minced Meat', '500g', 10);

INSERT INTO Categories VALUES


(1, 'Main Course'),
(2, 'Breakfast'),
(3, 'Dessert'),
(4, 'Vegetarian'),
(5, 'Non-Vegetarian'),
(6, 'Traditional'),
(7, 'Healthy'),
(8, 'Spicy'),
(9, 'Rice Dishes'),
(10, 'Snacks');

INSERT INTO RecipeCategories VALUES


(1, 1, 1),
(2, 1, 9),
(3, 2, 1),
(4, 3, 2),
(5, 4, 1),
(6, 5, 4),
(7, 6, 4),
(8, 7, 3),
(9, 8, 9),
(10, 10, 10);

SELECT * FROM Recipes;


Here is the code that I have written to create the database and fill the data in the database.
The screenshots of the code are as follows.

• Creating database:

• Creating tables in this database


• Creating table “Users”:

• Creating table “recipes”:


• Creating table “ingredients”:

• Creating table “categories”:

• Creating table “RecepieCategories”:

Now putting values in the tables.


• Putting data in “Users”:
• Putting data in “Recipes”:

• Filling data in “ingredients”:

• Filling data into “categories”:

• Filling data into “recepieCategories”:


All the tables in the database are.

The screenshots of web based graphical user interface are as follows.

Here the data is being extracted from the database and being shown here.
• Sample Queries:

SELECT * FROM Categories;


SELECT * FROM Ingredients;
SELECT * FROM RecipeCategories;
SELECT * FROM recipes;
SELECT * FROM Users;
CREATE TABLE Users;

• Conclusion:
Summary of What Was Achieved:
The Recipe Finder Database Management System effectively stores and retrieves recipe data,
user details, ingredients, and associated categories. A frontend connected via Node.js allows easy
interaction with the backend system.
Limitations and Future Improvements:
The current implementation covers core functionalities. Future improvements could include
advanced filters, user login features, rating systems, and real-time recommendations based on
category preferences.
.

You might also like