Download presentation
Presentation is loading. Please wait.
Published byCassandra Malone Modified over 8 years ago
1
Final Year Project A DBMS with SQL Interpreter Project Guide Dr. V.K.Paleri Project Members Nadar Jeril David Nasim Akhter Mondal Pranab Kumar Jha Group No. 12
2
What lies ahead… Problem Statement Motivation Design Work Done Example Results Conclusion
3
Problem Statement “This project aims to implement a DBMS which will have a subset of functionalities provided by MySQL 4.0” The problem involves: SQL Interpretation of a subset of DBA and SQL commands SQL Query Processing Design of the Database Architecture
4
Motivation Developing an Interpreter Query Processing Techniques Database Architecture DBA Techniques
5
Design SQL query Lexical analysis Sequence of tokens Syntax analysis Intermediate file Generation Semantic analysis File generation Type checking data Evaluation Query Compilatio n Query Execution Output
6
Work Done Last semester : Extensive study on all relevant topics Design of the all the stages in the project Lexical Analyzer: Input was transformed into a sequence of tokens and lexical errors were checked. It was generated using Flex 2.5 Syntax Analyzer: The sequence of tokens obtained was checked if they conform to the syntax of SQL. It was generated using Bison 2.1.Around 30% of the whole parser was covered.
7
Work Done contd… Present semester : Syntax Analyzer: Rest around 70% of the parser was completed for commands CREATE, INSERT, DROP, SELECT, UPDATE and DELETE Preprocessor and Semantic Analyzer: Semantic actions for each of the above commands were written. Some constraints were checked in the preprocessing stage. Such actions were coded in C. Type Checker: The types of arguments in scalar expressions were checked before applying a mathematical operation Intermediate File Generation: An intermediate file generation code was written to produce a formatted file for evaluation of SELECT, UPDATE and DELETE commands
8
Work Done contd… Evaluation – Input is the statement written in the eval.txt – Output is written either in output.txt ( in case of SELECT etc) or in the tablename.txt itself (in case of UPDATE). – To do this vector of vector is used which is a kind of 2- dimensional array – Has 4 fields attribute name Flag Index Value – First of all attribute name and flag is put into this vector
9
Work Done contd… – Then index and values are put. – This is followed by sorting, substitution, postfix evaluation etc. – In case of SELECT if the condition returns true, that row is selected. – In evaluation, each row of the table is read only once, never twice.
10
Work Done contd… Database Design: The format of the files for storing data and other important details was designed. GUI Development: The GUI was developed using Net Beans 3.6 for taking the input and displaying results and errors Testing and Debugging: Test data was applied to the program and was cross checked with the desired results. It was done in order to cover all types of possible errors.
11
Example
13
Example contd… input.txt Select name,roll from class where age 80; databaselist.txt schooldb libdb test database.txt test class namevarchar20 roll varchar 6 age integer 99 marks integer 99
14
Example contd… class.txt namerollagemarks Jeril332275 Nasim 342190 Pranab392285 Intermediate file eval.txt SELECT name,roll class age,marks age 25 & output.txt Nasim 34 Pranab 39
18
Results We implemented our own DBMS based on the lines of MySQL. It only interprets few SQL commands but can be easily extended to any scale We used indexing mechanisms in file to retrieve data which could have been made more efficient using B or B+ Trees Error Messages are displayed for error at all stages Easy to use and better looks
19
Conclusion Overall this project helped us to learn the development of Interpreter, various Query Processing Techniques and Database Architecture.
20
References Elmasri and Navathe, Fundamentals of Database System, 4th edition, Pearson Education Asia, 2004 SQL tutorial, http://www.mysql.comhttp://www.mysql.com Hector Garcia-Molina, Jeffrey D. Ullman and Jennifer Widom, Database System Implementation, International Edition, Prentice Hall, 2000 Herbert Schildt, Java 2: The Complete Reference, 5th edition, Tata Mc-Graw Hill, 2002. Yashwant Kanetkar, Let Us C, 3rd edition, BPB, 1999.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.