Project Report On ER2SQL
Project Report On ER2SQL
ER to SQL Converter
Submitted by:
CERTIFICATE
ER to SQL Converter
Submitted by:
A partial fulfillment for BACHELOR OF COMPUTER ENGINEERING degree course of Mumbai University for year 2009-2010.
HOD
INTERNAL EXAMINER
PRINCIPAL
EXTERNAL EXAMINER
ACKNOWLEDGEMENT
No project is ever complete without the guidance of those expert how have already traded this past before and hence become master of it and as a result, our leader. So we would like to take this opportunity to take all those individuals how have helped us in visualizing this project. We express out deep gratitude to our project guide Mrs.Amarja Adgaonkar for providing timely assistant to our query and guidance that she gave owing to her experience in this field for past many year. She had indeed been a lighthouse for us in this journey. We would also take this opportunity to thank our project co-ordinate Mr.Nitin Patkar for his guidance in selecting this project and also for providing us all this details on proper presentation of this project. We extend our sincerity appreciation to all our Professor form K.C.COLLEGE OF ENGINEERING for their valuable inside and tip during the designing of the project. Their contributions have been valuable in so many ways that we find it difficult to acknowledge of them individual. We also great full to our HOD Mrs.Amarja Adgaonkar for extending her help directly and indirectly through various channel in our project work. .
ABSTRACT
In this project we are providing ER Drawing tool which provides all tools need to design an ER Model. It automatically generate SQL Queries for creating tables which will be loaded in database and at same time Forms for data entry are auto generator. Here in this project we are providing facilities to fetch record in XML Format.
INDEX
SR.NO 1) 2) 3) 4) 5) 6) 7) 8) 9) 10) 11) 12) 13) INTRODUCTION LITERATURE SURVEY PROBLEM DEFINITION REQUIREMENT ANALYSIS PLANNING AND ESTIMATION 15 ALGORITHM 22 IMPLEMENTATION ADVANTAGES & DISADVANTAGES FUTURE MODIFICATIONS APPLICATION BIBLIOGRAPHY SCREENSHOTS SOURCE CODE
TITLE
PG.NO 1 5 8 11
13
27
29
31 33 48
Chapter 1 INTRODUCTION
INTRODUCTION
There are many ER diagramming tools. Some free software ER diagramming tools that can interpret and generate ER models, SQL and do database analysis are MySQL Workbench and DBDesigner (open-source). A freeware ER tool that can generate database and application layer code (webservices) is the RISE Editor. Entity- relationship model In software engineering, an entity-relationship model (ERM) is an abstract and conceptual representation of data. Entity-relationship modeling is a database modeling method, used to produce a type of conceptual schema or semantic data model of a system, often a relational database, and its requirements in a top-down fashion. Diagrams created by this process are called entity-relationship diagrams, ER diagrams, or ERDs. The building blocks: entities, relationships, and attributes An entity may be defined as a thing which is recognized as being capable of an independent existence and which can be uniquely identified. An entity is an abstraction from the complexities of some domain. When we speak of an entity we normally speak of some aspect of the real world which can be distinguished from other aspects of the real world.
An entity may be a physical object such as a house or a car, an event such as a house sale or a car service, or a concept such as a customer transaction or order. Although the term entity is the one most commonly used, following Chen we should really distinguish between an entity and an entity-type. An entity-type is a category. An entity, strictly speaking, is an instance of a given entity-type. There are usually many instances of an entity-type. Because the term entity-type is somewhat cumbersome, most people tend to use the term entity as a synonym for this term. Entities can be thought of as nouns. Examples: a computer, an employee, a song, a mathematical theorem. A relationship captures how two or more entities are related to one another. Relationships can be thought of as verbs, linking two or more nouns. Examples: an owns relationship between a company and a computer, a supervises relationship between an employee and a department, a performs relationship between an artist and a song, a proved relationship between a mathematician and a theorem. The model's linguistic aspect described above is utilized in the declarative database query language ERROL, which mimics natural language constructs. Entities and relationships can both have attributes. Examples: an employee entity might have a Social Security Number (SSN) attribute; the proved relationship may have a date attribute. Every entity (unless it is a weak entity) must have a minimal set of uniquely identifying attributes, which is called the entity's primary key. Entity-relationship diagrams don't show single entities or single instances of relations. Rather, they show entity sets and relationship sets. Example: a particular song is an entity. The collection of all songs in a database is an entity set. The
eaten relationship between a child and her lunch is a single relationship. The set of all such child-lunch relationships in a database is a relationship set. In other words, a relationship set corresponds to a relation in mathematics, while a relationship corresponds to a member of the relation.
Literature Survey
The Exiting System provides facilities only for drawing ER diagram, where you can draw ER diagram and can save in an image format. It doesn't provide way to create whole designed database directly in Database. Existing System to Design ER Model 1. MySQL Workbench MySQL Workbench is a visual database design tool that integrates SQL development, administration, database design, creation and maintenance into a single, seamless environment for the MySQL database system. It is the successor to DBDesigner 4 from fabFORCE.net, and replaces the previous package of software, MySQL GUI Tools Bundle. Features: SQL Editor
Schema Object browsing SQL Syntax Highlighter and Statement Parser Multiple-, editable Result Sets SQL Snippets Collections SSH Connection Tunneling Unicode Support Data Modeling
Reverse Engineering from SQL Scripts and Live Database Forward Engineering to SQL Scripts and Live Database Schema Synchronization Printing of Models Import from fabFORCE.net DBDesigner4
2. Microsoft Visio Microsoft create diagrams. 3. ER/Studio ER/Studio is data architecture and database design software developed by Embarcadero Technologies. It works across multiple database platforms and is used by data architects, data modelers, database administrators and business analysts to create and manage database designs, document and reuse data assets. Feature: Logical and physical design support
Visio
marketed
as
Microsoft
Office
Visio,
is
XML Schema generation from either the logical or physical models Automation and scripting support Forward- and reverse- engineering Automated database code generation Integration of models and metadata Collaboration support including sub model management, repository, where used Web publishing, RTF, MS Office integration
Integrate model metadata with other platforms such as BI, ETL, and other modeling tools. Data lineage documentation Dimensional modeling Model completion validation Automatic foreign key migration Capacity planning
While drawing the ER diagram, existing tool will not suggest user for maintaining proper relationship between entities. This is a new tool which generates tables from E-R diagram and enables users to perform basic as well as advanced queries. The existing tool does not provide the editing facilities like copy, paste, delete, move, and resize the shaper from the ER diagram. Whereas our new tool provides all these facilities. From the ER diagram user can not generates the JPEG image and XML can be generated, but we can generate these by using this tool User can draw but can not modify the ER diagram if ER diagram can be stored to users disk with some specific file extension, but our tool can modify this. With the help of these tool, we can work on Extended ER diagram and also draw any UML diagram of our choice using provided interface. It is easy to understand how to create database statements or SQL queries and to create good code quickly. There is no need of DBA for each group. Working and evaluating the data requires less time. Helps in managing the frequent data changes which negatively affect our work environments. It is easy and simple to view and verify the correct data from a current or an older legacy database. It is the user friendly tool where user can simply draw and modify the ER diagram.
Hardware: 1. Processor: Pentium 4. 2. RAM: 512 MB or more. 3. Hard disk: 16 GB or more. Software: 1. Netbeans 6.1 2. JDK 1.6 and above. 3. MySQL
Software development Life Cycle The entire project spanned for duration of 6 months. In order to effectively design and develop a cost-effective model the Waterfall model was practiced.
modularized the project. Important points of consideration were Define and visualize all the objectives clearly. Gather requirements and evaluate them.
1 2
Consider the technical requirements needed and then collect technical Analyze the coding languages needed for the project. Define coding strategies. Analyze future risks / problems. Define strategies to avoid this risks else define alternate solutions to this Check financial feasibility. Define Gantt charts and assign time span for each phase.
risks.
8 9
By studying the project extensively we developed a Gantt chart to track and schedule the project. Below is the Gantt chart of our project.
Time Line
Cost Estimation
cost Drivers Product attributes Required software reliability Size of application database Complexity of the product Hardware attributes Run-time performance constraints Memory constraints Volatility of the virtual machine envir onment Required turnabout time Personnel attributes Analyst capability Applications experience Software engineer capability Virtual machine experience Programming language experience Project attributes Use of software tools Application of software engineering m ethods Required development schedule
Very High 1.40 1.16 1.30 1.30 1.21 1.30 1.15 0.71 0.82 0.70
Extra High
The Intermediate Cocomo formula now takes the form: E=ai (KLoC)(bi).EAF
Chapter 6
ALGORITHM
This project is divided into three parts: 1. Drawing Entity relationship diagram
2. Generate database tables and SQL queries 3. Generate Form for data entry. 3. Generate XML document Drawing entity relationship diagram: The visual representation of all data stored in a system and their relationships is called the entity relationship diagram. There are four main components in ERD: 1) Entities, which are represented by rectangles. 2) Relationships, which are represented by diamond shapes. 3) Attributes, which are represented by oval shape. 4)Connecting lines, solid lines that connect an entity to a relationship. Generate database tables and SQL queries:
Setup the database connection. Using that connection we will configure the list to display available tables in database After selecting the table we will display columns to be added in the query. Then we will select type of query to be executed: select, insert, update, or delete or user can write his own query. After selecting the columns and comparison condition we will execute the query. Generate Form for data entry: Generate forms for every table & relation with data connectivity.
Generates XML documents in their string or DOM representations. We will use a XML parser to generate XML document from the generated tables of E-R diagram. In Java, DocumentBuilderFactory class is used to obtain a parser that produces DOM object trees from XML documents.
Chapter 7
IMPLEMENTATION DESIGN
DESIGN
System Architecture
Flowchart
DFD
Testing
Software testing methods are traditionally divided into black box testing and white box testing. These two approaches are used to describe the point of view that a test engineer takes when designing test cases.
Black box testing
Black box testing treats
the software as a "black box"without any knowledge of internal implementation. Black box testing methods include: equivalence partitioning, boundary value analysis, all-pairs testing, fuzz testing, modelbased testing, traceability matrix, exploratory testing and specification-based testing.
Specification-based testing: Specification-based testing aims to test the functionality of software according to the applicable requirements. Thus, the tester inputs data into, and only sees the output from, the test object. This level of testing usually requires thorough test cases to be provided to the tester, who then can simply verify that for a given input, the output value (or behavior), either "is" or "is not" the same as the expected value specified in the test case. Specification-based testing is necessary, but it is insufficient to guard against certain risks. Advantages and disadvantages: The black box tester has no "bonds" with the code, and a tester's perception is very simple: a code must have bugs. Using the principle, "Ask and you shall receive," black box testers find bugs where programmers do not. But, on the other
hand, black box testing has been said to be "like a walk in a dark labyrinth without a flashlight," because the tester doesn't know how the software being tested was actually constructed. As a result, there are situations when (1) a tester writes many test cases to check something that could have been tested by only one test case, and/or (2) some parts of the back-end are not tested at all. Therefore, black box testing has the advantage of "an unaffiliated opinion," on the one hand, and the disadvantage of "blind exploring," on the other. ER input function testing In this testing we will be using ER data with random values , and the read file will be tested to read the random values . If this testing works then, it proves that our code which can read any format file.
using Public and Private APIs (e.g., the test designer can create tests to cause all statements in the program to be executed at least once) Fault injection methods - improving the coverage of a test by introducing Mutation testing methods Static testing - White box testing includes all static testing faults to test code paths
Code completeness evaluation White box testing methods can also be used to evaluate the completeness of a test suite that was created with black box testing methods. This allows the software team to examine parts of a system that are rarely tested and ensures that the most important function points have been tested. Two common forms of code coverage are: Function coverage, which reports on functions executed Statement coverage, which reports on the number of lines executed to
complete the test They both return a code coverage metric, measured as a percentage.
ER white box In this white box testing, we will be developing various functional modules, like the SQL query generator function , Loader, XML Creator. These functional modules will undergo white box testing which will test the functionality The output results will be tested in NetBeans command window.
system under test. Grey box testing may also include reverse engineering to determine, for instance, boundary values or error messages.
GA grey box testing Here we will be modifying ER data inorder to integrate it for the grey box testing. Some of the boundary values conditions will be tested for abnormalities in the ER Data.
Integration Testing Integration testing is any type of software testing, that seeks to verify the interfaces between components against a software design. Software components may be integrated in an iterative way or all together ("big bang"). Normally the former is considered a better practice since it allows interface issues to be localised more quickly and fixed.
Chapter 8 ADVANTAGES
ADVANTAGES:1. Easy Drawing ER Diagram 2. Relation Model Checker 3. Cost effective 4. Platform independent.
Chapter 9 APPLICATION
FUTURE MODIFICATION Future work includes creating a EER Drawing tool with Auto suggestion if any error occur.
Conclusion
In this project we are implementing the modules ER tool, SQL generator, Query Loader and XML file creator. It provides easy methods to design and modify ER Diagram and directly implement it in available database. Records can be fetch in XML format.
Chapter 11 BIBILIOGRAPHY
Bibliography
1. Java Complete Reference 2. Unleashed Java 3. MySQL 4. www.wikipedia.org
Chapter 12 SCREENSHOTS