Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Method for generating complex structured query language (SQL) statement

A statement and complex technology, applied in the field of complex SQL statement generation, can solve problems such as failure to generate

Inactive Publication Date: 2011-10-19
NORTHWESTERN POLYTECHNICAL UNIV
View PDF2 Cites 7 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] In order to overcome the deficiency that the existing method for generating SQL statements cannot generate complex SQL statements based on combined keywords, the present invention provides a method for generating SQL statements, which is based on the Postgres database test set, by classifying SQL keywords , Combine and design basic SQL statements and generation methods to automatically generate complex SQL statements based on keywords specified by users, and can generate complex SQL statements based on combined keywords

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method for generating complex structured query language (SQL) statement
  • Method for generating complex structured query language (SQL) statement

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0040] Assuming that the following SQL keywords are specified as {select, join, join, group by, where, intersect}, the SQL statement needs to be generated, and the generation method is as follows:

[0041] A. Build the basic SQL statement as follows:

[0042] select *from t1;(1)

[0043] select id from t1 where id=1; (2)

[0044] select distinct id, name from t1 where id>=1 order by id; (3)

[0045] select count(id), sum(id), avg(id), max(id), min(id) from t1 group by name having

[0046] count(id)>0 order by id; (4)

[0047] select * from t1, t2; (5)

[0048] select * from t1 natural join t2 on t1.id = t2.id; (6)

[0049] select * from t1 join t2 using(id);(7)

[0050] select * from t1 left outer join t2 using(id);(8)

[0051] select * from t1 right outer join t2 using(id);(9)

[0052] select * from t1 where id = (select id from t1 where id = 1); (10)

[0053] B. Construct the SQL keyword list KeyWordsList and the SQL statement list SQLList according to the input SQL...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a method for generating a complex structured query language (SQL) statement for solving the technical problem that the complex SQL statement cannot be generated according to a combined keyword by the conventional method for generating the SQL statement. The method comprises the following step of automatically generating the complex SQL statement according to a keyword specified by a user based on a Postgres database testing set through a method for classifying and combining SQL keywords, designing a basic SQL statement and generating the complex SQL statement, so that the complex SQL statement can be generated according to the combined keyword. The statement can be directly applied to the testing process of a database system, and the problems of high error rate and low efficiency caused by manually writing the combined keyword are solved.

Description

technical field [0001] The invention relates to a method for generating SQL statements, in particular to a method for generating complex SQL statements. Background technique [0002] The document "Design and Implementation of SQL Generator [J]. Computer Engineering and Design. 2006.Vol.27(11): p2024-2027" discloses a method for generating SQL statements, which is based on the SQL92 standard and can realize complex Generation of SQL statements. First, completeness and repeatability checks are performed according to the database table fields and SQL clauses, functions or expressions specified by the user, and then specific SQL statements that meet the requirements are spelled out according to the SQL92 standard. The method can simplify the generation process of SQL statements and improve the development efficiency of database application programs. However, users are required to master the syntax of SQL statements and the formation methods of various complex expressions, and ...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
IPC IPC(8): G06F17/30
Inventor 刘文洁李战怀周云涛张晓
Owner NORTHWESTERN POLYTECHNICAL UNIV
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products