Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Mydb 2010 - AbhijeetKalsi


Published on

A mini DBMS Complier used to carried out CREATE, SELECT, UPDATE, INSERT, DELETE, DESC like comands to execute.

Using >>--> C++ and File Streams

Abhijeet Kalsi ..!

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Mydb 2010 - AbhijeetKalsi

  1. 1. Project Report A mini Data Base Management SystemVersion 1.0Team Members: Abhijeet Singh Kalsi (MCA - III Semester)Faculty Mentor: Mr. Nilesh Kumar & Mrs. Ekata GuptaCollege Name: Guru Nanak Institute of ManagementAffiliated to Guru Gobind Singh IndraPrastha University [GGSIPU] 1
  2. 2. ACKNOWLEDGEMENTExchange of ideas generates the new object to work in a better way whenever a person ishelped and cooperated by others his heart is bound to pay gratitude and obligation tothem. 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 informing the outline and strategy for my humble effort.We thank Mr. NILESH DOKANIA & Mrs. Ekata Gupta who gave us inspiration to dowork in this field and gave us her precious time whenever needed. Thanks may be matterof merely formality but with us it is expression of heartfelt gratitude to our projectsupervision. We are highly indebted for her gestures, invaluable suggestions andboosting confidence to make this successful. The success of this work is mostly due toher suitable guidance.We also thank our class fellows and friends, who helped us a lot during our project work. 2
  3. 3. CERTIFICATEThis is to certify that the project entitled “myDB - 2010“ a mini DataBase Management System prepared by Abhijeet Singh Kalsi for thepartial fulfillment of the requirements of the MCA degree, embodiesthe work, we all are doing during 3th semester of our course underdue supervision of the supervisor from this college.SIGNATURE:[Mr. Nilesh Dokania] [Mrs. Ekata Gupta] 3
  4. 4. Table of ContentsS.No. Contents Page No. Introduction 1) 1.1 Abstract 5 1.2 Purpose 1.3 Scope 1.4 Technologies used 1.5 System Requirement 1.5.1 Software 1.5.2 Hardware Description 2) 2.1 Overall Description 8 2.2 Entity Relationship Diagram (ERD) 2.3 Class Diagram 2.4 Data Flow Diagram (DFD) Project Management 3) 3.1 Software Process Model 14 3.2 Team structure 3.3 Project Plan 3.3.1 Risk Planning 3.3.2 Project Scheduling 4) Command Syntax Design 5) 18 Screen Shots C++ Coding / Programming 6) Source Code 26 SYSTEM TESTING 7) 27 6.1 PSYCHOLOGY OF TESTING 6.2 TESTING APPROACH 4
  5. 5. Chapter-1INTRODUCTION 5
  6. 6. 1) INTRODUCTION1.1 ABSTRACT The Aim of this project is to Design and Develop a mini Database ManagementSystem (DBMS) a set of computer programs that controls the creation, maintenance, and theuse of a Database. A system software package that helps the use of integrated collection ofdata records and files known as databases Where End user can ask simple questions in a query language i.e. StructuralQuery Language, SQL to Database System and system responds to its request of Databasethrough command line interface by the use of Relation Database Model. Queries allow theuser to describe desired data, leaving the DBMS responsible for planning, optimizing, andperforming the physical operations necessary to produce that result as it chooses. By the use of programming language VC++ or Dev-C++ for writing programs butnot 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 existingsystem. To have a CLI, Command Line Argument Interface, in which user fires/queries itquestion to Database through a Structure Query Language SQL same as that of Oracle, MSSQL, etc. A feature of Data Definition Language (DDL): Specifies a new base relation by giving it aname, and specifying each of its attributes and their data types. A constraint NOT NULL maybe specified on an attribute. Feature of Data Manipulation Language (DML): To retrievals Data from Database andUpdates, Delete and Insert Records1.3) SCOPE Scope is to Add new features of DBMS like Join Table, Alter Table and some otherfeatures of DBMS to have Better and efficient Database Package . User use questions in aquery language i.e. Structural Query Language, SQL to Database System and system respondsto its request of Database through command line interface by the use of Relation DatabaseModel. 6
  7. 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 7
  8. 8. Chapter-2Project Description 8
  9. 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 9
  10. 10. ENTITY RELATIONSHIP DIAGRAMID Password Name Type Size 1 N Inputs CLIENT Data DB FILES Mode Creation M Date Linked With N N N Authenticates N Stores 1 1 Maintain MName Address N 1 DATABASEADMINISTRATOR Control SERVER s ID Name Location Space Master password 10
  11. 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 11
  12. 12. DATA FLOW DIAGRAM Level 0 DFD:- DATABASE ADMINSTRATOR Manages DatabaseDesign, Implements,Maintain & Repair DATABASE MANAGEMENT SYSTEM Send Queries Retrieve Desire Data CLIENT 12
  13. 13. 2.3) CLASS DIADGRAM DBMS _______________ len; ATTRIBUTE query[750]; _______________ cmd[25][30]; _______________ att_name[20]; void query_input(); att_type[20]; void trim(); att_const[20]; void cmd_break(); _______________ int create_table(); int select_cmd(); int insert_into(); int update_cmd(); int drop_table(); int delete_record(); int desc_cmd(); DATA ______________ void help(); void validator(); Cell [20] [200] int identifier(int,int); _____________ int datatype(int); int constraint(int); int integer(int); int char_x(int,int); _______________ 13
  14. 14. Chapter - 3PROJECT MANAGEMENT 14
  15. 15. Project ManagementProject management includes planning, monitoring and control of people, process, tasks andevents that occur during the project development process. It is a very necessary activity for thecomputer based projects. Project management process includes all those activities that runduring the whole duration of the project. The scope of the project management differs with theperson doing it. A software engineer manages his day to day activities, planning and monitoringof its technical tasks. A project manager plans, monitors and controls the work of a team ofsoftware engineer. Senior manager controls the interface between the business and the softwareprofessionals. Building software being a complex task makes project management very importantpart 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 engineersmust incorporate a strategy that encompasses the process, methods and tools that arefocused on the software quality. This strategy is called as a process model or a softwareengineering paradigm. In this project we have used incremental model. Incremental model:-In this model all the basic requirements of the clients are being studiedand first increment is delivered (also called as core product) and many supplementaryfeatures remain undelivered. Then a plan is developed for the next increment while the firstincrement is under review or evaluation by the user. Then the plan addresses the modificationof the core product focusing on other requirements of the user. This process is repeated untilall the requirements are not fulfilled. This can also be considered in a way that customer has 15
  16. 16. provided all his requirements and we divide it into phases. In this no integration is required asthe new increment is overwritten on the existing one.3.2 Team Structure:-The team structure is DEMOCRATIC DECENTRALISED (DD). The team comprises of threemembers:-- ABHIJEET SINGH KALSI Decentralized teams generate better solutions and have greater probability of success whenworking on different problems. DD team structure is best applies to programs with lowmodularity. Based on the difficulty of the problem to be solved relatively low modularity of the project andhigh volume of the communication required a democratic decentralized team structure isproposed. This software engineering team has no permanent leader. Rather, “taskcoordinators are appointed for short duration and then replaced by others who maycoordinate different tasks.” Problem solving is a group activity. Communication among teammembers is horizontal. Decentralized team generates more and better solutions thanindividuals. Therefore such teams have a greater probability of success when working ondifficult problems.3.3) PROJECT PLAN Software planning involves estimating how much time, effort, money, and resourceswill be required to build a specific software system. After the project scope is determined and theproblem is decomposed into smaller problems, software managers use historical project data (aswell as personal experience and intuition) to determine estimates for each. The final estimatesare typically adjusted by taking project complexity and risk into account. The resulting workproduct 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 andmanagement of risks are intended to help a software team to understand and manage theuncertainty during the development process. Thus plans are made not only to understand therisk uncertainty but also to minimize the impact when things go wrong. The steps involved in risk management are: 16
  17. 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 impactThe work product of Risk is management is called as Risk Mitigation, Monitoring andManagement 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 problems3.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. 17
  18. 18. Chapter - 4 Data BaseCommand Syntax 18
  19. 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_typeatt_const> ) Example: myDB> create table student ( userid integer not_null ,name char(10) null ) myDB> create table employee ( emp integer not_null , enamechar(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 , .....) 19
  20. 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 20
  21. 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 = ITwhere emp = E12345 1 Record is updated successfully...! 5) DELETE Command 21
  22. 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: 22
  23. 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 deletedsuccessfully...! myDB> drop table employee TABLE named employee is deletedsuccessfully...! 8) HELP 23
  24. 24. Syntax  help To open the help for user about the use of commands9) Clear Syntax  clear To clear the entire screen10) QUIT Syntax  quit To comes out of the application. 24
  25. 25. Chapter - 5PROJECT DESIGN 25
  26. 26. STARTUP SCREEN 26
  27. 27. CREATE Command DESC Command 27
  28. 28. INSERT Command 28
  29. 29. SELECT Command 29
  30. 30. UPDATE Command 30
  31. 31. DROP Command SYNTAX Help 31
  32. 32. INCORRECT CommandCREATE Validations 32
  33. 33. INSERT Validation 33
  34. 34. SELECT ValidationDELETE Validation 34
  35. 35. Chapter - 6 SOURCE CODEPlz… Find a Source code file attached in the folder File name: myDB 2010 - [ABHIJEET]. cpp 35
  36. 36. Chapter - 7SYSTEM TESTING 36
  37. 37. SYSTEM TESTING The definition of the quality software is that it meets the clients functional andperformance requirements, has been developed and documented in adherence to soundstandards and practices, is maintainable and can absorb changes by being flexible. The mainaim of testing is not show the absence of errors but their presence. Testing is often conductedin a planned manner. This project follows a phased, feature-based approach and hence testingcannot be precisely broken down into a structured pattern. Although the unit, integration andacceptance test plans are followed, yet it is more of a feature-oriented testing. Generally thetesting 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 hasno errors. This is the opposite of what testing should be viewed as. The basic purpose oftesting phase is to detect the errors that may be present in the program. Hence, one should notstart testing with the intent of showing that a program works, but the intent should be to showthat a program does not work. Testing is the process of executing a program with the intent ofintent of finding errors. TESTING APPROACH: Debugging is used as a tool for testing in TURBO C. Debugging:- 37
  38. 38. Programs errors are known as bugs and the process of detecting these errors is calleddebugging. In other words, Debugging is an art of finding and correctness of detecting theseerrors in the system. Debugging is the consequence of successful testing. That is, when a testcase 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 ofcorrespondence between expected and actual is encountered. In many cases, the non-corresponding data is “symptomatic” of an underlying cause as yet hidden. The debuggingprocess attempts to match symptom with the cause, thereby leading to error correction. 38
  39. 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 39