Date post: | 25-Jun-2015 |
Category: |
Technology |
Upload: | abhijeet-kalsi |
View: | 427 times |
Download: | 0 times |
1
Project Report
A mini Data Base Management System
Version 1.0
Team Members:
Abhijeet Singh Kalsi (MCA - III Semester)
Faculty Mentor:
Mr. Nilesh Kumar & Mrs. Ekata Gupta
College Name:
Guru Nanak Institute of Management
Affiliated to Guru Gobind Singh IndraPrastha University [GGSIPU]
2
ACKNOWLEDGEMENT
Exchange of ideas generates the new object to work in a better way whenever a person is
helped and cooperated by others his heart is bound to pay gratitude and obligation to
them. To develop a project is not a one-man show. It is essentially a collective work,
where every step taken with all precautions and care.
Therefore our first duty is to thanks all persons who provided me with basic help in
forming the outline and strategy for my humble effort.
We thank Mr. NILESH DOKANIA & Mrs. Ekata Gupta who gave us inspiration to do
work in this field and gave us her precious time whenever needed. Thanks may be matter
of merely formality but with us it is expression of heartfelt gratitude to our project
supervision. We are highly indebted for her gestures, invaluable suggestions and
boosting confidence to make this successful. The success of this work is mostly due to
her suitable guidance.
We also thank our class fellows and friends, who helped us a lot during our project work.
3
CERTIFICATE
This is to certify that the project entitled “myDB - 2010“ a mini Data
Base Management System prepared by Abhijeet Singh Kalsi for the
partial fulfillment of the requirements of the MCA degree, embodies
the work, we all are doing during 3th semester of our course under
due supervision of the supervisor from this college.
SIGNATURE:
[Mr. Nilesh Dokania] [Mrs. Ekata Gupta]
4
Table of Contents
S.No. Contents Page No.
1)
Introduction
1.1 Abstract
1.2 Purpose
1.3 Scope
1.4 Technologies used
1.5 System Requirement
1.5.1 Software
1.5.2 Hardware
5
2)
Description
2.1 Overall Description
2.2 Entity Relationship Diagram (ERD)
2.3 Class Diagram
2.4 Data Flow Diagram (DFD)
8
3)
Project Management
3.1 Software Process Model
3.2 Team structure
3.3 Project Plan
3.3.1 Risk Planning
3.3.2 Project Scheduling
14
4)
Command Syntax
5)
Design
Screen Shots
C++ Coding / Programming
18
6)
Source Code
26
7)
SYSTEM TESTING
6.1 PSYCHOLOGY OF TESTING
6.2 TESTING APPROACH
27
5
Chapter-1
INTRODUCTION
6
1) INTRODUCTION 1.1 ABSTRACT
The Aim of this project is to Design and Develop a mini Database Management
System (DBMS) a set of computer programs that controls the creation, maintenance, and the
use of a Database. A system software package that helps the use of integrated collection of
data records and files known as databases
Where End user can ask simple questions in a query language i.e. Structural
Query Language, SQL to Database System and system responds to its request of Database
through command line interface by the use of Relation Database Model. Queries allow the
user to describe desired data, leaving the DBMS responsible for planning, optimizing, and
performing the physical operations necessary to produce that result as it chooses.
By the use of programming language VC++ or Dev-C++ for writing programs but
not using of any database management system package already available in market.
1.2) PURPOSE New categories of data can be added to the database without disruption to the existing
system.
To have a CLI, Command Line Argument Interface, in which user fires/queries it
question to Database through a Structure Query Language SQL same as that of Oracle, MS
SQL, etc.
A feature of Data Definition Language (DDL): Specifies a new base relation by giving it a
name, and specifying each of its attributes and their data types. A constraint NOT NULL may
be specified on an attribute.
Feature of Data Manipulation Language (DML): To retrievals Data from Database and
Updates, Delete and Insert Records
1.3) SCOPE
Scope is to Add new features of DBMS like Join Table, Alter Table and some other
features of DBMS to have Better and efficient Database Package . User use questions in a
query language i.e. Structural Query Language, SQL to Database System and system responds
to its request of Database through command line interface by the use of Relation Database
Model.
7
1.4) TECHNOLOGY USED
Front End: Business Logic through C / C++.
Back End: Database Logic through C++ File Streams.
1.5) MINIMUM SYSTEM REQUIREMENT
1.5.1 Software Requirement
Compiler - Borland Turbo C.
Operating System - Win98/ME/Windows XP.
Graphics card - Direct 9X compatible Graphic.
Sound Card – DirectSound compatible sound card.
1.5.2 Hardware Requirement
Processor - Pentium 2 and above.
Memory - 64MB and above.
Storage - 10Mb Free Hard Drive Space (installed).
Color Monitor
Keyboard
A pair of Speakers
8
Chapter-2
Project Description
9
2.1) OVERALL DESCRIPTION
The Aim of this project is to Design and Develop a mini Database Management
System (DBMS) a set of computer programs that controls the creation, maintenance, and the
use of a Database. A system software package that helps the use of integrated collection of
data records and files known as databases
Where End user can ask simple questions in a query language i.e. Structural
Query Language, SQL to Database System and system responds to its request of Database
through command line interface by the use of Relation Database Model. Queries allow the
user to describe desired data, leaving the DBMS responsible for planning, optimizing, and
performing the physical operations necessary to produce that result as it chooses.
By the use of programming language VC++ or Dev-C++ for writing programs but
not using of any database management system package already available in market.
2.2) ENTITY RELATIONSHIP DIAGRAM (ERD)
An Entity Relation Diagram (E.R.D) is a graphical tool used to describe and
analyze the movement of data through the system-manual or automated-including
the Entities, the relations between different entities and the attributes of different
relations or attributes are the central tool and the basis from which other components
can be developed. While drawing the ERDs, the approach as given by Yourdon has
been followed. The Symbols used in the E.R.D are.
SYMBOL
MEANING
RELATIONS
ATTRIBUTES
ENTITIES
10
ENTITY RELATIONSHIP DIAGRAM
1 N
M
N
N
N
N
1
1
M
N 1
CLIENT
ID Password
DB FILES
Name Type Size
Creation
Date
DATABASE ADMINISTRATOR
Authenticates
SERVER
Inputs Data
Mode
Name Location ID Master password
Maintain
Stores
Controls
Space
Address
Name
Linked With
11
1.3) DATA FLOW DIAGRAM It is a pictorial representation of Business processes (functions/services/activities), along
with the data flow.
Software process:-Guides how the software is being built.
Business process:-Specific to organization, e.g.:- In this project; issuing ticket,
canceling ticket.
In this focus is on what data flows and not how the data flows. When all the analysis is
being made then we develop a diagram to depict the analysis, and following symbols are
being used:-
SYMBOL MEANING
Process
External Entity
Data Item
Data Store
12
DATA FLOW DIAGRAM
Level 0 DFD:-
Manages Database
DATABASE
MANAGEMENT SYSTEM
Send Queries
Retrieve Desire Data
CLIENT
DATABASE
ADMINSTRATOR
Design, Implements, Maintain & Repair
13
2.3) CLASS DIADGRAM
DBMS
_______________ len;
query[750];
cmd[25][30];
_______________ void query_input();
void trim();
void cmd_break();
int create_table();
int select_cmd();
int insert_into();
int update_cmd();
int drop_table();
int delete_record();
int desc_cmd();
void help();
void validator();
int identifier(int,int);
int datatype(int);
int constraint(int);
int integer(int);
int char_x(int,int);
_______________
ATTRIBUTE
_______________
att_name[20];
att_type[20];
att_const[20];
_______________
DATA ______________
Cell [20] [200]
_____________
14
Chapter - 3
PROJECT MANAGEMENT
15
Project Management
Project management includes planning, monitoring and control of people, process, tasks and
events that occur during the project development process. It is a very necessary activity for the
computer based projects. Project management process includes all those activities that run
during the whole duration of the project. The scope of the project management differs with the
person doing it. A software engineer manages his day to day activities, planning and monitoring
of its technical tasks. A project manager plans, monitors and controls the work of a team of
software engineer. Senior manager controls the interface between the business and the software
professionals. Building software being a complex task makes project management very important
part of software building process.
The management spectrum involves the focus on 4 P’s.
1.) People:-
It is base framework, defining the people management, recruitment,
selection, and training
2.) Product :-
Defining the objectives and scope
3.) Process:-
Defining the framework for activities
4.) Project:-
Management of project is the only defined way to manage the complexity
of the project.
3.1 Software Process Model:-
To solve actual problems in a project, a software engineer or a team of engineers
must incorporate a strategy that encompasses the process, methods and tools that are
focused on the software quality. This strategy is called as a process model or a software
engineering paradigm.
In this project we have used incremental model.
Incremental model:-In this model all the basic requirements of the clients are being studied
and first increment is delivered (also called as core product) and many supplementary
features remain undelivered. Then a plan is developed for the next increment while the first
increment is under review or evaluation by the user. Then the plan addresses the modification
of the core product focusing on other requirements of the user. This process is repeated until
all the requirements are not fulfilled. This can also be considered in a way that customer has
16
provided all his requirements and we divide it into phases. In this no integration is required as
the new increment is overwritten on the existing one.
3.2 Team Structure:- The team structure is DEMOCRATIC DECENTRALISED (DD). The team comprises of three
members:--
ABHIJEET SINGH KALSI
Decentralized teams generate better solutions and have greater probability of success when
working on different problems. DD team structure is best applies to programs with low
modularity.
Based on the difficulty of the problem to be solved relatively low modularity of the project and
high volume of the communication required a democratic decentralized team structure is
proposed. This software engineering team has no permanent leader. Rather, “task
coordinators are appointed for short duration and then replaced by others who may
coordinate different tasks.” Problem solving is a group activity. Communication among team
members is horizontal. Decentralized team generates more and better solutions than
individuals. Therefore such teams have a greater probability of success when working on
difficult problems.
3.3) PROJECT PLAN
Software planning involves estimating how much time, effort, money, and resources
will be required to build a specific software system. After the project scope is determined and the
problem is decomposed into smaller problems, software managers use historical project data (as
well as personal experience and intuition) to determine estimates for each. The final estimates
are typically adjusted by taking project complexity and risk into account. The resulting work
product is called a project management plan.
Panning includes:-
1. Risk Planning.
2. Project Scheduling.
3.3.1 Risk Planning:-
Risk is an event that delays or destroys the project thus affecting the cost. Planning and
management of risks are intended to help a software team to understand and manage the
uncertainty during the development process. Thus plans are made not only to understand the
risk uncertainty but also to minimize the impact when things go wrong.
The steps involved in risk management are:
17
Risk identification
Analyzing risk and assessing the damage that it will do
Ranking the risk according to probability of occurrence and impact
Developing a plan to manage the risks with high probability and high impact
The work product of Risk is management is called as Risk Mitigation, Monitoring and
Management Plan (RMMM).
Risk Strategies:-
Reactive strategies – very common, also known as fire fighting, project team sets
resources aside to deal with problems and does nothing until a risk becomes a problem
Proactive strategies - risk management begins long before technical work starts,
risks are identified and prioritized by importance, then team builds a plan to avoid risks if
they can or minimize them if the risks turn into problems
3.3.2 Project Scheduling:-
Activity that distributes estimated efforts across the planned project duration by
allocating the effort to specific software engineering tasks.
Network of software engineering tasks that will enable the job to get accomplished on
time.
Done to avoid lateness in project.
18
Chapter - 4
Data Base Command Syntax
19
Command Syntax
1) Create Table command
the CREATE TABLE command for specifying the primary key attributes,
secondary keys, and referential integrity constraints (foreign keys).
Key attributes can be specified via the Null and Not Null
Syntax CREATE TABLE <table_name> ( <att_name att_type att_const> )
Example: myDB> create table student ( userid integer not_null ,
name char(10) null )
myDB> create table employee ( emp integer not_null , ename
char(10) null , salary integer not_null , work char(20)
not_null , dept char(20) not_null )
2) Insert Command
In its simplest form, it is used to add one or more tuples to a relation
Attribute values should be listed in the same order as the attributes were
specified in the CREATE TABLE command
Important Note: Only the constraints specified in the DDL commands are
automatically enforced by the DBMS when updates are applied to the
database
Another variation of INSERT allows insertion of multiple tuples resulting from
a query into a relation
Syntax INSERT INTO <table_name> VALUES ( val1 , val2 , val3 , .....)
20
Example: myDB> insert into student values ( 12345 , Harry-Potter )
myDB> insert into employee values ( SN123 , John , 50550 ,
Manager , Finance )
3) Select Command
Syntax Type: 1 SELECT * FROM <table_name> Type: 2 SELECT * FROM <table_name> WHERE <attribute>
<condition-operator> <value>. Example:
myDB> select * from abc
USERID NAME
----- -----
123 abc
1 Records Selected...!
myDB> select * from student
ROLL NAME MARKS
----- ----- -----
6787 abhi 80.60
0587 shivam 96.50
78.20 akash 87.66
6760 aman 75.30
1475 john 98.00
78.20 gurjot 76.50
6 Records Selected...!
myDB> select * from student where roll > 3000
ROLL NAME MARKS
----- ----- -----
6787 abhi 80.60
78.20 akash 87.66
21
6760 aman 75.30
78.20 gurjot 76.50
4 Records Selected...!
myDB> select * from student where roll = 6760
ROLL NAME MARKS
----- ----- -----
6760 aman 75.30
1 Records Selected...!
4) UPDATE Command
Used to modify attribute values of one or more selected tuples
A WHERE-clause selects the tuples to be modified
An additional SET-clause specifies the attributes to be modified and their new
values
Each command modifies tuples in the same relation
Referential integrity should be enforced
Syntax UPDATE <table_name> SET ( <att> = <val> , ... ) WHERE <att> = <val>. Example:
myDB> update student set rollno = 456 where name = John-
Sina
1 Record is updated successfully...!
myDB> update employee set salary = 75650 , dept = IT
where emp = E12345
1 Record is updated successfully...!
5) DELETE Command
22
Removes tuples from a relation
Includes a WHERE-clause to select the tuples to be deleted
A missing WHERE-clause specifies that all tuples in the relation are to be
deleted; the table then becomes an empty table
The number of tuples deleted depends on the number of tuples in the relation
that satisfy the WHERE-clause
Referential integrity should be enforced
Syntax Type: 1 DELETE FROM <table_name> Type: 2 DELETE FROM <table_name> WHERE <attribute> <cond>
<value> Example: myDB> delete from student where roll = 05642
1 Records Deleted Successfully...!
myDB> delete from Employee where dept = Finance
1 Records Deleted Successfully...!
myDB> delete from student
12 Records Deleted Successfully...!
6) DESC Command
Syntax DESC <table_name> Example:
23
myDB> desc student
Column Type Constraint
------ ---- ----------
roll integer not_null
name char(10) not_null
marks integer null
No. of columns: 3
myDB> desc employee
Column Type Constraint
------ ---- ----------
emp integer not_null
ename char(20) null
salary integer not_null
dept char(25) null
No. of columns: 4
7) DROP TABLE
Syntax DROP TABLE <table_name> Example:
myDB> drop table student
TABLE named ' student ' is deleted
successfully...!
myDB> drop table employee
TABLE named 'employee' is deleted
successfully...!
8) HELP
24
Syntax help To open the help for user about the use of commands
9) Clear
Syntax clear To clear the entire screen
10) QUIT
Syntax quit To comes out of the application.
25
Chapter - 5
PROJECT DESIGN
26
STARTUP SCREEN
27
CREATE Command
DESC Command
28
INSERT Command
29
SELECT Command
30
UPDATE Command
31
DROP Command
SYNTAX Help
32
INCORRECT Command
CREATE Validations
33
INSERT Validation
34
SELECT Validation
DELETE Validation
35
Chapter - 6
SOURCE CODE
Plz… Find a Source code file attached in the folder
File name: myDB 2010 - [ABHIJEET]. cpp
36
Chapter - 7
SYSTEM TESTING
37
SYSTEM TESTING
The definition of the quality software is that it meets the clients functional and
performance requirements, has been developed and documented in adherence to sound
standards and practices, is maintainable and can absorb changes by being flexible. The main
aim of testing is not show the absence of errors but their presence. Testing is often conducted
in a planned manner. This project follows a phased, feature-based approach and hence testing
cannot be precisely broken down into a structured pattern. Although the unit, integration and
acceptance test plans are followed, yet it is more of a feature-oriented testing. Generally the
testing is done as follows:
Implement and test one feature at a time
Adds this to the existing feature
Testing and debugging combination as whole till the whole system is developed.
PSYCHOLOGY OF TESTING: -
The aim of testing is often to demonstrate that a program works by showing that it has
no errors. This is the opposite of what testing should be viewed as. The basic purpose of
testing phase is to detect the errors that may be present in the program. Hence, one should not
start testing with the intent of showing that a program works, but the intent should be to show
that a program does not work. Testing is the process of executing a program with the intent of
intent of finding errors.
TESTING APPROACH:
Debugging is used as a tool for testing in TURBO C. Debugging:-
38
Programs errors are known as bugs and the process of detecting these errors is called
debugging. In other words, Debugging is an art of finding and correctness of detecting these
errors in the system. Debugging is the consequence of successful testing. That is, when a test
case uncovers the errors, debugging is the process that results in the removal of the errors.
Although debugging can and should be an orderly process, it is still very much an art.
A software engineer, evaluating the results of a test, is often confronted with a
“symptomatic” indication of software problem. Results are assessed and a lack of
correspondence between expected and actual is encountered. In many cases, the non-
corresponding data is “symptomatic” of an underlying cause as yet hidden. The debugging
process attempts to match symptom with the cause, thereby leading to error correction.
39
FUTURISTIC APPROACH
Graphical Interface for User
Connectivity with any other system who wants a Database, accepts the C/C++.
Query like Join two tables, foreign table, alter table
More variant of queries for Retrieving and manipulation of Database
Features of Normalization to be includes in the system
Condition like assignment, logical, relation in the where clause
Relationship between each & every table with one another