DBMS Sbid PDF
DBMS Sbid PDF
The user interface design for the Fitness Management System (FMS) is crucial for
providing a seamless and intuitive experience for all user types - members, trainers, and
administrators. The following diagrams illustrate the key screens and flows within the
application.
1. LOGIN SCREEN
This diagram depicts the login process for the FMS application. Users have three
different options to log in: as a Member, Trainer, or Admin. Depending on the user type
selected, they are directed to the corresponding login screen, which then leads them to
their respective dashboards or portals.
2. MEMBER DASHBOARD FLOW
This diagram outlines the different functionalities available to members within the FMS
application. From the Member Dashboard, users can access various features, such as
viewing their profile, booking a fitness session, checking their workout logs, reviewing
their diet plan, and making payments.
This diagram shows the various features available to trainers within the FMS
application. Trainers can access their schedule, manage members assigned to them,
create and assign diet plans, and track the progress of their members.
4. ADMIN CONSOLE FLOW
This diagram outlines the administrative features available in the FMS application.
Admins can access the Member Management, Trainer Management, Payment
Overview, and Reporting functionalities.
DATA TYPES AND THEIR DESCRIPTION
-- Member Table
CREATE TABLE Member (
Member_ID INT AUTO_INCREMENT PRIMARY KEY,
Name VARCHAR(100) NOT NULL,
Address VARCHAR(255),
Phone VARCHAR(15),
Email VARCHAR(100) UNIQUE,
Membership_Status ENUM('Active', 'Inactive') DEFAULT 'Active'
);
-- Insert sample Members
INSERT INTO Member (Name, Address, Phone, Email, Membership_Status) VALUES
('John Doe', '123 Maple St', '555-1234', '[email protected]', 'Active'),
('Jane Smith', '456 Oak St', '555-5678', '[email protected]', 'Active'),
('Mike Johnson', '789 Pine St', '555-9012', '[email protected]', 'Inactive'),
('Emily Davis', '101 Cedar St', '555-3456', '[email protected]', 'Active'),
('Sarah Brown', '102 Walnut St', '555-7890', '[email protected]', 'Active'),
('David Wilson', '103 Chestnut St', '555-2345', '[email protected]', 'Inactive'),
('Linda Martinez', '104 Birch St', '555-6789', '[email protected]', 'Active'),
('James Anderson', '105 Elm St', '555-4321', '[email protected]', 'Inactive'),
('Patricia Taylor', '106 Spruce St', '555-8765', '[email protected]', 'Active'),
('Robert Thomas', '107 Willow St', '555-2109', '[email protected]', 'Active');
-- Select all members
SELECT * FROM Member;
OUTPUT :
MEMBERS TABLE
-- Trainer Table
CREATE TABLE Trainer (
Trainer_ID INT AUTO_INCREMENT PRIMARY KEY,
Name VARCHAR(100) NOT NULL,
Specialty VARCHAR(50),
Contact VARCHAR(15)
);
-- Insert sample Trainers
INSERT INTO Trainer (Name, Specialty, Contact) VALUES
('Alex Turner', 'Strength Training', '555-6789'),
('Maria Johnson', 'Yoga', '555-2345'),
('Chris White', 'Cardio', '555-1234'),
('Jessica King', 'Nutrition', '555-5678'),
('David Scott', 'CrossFit', '555-3456'),
('Emma Stone', 'Pilates', '555-9012'),
('John Reed', 'Endurance', '555-7890'),
('Sophia Lee', 'Aerobics', '555-2109'),
('William Carter', 'Bodybuilding', '555-8765'),
('Isabella Perez', 'Zumba', '555-4321');
-- Select all trainers
SELECT * FROM Trainer;
OUTPUT :
TRAINER TABLE
-- Admin Table
CREATE TABLE Admin (
Admin_ID INT AUTO_INCREMENT PRIMARY KEY,
Username VARCHAR(50) UNIQUE NOT NULL,
Password VARCHAR(255) NOT NULL -- Make sure to hash passwords in the
application layer
);
-- Insert sample Admins
INSERT INTO Admin (Username, Password) VALUES
('admin1', 'hashed_password_1'),
('admin2', 'hashed_password_2'),
('admin3', 'hashed_password_3'),
('admin4', 'hashed_password_4'),
('admin5', 'hashed_password_5'),
('admin6', 'hashed_password_6'),
('admin7', 'hashed_password_7'),
('admin8', 'hashed_password_8'),
('admin9', 'hashed_password_9'),
('admin10', 'hashed_password_10');
-- Select all admins
SELECT * FROM Admin;
OUTPUT :
ADMIN TALE
-- Workout_Log Table
CREATE TABLE Workout_Log (
Log_ID INT AUTO_INCREMENT PRIMARY KEY,
Member_ID INT,
Date DATE,
Exercise VARCHAR(50),
Sets INT,
Reps INT,
Weight DECIMAL(5, 2),
FOREIGN KEY (Member_ID) REFERENCES Member(Member_ID) ON DELETE
CASCADE
);
-- Insert sample Workout Logs
INSERT INTO Workout_Log (Member_ID, Date, Exercise, Sets, Reps, Weight) VALUES
(1, '2023-01-10', 'Bench Press', 4, 10, 50.0),
(2, '2023-01-12', 'Squats', 4, 12, 80.0),
(3, '2023-01-14', 'Deadlift', 3, 8, 100.0),
(4, '2023-01-16', 'Push-Ups', 5, 20, NULL),
(5, '2023-01-18', 'Pull-Ups', 3, 15, NULL),
(6, '2023-01-20', 'Lunges', 4, 12, 20.0),
(7, '2023-01-22', 'Bicep Curl', 3, 10, 15.0),
(8, '2023-01-24', 'Tricep Dip', 4, 12, NULL),
(9, '2023-01-26', 'Leg Press', 4, 10, 150.0),
(10, '2023-01-28', 'Shoulder Press', 3, 10, 30.0);
-- Select all workout logs
SELECT * FROM Workout_Log;
OUTPUT :
OUTPUT :
OUTPUT :
SESSION TABLE
-- Payment Table
CREATE TABLE Payment (
Payment_ID INT AUTO_INCREMENT PRIMARY KEY,
Member_ID INT,
Amount DECIMAL(10, 2),
Payment_Date DATE,
Payment_Type ENUM('Membership Fee', 'Session Booking'),
FOREIGN KEY (Member_ID) REFERENCES Member(Member_ID) ON DELETE
CASCADE
);
-- Insert sample Payments
INSERT INTO Payment (Member_ID, Amount, Payment_Date, Payment_Type)
VALUES
(1, 100.00, '2023-01-05', 'Membership Fee'),
(2, 20.00, '2023-01-15', 'Session Booking'),
(3, 100.00, '2023-02-05', 'Membership Fee'),
(4, 30.00, '2023-02-12', 'Session Booking'),
(5, 50.00, '2023-02-20', 'Session Booking'),
(6, 100.00, '2023-03-01', 'Membership Fee'),
(7, 40.00, '2023-03-05', 'Session Booking'),
(8, 100.00, '2023-03-10', 'Membership Fee'),
(9, 35.00, '2023-03-15', 'Session Booking'),
(10, 50.00, '2023-03-20', 'Session Booking');
-- Select all payments
SELECT * FROM Payment;
OUTPUT :
PAYMENT TABLE
PLANNING AND IMPLEMENTING REFERENTIAL INTEGRITY
-- Delete a member and cascade delete related records in Workout_Log, Diet_Plan, and
Payment tables
DELETE FROM Member WHERE Member_ID = 1;
-- Delete a trainer and cascade delete related records in Diet_Plan and Session tables
DELETE FROM Trainer WHERE Trainer_ID = 2;
OUTPUT :