Database Management
Contents
TOC o “1-3” h z u Introduction PAGEREF _Toc381006546 h 1How Energy auditing Database works PAGEREF _Toc381006547 h 1Entity relationship diagram (ERD) of Persons’ data PAGEREF _Toc381006548 h 3Entity relationship diagram (ERD) Workout sessions PAGEREF _Toc381006549 h 5
Introduction
Today, nearly everyone in across the world would love to store their information in the database to keep track of everyday activities. Organizations are also not left behind in operating their businesses by storing their information on databases. Databases are designed in a way they offer organized mechanisms for storage, managing and retrieving information. The data are stored and organized in different tables by the use of Microsoft Excel or using Structured Query Languages (SQL). Most people have implemented systems that are integrated with databases since they have recognized databases to be the best method of storing and retrieving information that may be of help in the future. For that case, this paper will analyze how energy auditing database can be created and how it will keep track of personal workout history for fitness focused individual using Visio or Entity relationship assistant to create Entity Relationship Diagram (ERD).
How Energy auditing Database works
The database created will keep track of the people personal workout history for fitness focused individual. Each data of persons’ entities and attributes will be entered in the database to keep track of every activity one does, making one entity to be the key identifier of the table of persons created (primary key). When creating the energy auditing database, the three Entity Relationship model are used, such as the entities, attributes and relationships. Entities in this case involve things used to seek information. In this case, there are various entities that includes; the data/information, client, and the exercises done. The attributes tends to be the data collected regarding the entities, and relationship on the other hand, provides the structure that is required for drawing information from multiple entities.
The energy auditing database will work in a way that it will allow a person to feed in the information. The information entered will mainly involve the workout sessions that are tracked over time to help clients in identifying exercises performed at particular sessions. The information entered in the database could also help the clients in calculating their monthly aggregate workout statistics in order to allow individuals to track ones’ personal fitness as well as giving them the ability of spotting trends in weight lifting strength and cardiovascular activities. Database securities will also be enabled to limit the number of people without authentications to view or alter with the data in the system.
Securities in databases have become the main issues in most organization; some people tend to hack the systems to change the information that are already in the database making the database to differ from other sections of departments. It is therefore necessary for the database created to have SQL injections to control hackers from hacking the system, and therefore, the database should be tested to determine whether it is vulnerable to SQL injection attack. The database should allow the auditor to easily add or delete data within the system. The first step is to create tables in Energy auditing database. The first table created is the client table where, the client is able to give the identification Number, his/her FirstName, LastName, Address and the City. The syntax is;
CREATE TABLE Person(P_Id int, (Primary Key)LastName varchar (50),FirstName varchar (50),Address varchar (50), City varchar (50))
Entity relationship diagram (ERD) of Persons’ dataThe ERD diagram allows the client to enter his/her information in the database. The attribute ID_no is the primary key in this case. This ERD is many-to-one given that different clients can only enter one attribute of themselves one at a time. The client can only enter one LastName, FirstName and ID_no, since the database limits the number of datatype in each table. The data entered in the database will also help the client to find information concerning them.
Person
Enters
LastNameFirstNameID No
After the client information is entered into the database, the client is able to create other tables in the database which will be used for storing their information regarding different workouts, type of exercises, Exercise name, sets, duration, weight setting, and units of measurements for every exercise type. The syntax will be;
CREATE TABLE Workoutsessions(ExerciseWeightSetting int,TypeofExercise varcha r(50),ExerciseName varchar (50),ExerciseSets varchar (50), ExerciseDuration varchar (50)
ExerciseUnitsof Measurements varchar (50))
The above data/information will be inserted into persons’ table to match with the data in the table workout sessions. The syntax will be;
USE workoutsessiontableindatabase;
INSERT INTO Persons’
VALUES (“ExerciseWeightSetting”);
INSERT INTO Persons’
VALUES (“TypeofExercise” );
INSERT INTO Persons’
VALUES (“ExerciseName”);
INSERT INTO Persons’
VALUES (“ExerciseSets”);
INSERT INTO Persons’
VALUES (“ExerciseDuration”);
INSERT INTO Persons’
VALUES(“ExerciseUnitsof Measurements “);
Entity relationship diagram (ERD) Workout sessionsThe ERD diagram below shows the relationship between the Person and the workout sessions. Every exercises performed by the clients, data must be recorded, the type of exercise, the name of exercise, and duration of exercise taken by each individual has to be recorded in the database.
Person
Exercise Duration
Type of Exercise
Exercise Name
Enters