On Effective Data Retrieval from SQL by Use of Fuzzy Logic

On Effective Data Retrieval from SQL by Use of Fuzzy Logic

International Journal of Fuzzy Mathematics and Systems. ISSN 2248-9940 Volume 1, Number 2 (2011), pp. 173-180 © Research India Publications http://www.ripublication.com On Effective Data Retrieval from SQL by use of Fuzzy Logic 1Y.S. Pawar, 2R.G. Sapre and 3Sayali R. Sapre 1Rukmai Technical Institute, Solapur, Maharashtra, India 2Department of Mathematics, Gogate Jogalekar College, Ratnagiri, Maharashtra, India 3Gogate Jogalekar College, Ratnagiri, Maharashtra, India Abstract The Structured Query Language (SQL) is a very powerful tool, it is unable to satisfy needs for data selection based on linguistic expressions and degrees of truth. The goal of the research whose results are presented in the paper is to capture these expressions and make them suitable for queries. For this purpose the fuzzy generalised logical condition for the WHERE part of SQL was developed. In this way, queries based on linguistic expressions are supported and are accessing relational databases in the same way as with the SQL. Fuzzy query is not only a querying tool; it improves the meaning of a query and extracts additional valuable information. Statistical data about districts of the Slovak Republic are used in the case study. Fuzzy approach has some limitations that would appear in a querying process. These limitations and ideas how to solve them are outlined in this paper. Keywords: SQL, fuzzy queries, fuzzy logical condition. AMS Classification Number: 03B52 Introduction This paper examines situations when database querying process by the two-valued realisation of Boolean algebra is not adequate and offers solution based on the fuzzy logic because the fuzzy logic is an approach to computing based on "degrees of truth" rather than the usual "true or false" logic. The fuzzy logic deals with reasoning that is approximate rather than precise to solve problems in a way that more resembles human logic. Fuzzy Logic allows us to form queries which expresses semantic intent 174 Y.S. Pawar et al of our queries. This area of research is not new one but there are still many possibilities and ways for the improvement of existing approaches and for creating new approaches. Fuzzy queries have emerged in the last 25 years to deal with the necessity to soften the two-valued Boolean logic in relational databases. A fuzzy query system is an interface to users to get information from database using regular language sentences. Many fuzzy query implementations have been proposed, resulting in slightly different languages. Although there are some variations according to the particularities of different implementations, the answer to a fuzzy query sentence is generally a list of records, ranked by the degree of matching SQL and its limitations Users search databases in order to obtain data needed for analysis, decision making or to satisfy their curiosity. The SQL is a standard query language for relational databases. The simple SQL query is as follows: select attribute_1,…,attribute_n from T where attribute_p > P and attribute_r < R Figure 1: The result of the classical query. The result of the query is shown in graphical mode in figure 1. Values P and R delimit the space of interesting data. Small squares in the graph show database records. In the graph it is obviously shown that three records are very close to meet the query criterion. These records have potentials to satisfy the query but due to rigidity of SQL query they will not be included in the output. On Effective Data Retrieval from SQL by use of Fuzzy Logic 175 The SQL uses the crisp logic in querying process that causes crisp selection. It means that the record would have not been selected even if it is extremely close to the intent of the query criterion. As the criterion becomes more and more complex, the set of records selected by the WHERE statement becomes more and more crisp. Since then the SQL has been used in many relational databases and information systems for data selection. The use of SQL may be regarded as one of the main reasons for the success of relational databases in the commercial world In this research the core of SQL remains intact and the extension is done to improve the selection process. Adding some flexibility to the SQL meets above mentioned requirements and increases effectiveness and comprehensibility of the whole querying process. Fuzzy Logic is combined with Classical SQL • When we use SQL to retrieve data, we have to fire queries. • The queries are based on certain relational conditions. • Relational conditions are connected to each other by logical operators. • After the query is fired, SQL displays the output satisfying given conditions • Some concepts and ideas that we come across in daily life can not be expressed properly by rigid conditions. • The output given by SQL query analyzer does not fit human understanding of the situations. • We intend to use ‘fuzzy logic’ in all such situations so that the output should reflect semantic intent of the query. Case Study Suppose, School Administrator has to search a Student Database for all “good” students. She first has to make some arbitrary decisions about what exactly a "good" student is. One might say that "good" students are those students who have a Grade Point Average (GPA) of 3.5 or higher. And so, the following SQL query is devised: SELECT * FROM STUDENTS WHERE GPA >= 3.5; Immediately a list of students who have grade point averages at or above 3.5 will be displayed. SQL gives what you ask for. It works with Boolean logic and so can not reflect semantic intent of the query. The answer is you get exactly what you ask for and only what you ask for. Suppose we have to also consider other parameters: 1. Academic achievement of the student (GPA). 2. Absenty of the student (Absenty). 176 Y.S. Pawar et al 3. Participation in sports activities (SP). 4. Participation in cultural activities (CU). Suppose, Goodness of a student depends on these 4 parameters. Suppose goodness is defined as GPA >= 3.5, Absenty < 10, SP upto atleast state level and CU upto atleast university level. So following query is fired SELECT * FROM STUDENTS WHERE (GPA >= 3.5) AND (Absenty < 10) AND SP IN(‘State’,’National’,’International’) AND CU IN(‘University’,’State’,’National’); SQL returns a list of all students who satisfy the given conditions in fired query. Name GPA Absenty SP CU Juili Khatu 4.00 3.00 University State Govind Date 3.50 9.80 State State Ranjan Wakde 3.80 4.50 International University Tejas Kadam 4.00 1.00 State State Kaustubh Bhagwat 3.80 1.00 State National Atharwa Jog 3.80 4.00 State State Kedar Joshi 3.90 2.00 National University Leena Gore 4.00 9.80 National University Sai Bhat 4.00 7.00 State National It is very difficult to see who the best students Is? Sorting can be done by using GPA as key field. The query fired is: SELECT * FROM STUDENTSWHERE (GPA >= 3.5) AND (Absenty < 10) ORDER BY GPA DESC, ABSENTY ASC; Name GPA Absenty SP CU Tejas Kadam 4.00 1.00 State State Juili Khatu 4.00 3.00 University State Sai Bhat 4.00 7.00 State National Leena Gore 4.00 9.80 National University Kedar Joshi 3.90 2.00 National University Kaustubh Bhagwat 3.80 1.00 State National Atharw Jog 3.80 4.00 State State Ranjan Wakde 3.80 4.50 International University Govind Date 3.50 9.80 State State On Effective Data Retrieval from SQL by use of Fuzzy Logic 177 We can see that semantic intent of the query is not reflected in the query. The output of the query does not include names of the students who should surely be there in the list. For example: Students having GPA = 3.49 and SP = “National” Students having ABSENTY = 10.1 and CU = “National” The students who fit in the definition of “Good Students” are not listed here because of rigidness of the SQL query. Also the order does not reflect order of GOODness properly. This is where we use fuzzy logic Fuzzy logic is well suited to express the intent of a database query when the semantics of the query are rather vague. What is needed is a way to express the idea of "good grades" and "good attendance" also sports grade and cultural grade on a sliding scale. This would allow the two ideas to be expressed in terms of degree rather than in absolute terms. Suppose student A has a 4.0 GPA and student B has a 3.5 GPA. Both have good grades. However, it is plain to see that only student A fits the idea of having good grades. In fuzzy logic, we would say that student A has complete membership in the set of students with good grades, while student B only has partial membership in the set of students with good grades. Under certain circumstances, students with grades as low as 3.0 might be considered to have good grades. This idea becomes especially important in situations where more than one column of data is used to define a semantic notion. In this case, data from the GPA column and the ABSENTY column are somehow combined to form the semantic notion "GOOD STUDENT". GPA Gradations Range Linguistic termGrade 0 – 0.5 Bad 0 0.5 – 1 Very poor 0.1 1 – 1.5 Poor 0.2 1.5 – 2 Less than avg. 0.3 2 – 2.5 Above avg. 0.4 2.5 – 3 Average 0.5 3 – 3.5 Good 0.6 3.5 – 4 Very good 0.7 4 – 4.5 Excellent 0.8 4.5 – 4.8 Superb 0.9 4.8 - 5 Outstanding 1 178 Y.S.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    8 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us