dbms report1
dbms report1
Report By:
Akileswar Reddy-AP23110011515
Karthik-AP23110011481
Muktesh Naidu-AP23110011476
Vishnu Vardhan-AP23110011483
Submitted on
TABLE OF CONTENTS
Project Background……………………………………………………………………3
Description of the Project……………………………………………………………...4
Objective
Overview
Key Features
Database Design
Benefits
ER Diagram…………………………………………………………………………...6
Description of ER diagram…………………………………………………………....7
Conversion of ER diagram into tables………………………………………….……..8
Description of Tables……………………………………………………………..…...9
Normalization of tables up to 3-NF……………………………………………….…10
SQL queries…….……………………………………………………………….……11
Joins
Aggregate functions
Grouping
Subqueries
Creation of views using tables…………………………………………………….…15
References...………………………………………………………………………….17
Project Background
This Pharmacy Database Management System is designed to be scalable and adaptable to the
growing needs of modern pharmacies, offering a reliable digital solution for pharmaceutical
data handling
Description of the Project
Objective:
The Pharmacy Database Management System is designed to efficiently manage the
operations of a pharmacy by handling customer transactions, drug inventory, employee
records, supplier interactions, and sales processes. This project aims to develop a robust and
scalable system that ensures accurate data storage, retrieval, and analysis for pharmacy
operations.
Overview:
Pharmacy management involves complex processes such as drug procurement, inventory
tracking, customer sales, and supplier management. Manual handling of these processes often
leads to errors, redundancy, and data loss. This project automates these tasks through a
relational database system that ensures data integrity, supports fast retrieval, and simplifies
pharmacy administration.
Key Features:
Customer Management:
Stores customer details including ID, name, and contact information.
Employee Management:
Records employee information such as name, age, gender, salary, and employee ID.
Sales Module:
Tracks sales made by employees to customers, including sale date, total amount, and sale
details.
Drug Inventory:
Manages data related to drugs including name, location, available quantity, price, expiry
date, and category.
Supplier & Purchase Management:
Maintains records of suppliers and details of drug purchases including quantities and
dates.
Manufacturer Details:
Keeps information about drug manufacturers, their names, and addresses.
Sales Details:
Provides detailed records of each sale including the drugs sold, their quantities, and
prices.
Database Design:
The system is modeled using an Entity-Relationship (ER) diagram which is translated into
relational tables. The design is normalized up to the Third Normal Form (3NF) to eliminate
redundancy and ensure data integrity. The tables include entities such as Customer,
Employee, Sale, Drug, Manufacturer, Supplier, Sale_Details, and Purchases, each with
appropriate primary and foreign key constraints.
Benefits:
Accurate and secure data management
Reduced manual effort and error
Faster query processing and reporting
Better inventory and sales tracking
Easy scalability and integration with pharmacy software systems
The Pharmacy Database Management System improves the efficiency and reliability of
pharmacy operations by organizing and automating the data handling processes. It serves as a
foundational model for pharmacy software solutions and can be extended with features like
billing systems, stock alerts, and analytics dashboards.
Entity Relationship Diagram (ER Diagram)
Description of ER diagram
A sale contains various drugs, and this relationship is detailed through the Sale_details entity,
which serves as a bridge between Sale and Drug and includes attributes such as quantity and
total price. The Drug entity holds information like drug ID, name, available quantity,
location, price per unit, expiry date, and category. Drugs are manufactured by manufacturers,
represented by the Manufacturer entity that includes the manufacturer name, ID, and address.
Furthermore, drugs are purchased from Suppliers, an entity that includes supplier ID, name,
email, and phone number. The purchase relationship contains additional details such as
purchase quantity and purchase date.
Overall, this ER diagram effectively illustrates the interactions between different components
of a pharmaceutical system, supporting processes from manufacturing and supplying to
selling and managing customer data. It ensures clear relationships between entities and
provides a robust framework for storing and managing pharmaceutical transaction records.
Conversion of ER diagram into tables
SQL queries
Joins:
1. Customer and their sales
SELECT c.Name, s.SaleID, s.Total_amount, s.SaleDate
FROM customer c
JOIN sale s ON c.customerid = s.customerid;
4. Employee-wise sales
SELECT e.Name AS Employee, s.SaleID, s.Total_amount
FROM employee e
JOIN sale s ON e.EMPID = s.EMPID;
Online References:
1. GeeksforGeeks – ER Model
Website: geeksforgeeks.org
Explanation with diagrams, types of relationships, and ER components.
2. TutorialsPoint – DBMS ER Model
Website: tutorialspoint.com
Simple explanations with visuals and examples.
3. W3Schools – DBMS ER Diagram
Website: w3schools.com
Good for beginners with step-by-step concepts.
4. YouTube Channels
Gate Smashers and Neso Academy offer great video tutorials on ER diagrams and DBMS
concepts.