The advantage of recursive programming is that it is very easy to write and it only requires very few lines of code if done correctly.Structured query language(SQL)is a database language and is used to manipulate data...The advantage of recursive programming is that it is very easy to write and it only requires very few lines of code if done correctly.Structured query language(SQL)is a database language and is used to manipulate data.In Microsoft SQL Server 2000,recursive queries are implemented to retrieve data which is presented in a hierarchical format,but this way has its disadvantages.Common table expression(CTE)construction introduced in Microsoft SQL Server 2005 provides the significant advantage of being able to reference itself to create a recursive CTE.Hierarchical data structures,organizational charts and other parent-child table relationship reports can easily benefit from the use of recursive CTEs.The recursive query is illustrated and implemented on some simple hierarchical data.In addition,one business case study is brought forward and the solution using recursive query based on CTE is shown.At the same time,stored procedures are programmed to do the recursion in SQL.Test results show that recursive queries based on CTEs bring us the chance to create much more complex queries while retaining a much simpler syntax.展开更多
Aiming to improve the Structured Query Language( SQL) injection penetration test accuracy through the formalismguided test case generation,an attack purpose based attack tree model of SQL injection is proposed,and the...Aiming to improve the Structured Query Language( SQL) injection penetration test accuracy through the formalismguided test case generation,an attack purpose based attack tree model of SQL injection is proposed,and then under the guidance of this model, the formal descriptions for the SQL injection vulnerability feature and SQL injection attack inputs are established. Moreover,according to new coverage criteria,these models are instantiated and the executable test cases are generated.Experiments show that compared with the random enumerated test case used in other works,the test case generated by our method can detect the SQL injection vulnerability more effectively. Therefore,the false negative is reduced and the test accuracy is improved.展开更多
XQuery是一种用于从XML文档中获取数据的查询语言,是W3C组织于2007年发布的推荐标准。其在XML格式数据中的作用,类似于标准SQL语言在关系数据库中的作用。XQuery功能强大,得到XML原生数据库以及支持XML的关系数据库的支持。对全面支持XM...XQuery是一种用于从XML文档中获取数据的查询语言,是W3C组织于2007年发布的推荐标准。其在XML格式数据中的作用,类似于标准SQL语言在关系数据库中的作用。XQuery功能强大,得到XML原生数据库以及支持XML的关系数据库的支持。对全面支持XML技术的SQL Server 2005数据库中XQuery语言的实现与应用进行研究,探讨了SQL Server 2005中实现XML数据查询的机制及其特点,分析了在SQL Server 2005中XQuery语言的运用,特别讨论了在SQL Server 2005中对XQuery标准所做的扩展,即其通过XQuery实现对XML文档中元素的操作,并通过具体示例阐明了SQL Server 2005中XQuery标准及其功能扩展的实现。展开更多
面对海量的兵棋数据,传统界面查询的方式已经无法满足指挥员快速、全面、精准查询数据的要求。通过深入分析兵棋数据特点与主流NL2SQL(natural language to struct query language)模型的缺陷,提出了一套适合兵棋数据智能统计查询的解...面对海量的兵棋数据,传统界面查询的方式已经无法满足指挥员快速、全面、精准查询数据的要求。通过深入分析兵棋数据特点与主流NL2SQL(natural language to struct query language)模型的缺陷,提出了一套适合兵棋数据智能统计查询的解决方案。针对领域数据集缺乏,提出了一套基于人机协助、动态迭代的兵棋数据集构建方案;针对兵棋查询问句时间敏感的问题,提出了一套“规则+深度学习”的时间表达式识别与规范方法;针对兵棋数据量大提取查询值困难的问题,修改完善了Bridge模型的值提取与SQL生成架构。综合运用以上方案,使兵棋数据查询的精准匹配准确率达到75%以上。展开更多
In this paper, an interval-gap-based 1NF temporal tuple calculus language and the corresponding temporal relation algebra are established on the basis of considering the trouble of stack operations in both S. Gadia’s...In this paper, an interval-gap-based 1NF temporal tuple calculus language and the corresponding temporal relation algebra are established on the basis of considering the trouble of stack operations in both S. Gadia’s TCAL and temporal tuple calculus due to their NINF.展开更多
文摘The advantage of recursive programming is that it is very easy to write and it only requires very few lines of code if done correctly.Structured query language(SQL)is a database language and is used to manipulate data.In Microsoft SQL Server 2000,recursive queries are implemented to retrieve data which is presented in a hierarchical format,but this way has its disadvantages.Common table expression(CTE)construction introduced in Microsoft SQL Server 2005 provides the significant advantage of being able to reference itself to create a recursive CTE.Hierarchical data structures,organizational charts and other parent-child table relationship reports can easily benefit from the use of recursive CTEs.The recursive query is illustrated and implemented on some simple hierarchical data.In addition,one business case study is brought forward and the solution using recursive query based on CTE is shown.At the same time,stored procedures are programmed to do the recursion in SQL.Test results show that recursive queries based on CTEs bring us the chance to create much more complex queries while retaining a much simpler syntax.
基金National Natural Science Foundation of China(No.51274150)Tianjin Major Project of Application Foundation and Advanced Technology,China(No.12JCZDJC27800)
文摘Aiming to improve the Structured Query Language( SQL) injection penetration test accuracy through the formalismguided test case generation,an attack purpose based attack tree model of SQL injection is proposed,and then under the guidance of this model, the formal descriptions for the SQL injection vulnerability feature and SQL injection attack inputs are established. Moreover,according to new coverage criteria,these models are instantiated and the executable test cases are generated.Experiments show that compared with the random enumerated test case used in other works,the test case generated by our method can detect the SQL injection vulnerability more effectively. Therefore,the false negative is reduced and the test accuracy is improved.
文摘XQuery是一种用于从XML文档中获取数据的查询语言,是W3C组织于2007年发布的推荐标准。其在XML格式数据中的作用,类似于标准SQL语言在关系数据库中的作用。XQuery功能强大,得到XML原生数据库以及支持XML的关系数据库的支持。对全面支持XML技术的SQL Server 2005数据库中XQuery语言的实现与应用进行研究,探讨了SQL Server 2005中实现XML数据查询的机制及其特点,分析了在SQL Server 2005中XQuery语言的运用,特别讨论了在SQL Server 2005中对XQuery标准所做的扩展,即其通过XQuery实现对XML文档中元素的操作,并通过具体示例阐明了SQL Server 2005中XQuery标准及其功能扩展的实现。
文摘SQL是一种被广泛应用于操作关系数据库的编程语言,很多用户(如数据分析人员和初级程序员等)由于缺少编程经验和SQL语法知识,导致在编写SQL查询程序时会碰到各种困难.当前,使用程序合成方法根据<输入-输出>样例表自动生成相应的SQL查询程序,吸引了越来越多人的关注.所提ISST (正反例归纳合成)方法,能够根据用户编辑的含有少量元组的<输入-输出>示例表自动合成满足用户期望的SQL查询程序. ISST方法包括5个主要阶段:构建SQL查询程序草图、扩展工作表数据、划分正反例集合、归纳谓词和验证排序.在PostgreSQL在线数据库上验证SQL查询程序,并依据奥卡姆剃刀原则对已合成的SQL查询程序候选集打分排序.使用Java语言实现了ISST方法,并在包含28条样例的测试集上进行验证, ISST方法能正确合成其中的24条测试样例,平均耗时2 s.
文摘面对海量的兵棋数据,传统界面查询的方式已经无法满足指挥员快速、全面、精准查询数据的要求。通过深入分析兵棋数据特点与主流NL2SQL(natural language to struct query language)模型的缺陷,提出了一套适合兵棋数据智能统计查询的解决方案。针对领域数据集缺乏,提出了一套基于人机协助、动态迭代的兵棋数据集构建方案;针对兵棋查询问句时间敏感的问题,提出了一套“规则+深度学习”的时间表达式识别与规范方法;针对兵棋数据量大提取查询值困难的问题,修改完善了Bridge模型的值提取与SQL生成架构。综合运用以上方案,使兵棋数据查询的精准匹配准确率达到75%以上。
基金Supported by both the High Technology Research Development Programme of Chinathe National Natural Science Foundation of China
文摘In this paper, an interval-gap-based 1NF temporal tuple calculus language and the corresponding temporal relation algebra are established on the basis of considering the trouble of stack operations in both S. Gadia’s TCAL and temporal tuple calculus due to their NINF.