JP2798118B2 - Database query statement creation device - Google Patents

Database query statement creation device

Info

Publication number
JP2798118B2
JP2798118B2 JP7071439A JP7143995A JP2798118B2 JP 2798118 B2 JP2798118 B2 JP 2798118B2 JP 7071439 A JP7071439 A JP 7071439A JP 7143995 A JP7143995 A JP 7143995A JP 2798118 B2 JP2798118 B2 JP 2798118B2
Authority
JP
Japan
Prior art keywords
input
query sentence
query
copy
storage unit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP7071439A
Other languages
Japanese (ja)
Other versions
JPH08272660A (en
Inventor
淳 杉浦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP7071439A priority Critical patent/JP2798118B2/en
Publication of JPH08272660A publication Critical patent/JPH08272660A/en
Application granted granted Critical
Publication of JP2798118B2 publication Critical patent/JP2798118B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【産業上の利用分野】本発明は、データベース問合せ文
作成装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a database query creation device.

【0002】[0002]

【従来の技術】従来、関係データベースに対して問合せ
を行うには、SQL(Structured Query Language )
や、QBE(Query By Example: Zloof M.“Qu
ery by example”Proceedings of AFIPS '75,197
5,pp.431-432. 参照)といった、データベース問合せ
言語と呼ばれる言語を習得し、これらの言語を用いて問
合せ文を記述し、この問合せ文を用いて問合せを行って
いる。
2. Description of the Related Art Conventionally, to make an inquiry to a relational database, an SQL (Structured Query Language) is used.
And QBE (Query By Example: Zloof M. “Qu
ery by example ”Proceedings of AFIPS '75, 197
5, pp. 431-432.), And acquire a language called a database query language, describe a query sentence using these languages, and make an inquiry using this query sentence.

【0003】[0003]

【発明が解決しようとする課題】しかしながら、データ
ベース言語及びその文法の習得には、時間がかかり、初
心者が問合せ文を作成することは非常に困難であるとい
う問題点がある。
However, learning the database language and its grammar takes time, and it is very difficult for a beginner to create a query sentence.

【0004】本発明は、初心者でも容易にデータベース
問合せ文が作成できるデータベース文作成装置を提供す
ることを目的とする。
[0004] It is an object of the present invention to provide a database sentence creating apparatus which enables even a beginner to easily create a database query sentence.

【0005】[0005]

【課題を解決するための手段】本発明によれば、データ
ベースに登録されたデータの表示、表示データに対する
直接選択操作、前記表示データに対する論理検索式によ
る選択操作、及びこれらの選択操作により得た選択デー
タを対象とする集計演算による新規データの作成操作が
可能な入力表から、当該入力表において選択されたデー
タ及び新規作成されたデータを出力表へコピーし、該出
力表上に検索結果として必要なデータの一部または全体
を作成することにより、データベース検索を行なうデー
タベースの問合せ文作成装置であって、前記入力表及び
前記出力表を表示する表示手段と、前記入力表に対する
操作及び前記入力表から前記出力表へのコピー操作を行
うための入力手段と、前記表示手段と前記入力手段とを
制御する制御手段と、前記入力表に対する操作を表す情
報を保持する操作記憶手段と、前記コピー操作でコピー
されたデータに関連する情報のみを前記操作記憶手段か
ら取得し記憶するコピー操作記憶手段と、該コピー操作
記憶手段に記憶された前記情報に基づいて前記操作の意
味を解釈することによりユーザが意図した問合わせの種
類を推定する操作解釈手段と、該操作解釈手段が解釈し
た意味に基づいて前記コピー操作記憶手段に記憶された
情報に対応する問合せ文を作成する問合わせ文生成手段
とを有することを特徴とするデータベース問合せ文作成
装置が得られる
According to the present invention, data
Display of data registered in the base, display data
Direct selection operation, based on a logical search expression for the display data
Selection operations and the selection data obtained by these selection operations
Create new data by aggregation operation
From the possible input tables, select the data selected in the input table.
Data and newly created data to the output table,
Part or all of the data required as search results on the force table
By creating a database, the database search data
An inquiry statement creation device for a database, wherein the input table and
A display means for displaying the output table, input means for performing a copy operation to the output table from the operation and the input table for the input table, and control means for controlling the said display means said input means, an operation storing means for storing information representing an operation for the input table, copying the copy operation
Only the information related to the input data is stored in the operation storage unit.
A copy operation storage unit that obtains and stores the same from the user, and interprets the meaning of the operation based on the information stored in the copy operation storage unit, thereby obtaining a query type intended by the user.
Operation interpreting means for estimating the type, and query sentence generating means for creating a query sentence corresponding to the information stored in the copy operation storage means based on the meaning interpreted by the operation interpreting means. A database query sentence creating device is obtained .

【0006】[0006]

【作用】本発明では、ユーザーがディスプレイ上で入力
表を直接操作し、さらに入力表上のデータを出力表にコ
ピーし、問合せの結果得られるべき表データを作成する
ことにより、システムがこれらのユーザの操作履歴を操
作記憶部に記録し、操作記憶部に記録された操作履歴か
ら操作の意味づけを操作解釈部で行ない、その結果に基
づき問合せ文生成部において問合せ文を自動的に生成す
るため、ユーザは複雑な問合せ言語の文法などを覚える
必要はなく、入力表での簡単な操作方法を覚えるだけで
問合せ文を作成することが可能となる。
According to the present invention, the user operates the input table directly on the display, further copies the data on the input table to the output table, and creates table data to be obtained as a result of the query, so that the system can perform these operations. The operation history of the user is recorded in the operation storage unit, meaning of the operation is performed by the operation interpretation unit from the operation history recorded in the operation storage unit, and the query sentence generation unit automatically generates a query sentence based on the result. Therefore, the user does not need to memorize the grammar of a complicated query language and the like, and can create a query sentence only by learning a simple operation method in the input table.

【0007】[0007]

【実施例】以下、図面を参照して本発明の実施例を説明
する。本発明の一実施例を図1に示す。本実施例のデー
タベース問合せ文作成装置は、図1(a)に示すよう
に、表データ(入力表及び出力法)を表示するための表
示装置1、入力表の上で表データに操作を加えるための
マウスあるいはキーボードといった入力装置2、操作履
歴などを記憶する操作記憶部と表データを格納するデー
タベースとを有する記憶装置3、表示装置1、入力装置
2、及び記憶装置3を制御して所定の処理を実行するコ
ンピュータ4より構成される。
Embodiments of the present invention will be described below with reference to the drawings. One embodiment of the present invention is shown in FIG. As shown in FIG. 1A, the database query sentence creating apparatus according to the present embodiment performs operations on table data on a display device 1 for displaying table data (input table and output method) on the input table. A storage device 3 having an input device 2 such as a mouse or a keyboard for operation, an operation storage unit for storing operation history and the like, and a database for storing table data, a display device 1, an input device 2 and a storage device 3. And a computer 4 for executing the above processing.

【0008】この問合せ文作成装置では、図1(b)に
示すように、データベース5から読み出して表示装置1
に表示させた入力表6に対し、ユーザーが入力装置2を
用いて行った操作を、コンピュータ4の制御により、記
憶装置3の操作記憶部7に設けられた入力表操作記憶部
8に記憶させる。この入力表操作記憶部8の記憶内容
は、入力表に対して操作が行われる毎に更新される。ま
た、入力表6から出力表9へのコピー操作を、操作記憶
部7のコピー操作記憶部10に記憶させる。
[0010] In this inquiry sentence creating apparatus, as shown in FIG.
The operation performed by the user using the input device 2 on the input table 6 displayed on the input device 6 is stored in the input table operation storage unit 8 provided in the operation storage unit 7 of the storage device 3 under the control of the computer 4. . The contents stored in the input table operation storage unit 8 are updated each time an operation is performed on the input table. Further, the copy operation from the input table 6 to the output table 9 is stored in the copy operation storage unit 10 of the operation storage unit 7.

【0009】次に、コンピュータ4の操作解釈部11に
おいて、コピー操作記憶部10に記憶された情報からユ
ーザの操作の意味づけを行なう。そして、問合せ文生成
部12において、操作解釈部11で解釈した結果に基づ
いて、コピー操作記憶部10に記憶された情報に対応す
る問合せ文を生成する。さらに、必要に応じて、問合せ
文一般化部13で、問合せ文生成部12において生成さ
れた問合せ文を一般化する。
Next, the operation interpreting section 11 of the computer 4 gives meaning to the user's operation based on the information stored in the copy operation storing section 10. Then, the query sentence generation unit 12 generates a query sentence corresponding to the information stored in the copy operation storage unit 10 based on the result interpreted by the operation interpretation unit 11. Further, if necessary, the query sentence generalization unit 13 generalizes the query sentence generated by the query sentence generation unit 12.

【0010】なお、本実施例では、データベース5が、
操作記憶部7と同じ記憶装置3に設けられているように
説明したが、データベースは、コンピュータ4に(例え
ば通信回線で)接続された別の記憶装置に設けてもよ
い。
In this embodiment, the database 5 stores
Although described as being provided in the same storage device 3 as the operation storage unit 7, the database may be provided in another storage device connected to the computer 4 (for example, via a communication line).

【0011】図3は本発明を実施する際の処理順序の一
例を示すものである。図3に示すように、ステップS1
で操作記録が開始されたあと、入力装置2から操作があ
った場合、ステップS2で入力表6に対する操作か、コ
ピー操作か、が判断される。入力表6に対す操作の場合
は、ステップS3でその操作を入力表操作記憶部8に記
憶させる。つまり、入力表操作記憶部8の記憶内容を更
新する。また、コピー操作の場合は、ステップS4で、
コピー操作が行われたときの入力表操作記憶部8の記憶
内容をコピー操作記憶部10に記憶させる。その後、問
合せ文生成命令がなければステップS5からステップS
2へ戻る。これらの操作の記憶は問合せ文生成命令が有
るまで繰り返される。
FIG. 3 shows an example of a processing order when the present invention is carried out. As shown in FIG.
When an operation is performed from the input device 2 after the operation recording is started in step S2, it is determined in step S2 whether the operation is for the input table 6 or a copy operation. In the case of an operation on the input table 6, the operation is stored in the input table operation storage unit 8 in step S3. That is, the content stored in the input table operation storage unit 8 is updated. In the case of a copy operation, in step S4,
The contents stored in the input table operation storage unit 8 when the copy operation is performed are stored in the copy operation storage unit 10. Thereafter, if there is no query generation command, the process proceeds from step S5 to step S5.
Return to 2. The storage of these operations is repeated until there is a query generation instruction.

【0012】ステップS5で、問合せ文生成命令有りと
判断された場合には、ステップS6で操作記録を終了す
る。そして、ステップS7で、操作解釈部11におい
て、コピー操作記憶部10に記憶された操作を解釈す
る。解釈可能な場合には、ステップS8において、問合
せ文の種類を決定する。そして、ステップS9で、問合
せ文生成部12において問合せ文の生成を行う。ステッ
プS7で解釈不能と判断された場合には動作を終了す
る。
If it is determined in step S5 that there is a query generation command, the operation recording is terminated in step S6. Then, in step S7, the operation interpretation unit 11 interprets the operation stored in the copy operation storage unit 10. If it can be interpreted, the type of the query is determined in step S8. Then, in step S9, the query sentence generation unit 12 generates a query sentence. If it is determined in step S7 that the interpretation is not possible, the operation ends.

【0013】次に、作成した問合せ文を一般化せよとの
命令があれば(ステップS10)、ステップS11で、
問合せ文一般化部13において問合せ文の一般化が行わ
れる。問合せ文一般化命令がない場合は、そのまま動作
を終了する。
Next, if there is an instruction to generalize the created query sentence (step S10), at step S11,
The query sentence generalization unit 13 generalizes the query sentence. If there is no generalized query statement, the operation is terminated.

【0014】以下、本実施例のデータベース問合せ文生
成装置の動作を具体的に説明する。ここでは、入力表と
して図3に示すような人事表及び年齢表を考える。表の
1行目はフィールド欄、2行目は集計関数欄、3行目は
検索条件入力欄、4行目以下はレコード欄である。な
お、以下の説明では、表Tk のフィールドFi をTk
i と表記する。表Tk のj番目のレコードをTk .R
j 、もしくは「Tk のRj 」、もしくは、表Tk のレコ
ードであることが明白である場合には、単にRjと表記
する。また、レコードTk .Rj のフィールドTk .F
i の値をv(Tk.Fi ,Tk .Rj )と表記する。ま
た、表Tk の全てのフィールドをTk .F1 ,…,
k .Fn とした場合、COND(Tk .Rj )は、T
k .F1 =v(Tk .F1 ,Tk .Rj )AND…AN
DTk .Fn =v(Tk .Fn ,Tk .Rj )という条
件を意味するものとする。
Hereinafter, the operation of the database query generation device of the present embodiment will be described in detail. Here, a personnel table and an age table as shown in FIG. 3 are considered as input tables. The first line of the table is a field column, the second line is a tabulation function column, the third line is a search condition input column, and the fourth and subsequent lines are record columns. In the following description, the field F i of the table T k is defined as T k .
Notated as Fi . Let the j-th record of the table T k be T k . R
j , or “R j of T k ”, or if it is clear that the record is a record of table T k , it is simply denoted as R j . The records T k . Field T k of R j. F
i value of v (T k .F i, T k .R j) is referred to as. Further, all the fields of the table T k are set to T k . F 1 , ...,
T k . If the F n, COND (T k .R j) is, T
k . F 1 = v (T k .F 1, T k .R j) AND ... AN
DT k . F n = v (T k .F n, T k .R j) shall mean that conditions.

【0015】本実施例の問合せ文作成装置は、このよう
な入力表(表データ)に対して、表示装置1の画面上
で、表データの任意のフィールド(列)をハイライトす
る機能、任意のレコードをハイライトする機能、検索条
件を満足するレコードをハイライトする機能、ハイライ
トされているレコードに対して集計関数を適用し計算・
表示する機能、および全てのハイライトを解除する機能
を有している。これらの機能は、例えば、マウスなどで
画面上のカーソルを移動させ、クリックすることにより
実行される。
The query creation device of the present embodiment has a function of highlighting an arbitrary field (column) of table data on the screen of the display device 1 with respect to such an input table (table data). Function for highlighting records, function for highlighting records that satisfy search conditions, calculation by applying an aggregation function to the highlighted records
It has a function of displaying and a function of canceling all highlights. These functions are executed, for example, by moving the cursor on the screen with a mouse or the like and clicking.

【0016】例えば、人事表において、マウスでフィー
ルドF1及びF3をクリックすると、図4(a)に示す
ようにフィールドF1及びF3の列全体がハイライトさ
れる。また、マウスでレコード欄R1及びR3をクリッ
クすると、図4(b)に示すようにレコード欄R1及び
R3をハイライトすることができる。さらに、入力装置
2から、図4(c)に示すように検索条件入力欄に検索
条件(ここでは、所属=研究所、給料>25)が入力さ
れると、検索条件に適合するレコードがハイライトされ
る。なお、本例のように複数の検索条件が入力されたと
きは、これらの論理積を検索条件とする。即ち、「所属
=研究所」及び「給料>25」が入力された場合は、
“人事表.所属=研究所AND人事表.給料>25”と
して取り扱われ、レコードR2及びR4がハイライトさ
れる。なお、この検索の実行はメニューなどから指定す
る。また、ハイライトの全解除機能もメニューなどから
指定・実行する。
For example, in the personnel table, when the fields F1 and F3 are clicked with the mouse, the entire columns of the fields F1 and F3 are highlighted as shown in FIG. Further, when the record columns R1 and R3 are clicked with the mouse, the record columns R1 and R3 can be highlighted as shown in FIG. 4B. Further, when a search condition (here, affiliation = lab, salary> 25) is input from the input device 2 to the search condition input field as shown in FIG. Is written. When a plurality of search conditions are input as in this example, the logical product of them is used as the search condition. That is, if “affiliation = lab” and “salary> 25” are entered,
"Personnel table. Affiliation = Laboratory AND Personnel table. Salary>25" is treated, and records R2 and R4 are highlighted. The execution of this search is specified from a menu or the like. In addition, a function for canceling all highlights is designated and executed from a menu or the like.

【0017】本実施例では、上記のようにして、フィー
ルド及びレコードをそれぞれハイライトさせることがで
きるが、フィールド及びレコードを同時にハイライトさ
せることもできる。この場合、図4(d)示すように、
ハイライトされた領域が重なる部分ができる。この部分
をハイライトレベル2と呼び、通常のハイライトレベル
1と区別する。
In this embodiment, the fields and records can be highlighted as described above, but the fields and records can also be highlighted at the same time. In this case, as shown in FIG.
There is a portion where the highlighted areas overlap. This part is called highlight level 2 and is distinguished from normal highlight level 1.

【0018】表データの2行目、集計関数欄をマウスで
クリックすると、図4(e)に示すように、集計関数メ
ニューが画面上に表示される。さらに、メニューをマウ
スでクリックすると、表データの内、ハイライトされて
いるレコードに対して集計関数が適用される。図4
(e)では、人事表においてレコードR2及びR4がハ
イライトされており、“合計”が選択された場合を示し
ている。その結果、ハイライトされているレコードR2
及びR4のフィールド“人事表.給料”の値が合計さ
れ、その結果が人事表の2行目3列目のセルに表示され
る。なお、ハイライトされているレコードがない場合に
は、全てのレコードに対して集計関数が適用される。
When the user clicks the tabulation function column in the second row of the table data with the mouse, a tabulation function menu is displayed on the screen as shown in FIG. Furthermore, when the menu is clicked with the mouse, the aggregation function is applied to the highlighted record in the table data. FIG.
In (e), the records R2 and R4 are highlighted in the personnel table, and a case where “total” is selected is shown. As a result, the highlighted record R2
And the value of the field "HR table. Salary" of R4 is added up, and the result is displayed in the cell of the second row and the third column of the personnel table. If there is no highlighted record, the aggregation function is applied to all records.

【0019】次に、入力表から出力表へのコピー操作に
ついて説明する。入力表から出力表へのコピーは、入力
表においてハイライトされているデータと集計関数の集
計結果についてのみ許される。したがって、本実施例の
問合せ文作成装置が備えるコピー機能は、入力表におい
てハイライトレベルが最も高い箇所全てを出力表にコピ
ーする機能(レコードコピー機能)、及び集計関数の適
用結果を出力表にコピーする機能(集計結果コピー機
能)である。なお、このようなコピー機能は、入力表か
ら出力表へのマウスによるドラッグ&ドロップなどによ
り実現される。
Next, a copy operation from the input table to the output table will be described. Copying from the input table to the output table is permitted only for the data highlighted in the input table and the aggregation result of the aggregation function. Therefore, the copy function of the query creation device according to the present embodiment includes a function of copying all of the portions having the highest highlight level in the input table to the output table (record copy function) and a result of applying the aggregation function to the output table. This is the function of copying (counting result copy function). Such a copy function is realized by dragging and dropping from the input table to the output table with the mouse.

【0020】レコードコピー機能は、図5に示すよう
に、入力表にハイライトレベル2の箇所があるときは、
これらハイライトレベル2の全ての箇所を出力表のレコ
ード欄にコピーする。この時、入力表でハイライトされ
ている全てのフィールド名も出力表のフィールド欄にコ
ピーする。また、レコード(行)のみがハイライトされ
ている場合、レコードコピー機能は、図6(a)に示す
ように、入力表のハイライトレベル1の全ての箇所を出
力表のレコード欄にコピーし、入力表の全てのフィール
ド名を出力表のフィールド欄にコピーする。さらにま
た、フィールド(列)のみがハイライトされている場合
には、図6(b)に示すように、ハイライトされている
全てのフィールドを出力表フィールド欄にコピーし、入
力表のハイライトレベル1の全ての箇所を出力表のレコ
ード欄にコピーする。
As shown in FIG. 5, when the input table has a highlight level 2 as shown in FIG.
All of these highlight levels 2 are copied to the record column of the output table. At this time, all the field names highlighted in the input table are also copied to the field columns of the output table. When only records (rows) are highlighted, the record copy function copies all portions of highlight level 1 of the input table to the record column of the output table as shown in FIG. Copy all the field names of the input table to the field columns of the output table. Furthermore, when only the field (column) is highlighted, as shown in FIG. 6B, all the highlighted fields are copied to the output table field, and the input table is highlighted. Copy all parts of level 1 to the record column of the output table.

【0021】集計結果コピー機能は、図7に示すよう
に、入力表のフィールドの2行目に表示された計算結果
を出力表のレコード欄にコピーする。このとき、出力表
のフィールド欄には、適用した集計関数に応じたフィー
ルド名が自動的に付与される。
As shown in FIG. 7, the counting result copy function copies the calculation result displayed in the second line of the field of the input table to the record column of the output table. At this time, a field name corresponding to the applied aggregation function is automatically given to the field column of the output table.

【0022】以上の説明からも分かる通り、出力表は、
1行目がフィールド欄で、2行目以降がレコード欄であ
る。そして、入力表からコピーされたレコードは、出力
表の左詰め、かつ上詰めで表示される。また、出力表で
のコピー先のセルの位置は、2行目(最初のレコード
行)、かつ、最初の空白列である。例えば、図8(a)
に示す出力表に、入力表から集計結果コピー機能により
給料の合計をコピーすると、図8(b)に示すようにな
る。
As can be seen from the above description, the output table is
The first line is a field column, and the second and subsequent lines are record columns. The records copied from the input table are displayed left-justified and top-justified in the output table. The position of the copy destination cell in the output table is the second row (first record row) and the first blank column. For example, FIG.
When the total of the salary is copied from the input table to the output table shown in FIG. 8 by the tally result copy function, the result becomes as shown in FIG.

【0023】上述したユーザの操作(入力表での操作お
よび入力表から出力表へのコピー操作)は、問合せ文作
成装置の操作記憶部7に記憶される。次に、ユーザの操
作に対して、操作記憶部7でどのような処理がなされる
かについて説明する。
The above-mentioned user operations (operations on the input table and copy operations from the input table to the output table) are stored in the operation storage unit 7 of the inquiry sentence creating apparatus. Next, what processing is performed by the operation storage unit 7 in response to a user operation will be described.

【0024】入力表での操作は、操作記憶部7内に設け
られた入力表操作記憶部8へ記録される。入力表操作記
憶部8は、入力表ごとに用意されるものであり、図9
(a)に示すように、フィールドリスト、レコードリス
ト、検索条件の各スロット、および任意の数の集計関数
構造体から成る。
The operation in the input table is recorded in an input table operation storage section 8 provided in the operation storage section 7. The input table operation storage unit 8 is prepared for each input table.
As shown in (a), the list includes a field list, a record list, each slot of a search condition, and an arbitrary number of aggregation function structures.

【0025】入力表操作記憶部8のフィールドリスト、
レコードリスト、検索条件の各スロットは入力表でのハ
イライトの状態を記憶するためのものである。入力表に
おいてフィールドが新たにハイライトされると入力表操
作記憶部8のフィールドリストスロットにフィールド名
が追加され、レコードがマウスクリックによりハイライ
トされるとそのレコード番号がレコードリストスロット
に追加される。また、検索によりレコードがハイライト
されるとその時の検索条件が検索条件スロット記憶され
る。全てのハイライトが解除された場合は、入力表操作
記憶部のフィールドリストスロット、レコードリストス
ロット、検索条件スロットの内容が全て消去される。
A field list in the input table operation storage unit 8,
Each slot of the record list and the search condition is for storing the state of highlight in the input table. When a field is newly highlighted in the input table, the field name is added to the field list slot of the input table operation storage unit 8, and when a record is highlighted by mouse click, its record number is added to the record list slot. . When a record is highlighted by the search, the search condition at that time is stored in the search condition slot. When all highlights are released, the contents of the field list slot, record list slot, and search condition slot in the input table operation storage unit are all deleted.

【0026】また、集計関数構造体は、適用された関数
の種類および関数が適用された時点でのハイライトの状
態を記憶しておくためのものである。集計関数が計算さ
れると、集計関数、フィールド、レコードリスト、検索
条件の各スロットからなる集計関数構造体が生成され、
入力表操作記憶部8に追加・記憶される。集計関数構造
体の集計関数スロットには適用された集計関数の種類が
記憶され、フィールドスロットには集計関数が適用され
たフィールドが記憶される。また、集計関数構造体のレ
コードリストスロットと検索条件スロットには、集計関
数適用時の入力表操作記憶部のレコードリストスロット
と検索条件スロットの内容がそれぞれそのまま記憶され
る。
The aggregation function structure is for storing the type of the applied function and the state of the highlight at the time when the function is applied. When an aggregate function is calculated, an aggregate function structure consisting of the aggregate function, field, record list, and search condition slots is generated,
It is added and stored in the input table operation storage unit 8. The type of the applied aggregation function is stored in the aggregation function slot of the aggregation function structure, and the field to which the aggregation function is applied is stored in the field slot. Further, the contents of the record list slot and the search condition slot of the input table operation storage unit when the tally function is applied are stored as they are in the record list slot and the search condition slot of the tally function structure, respectively.

【0027】入力表から出力表へのコピー操作は、操作
記憶部7内に設けられたコピー操作記憶部10へ記憶さ
れる。コピー操作記憶部には2種類の構造体が記憶され
る。レコード構造体はレコードコピー機能によりコピー
された場合に、また、集計関数構造体は集計結果コピー
機能によりコピーされた場合に用いられる。コピー操作
が行なわれる度に、これら2種類の構造体のいずれかが
コピー操作記憶部10に記憶される。
The copy operation from the input table to the output table is stored in a copy operation storage unit 10 provided in the operation storage unit 7. Two types of structures are stored in the copy operation storage unit. The record structure is used when copied by the record copy function, and the aggregation function structure is used when copied by the aggregation result copy function. Each time a copy operation is performed, one of these two types of structures is stored in the copy operation storage unit 10.

【0028】図9(b)に示すように、レコード構造体
は、入力表、フィールドリスト、レコードリスト、およ
び検索条件の各スロットから成る。入力表スロットには
コピー元の入力表名が記憶される。レコードリストスロ
ットおよび検索条件スロットには、コピー操作が起こっ
た時点での入力表操作記憶部のレコードリストスロット
の内容および検索条件スロットの内容がそれぞれそのま
ま記憶される。フィールドリストスロットには、入力表
操作記憶部8のフィールドリストスロットが空でない場
合はその内容がそのまま記憶され、空の場合は入力表で
の全てのフィールド名が記憶される。
As shown in FIG. 9B, the record structure includes an input table, a field list, a record list, and slots for search conditions. The input table name of the copy source is stored in the input table slot. In the record list slot and the search condition slot, the contents of the record list slot and the contents of the search condition slot in the input table operation storage unit at the time when the copy operation occurs are stored as they are. If the field list slot in the input table operation storage unit 8 is not empty, its contents are stored as it is in the field list slot, and if it is empty, all the field names in the input table are stored.

【0029】なお、図9に示す入力表操作記憶部8の記
憶内容は、及びコピー操作記憶部10の記憶内容は、図
10に示すように、入力表「人事表」において、(1)
フィールド「人事表.所属」の検索欄に“=研究所”、
フィールド「人事表.給料」の検索欄に“>25”と記
述し、検索を行なう、(2)フィールド「人事表.名
前」において集計関数「カウント」を適用する、(3)
フィールド「人事表.所属」、「人事表.上司」をハイ
ライトする、(4)レコードR1をマウスクリックによ
りハイライトする、(5)フィールド「人事表.給料」
において集計関数「合計」を適用する、という動作を行
い、レコードコピーでハイライトレベル2の箇所を、集
計結果コピーで「人事表.名前」に対する集計関数「カ
ウント」の結果を、出力表にコピーした場合について記
載している。
As shown in FIG. 10, the contents stored in the input table operation storage unit 8 and the contents stored in the copy operation storage unit 10 shown in FIG.
In the search field of the field "Personnel table. Affiliation", "= lab"
Enter ">25" in the search field of the field "HR table. Salary" and perform a search. (2) Apply the aggregation function "count" in the field "HR table. Name". (3)
Highlight the fields "HR table. Affiliation" and "HR table. Boss", (4) highlight record R1 by mouse click, (5) Field "HR table. Salary"
Apply the aggregation function "Total" in, and copy the highlight level 2 part in the record copy, and copy the result of the aggregation function "Count" for "HR table. It describes about the case of doing.

【0030】次に、操作解釈部11での処理について説
明する。操作解釈部11では、操作記憶部7のコピー操
作記憶部10の内容と出力表の状態からユーザの操作の
意味づけを行ない、どのような種類の問合せ文を生成す
べきかを判断し、その結果を問合せ文生成部12に引き
渡す。加えて、操作解釈部11は問合せ文の生成に必要
な情報を問合せ文生成部12に引き渡す。
Next, the processing in the operation interpreting section 11 will be described. The operation interpreting unit 11 gives meaning to the user's operation based on the contents of the copy operation storage unit 10 of the operation storage unit 7 and the state of the output table, and determines what kind of query sentence is to be generated. Is passed to the query sentence generation unit 12. In addition, the operation interpreter 11 passes information necessary for generating a query to the query generator 12.

【0031】操作解釈部11での操作の意味づけは、図
11乃至図15に示す解釈ルール1乃至5に従って行わ
れる。本実施例の問合せ文生成装置が、生成できる問合
せ文の種類は、これらの解釈ルールによって決まり、こ
こでは、4種の問合せ文(検索形式、集計形式、グルー
プ形式、及び結合形式の問合せ文)を作成することがで
きる。もちろん、他の解釈ルールを採用すれば、異なる
問合せ文を作成できる。
The meaning of the operation in the operation interpreting section 11 is determined in accordance with the interpretation rules 1 to 5 shown in FIGS. The type of query sentence that can be generated by the query sentence generating apparatus of the present embodiment is determined by these interpretation rules. Here, four types of query sentences (search query, aggregation format, group format, and join format query sentence) are used. Can be created. Of course, if another interpretation rule is adopted, a different query sentence can be created.

【0032】図11に示す[ルール1]は、検索形式の
問合せ文を生成するための条件を示すものである。その
条件は、出力表へのコピーが単一の入力表から行われ、
そのコピーがレコードコピーのみの場合である。ただ
し、コピーが複数回にわけて行われている場合は、入力
表でのハイライトの状況が全て同じでなければならな
い。例えば、図16は入力表「人事表」から2回に分け
て出力表へのコピーを行った例であるが、図16のコピ
ー操作記憶部10の2個のレコード構造体のレコードリ
ストと検索条件スロットの内容は等しく、人事表でのレ
コードのハイライトの状況は同じである。したがって、
図16に示す例は、ルール1を満足する。
[Rule 1] shown in FIG. 11 shows conditions for generating a query sentence in a search format. The condition is that the copy to the output table is made from a single input table,
This is the case where the copy is a record copy only. However, when copying is performed in a plurality of times, all highlighting conditions in the input table must be the same. For example, FIG. 16 shows an example in which the input table “Personnel Table” is copied to the output table in two separate steps. The record list and the search of the two record structures in the copy operation storage unit 10 in FIG. The content of the condition slot is the same, and the situation of the highlight of the record in the personnel table is the same. Therefore,
The example shown in FIG. 16 satisfies rule 1.

【0033】図12に示すルール2は、集計形式の問合
せ文を生成するための条件を示す。その条件は、出力表
へのコピーが集計関数の結果についてのみ行われ、出力
表のレコードが1行であって、集計関数を適用した時点
でのレコードのハイライトの状況が全てにおいて一致す
る場合である。例えば、図17は人事表での2個の集計
結果を出力表にコピーした例であるが、2個の集計関数
構造体のレコードリストと検索条件スロットの内容は等
しく、人事表でのレコードのハイライトの状況は同じで
ある。従って、図17に示す例はルール2を満足する。
Rule 2 shown in FIG. 12 shows conditions for generating a query statement in a tabulation format. The condition is that copying to the output table is performed only for the result of the aggregation function, the record of the output table is one row, and the highlight status of the record at the time the aggregation function is applied matches all It is. For example, FIG. 17 shows an example in which two aggregation results in the personnel table are copied to the output table. The record list of the two aggregation function structures and the contents of the search condition slot are equal, and the record of the personnel table is The highlight situation is the same. Therefore, the example shown in FIG.

【0034】図13に示すルール3は、グループ形式の
問合せ文を生成するための条件を示す。ルール3の条件
は、グループ化により、出力表に作成されるレコードが
1行(1グループ)だけの場合を示す。即ち、フィール
ドTk .Fj においてのグループ化を行なう場合には、
k .Fj に現れる任意の値を用いて検索を行ない(検
索条件は“Tk .Fj =Some Value”)、その結果に対
して集計関数を適用するといった操作がなされなければ
ならない。例えば、図18に示す例では、人事表におい
て所属ごとに“給料>25”であるレコードのカウント
と給料の合計を求めるための操作を行なった場合のもの
である(フィールド「人事表.所属」でのグループ
化)。すなわち、人事表.所属の「研究所」という1つ
のグループでの集計結果が出力表にコピーされている。
このような出力表を作成するために、人事表のレコード
が“人事表.所属=研究所”で検索されており(集計関
数構造体の検索条件スロット参照)、さらに検索で用い
られた“研究所”という値が出力表にコピーされている
(レコード構造体参照)。従って、図18に示す例はル
ール3を満足する。
Rule 3 shown in FIG. 13 indicates conditions for generating a group form query sentence. The condition of Rule 3 indicates a case where the record created in the output table by grouping is only one row (one group). That is, the fields T k . When performing grouping in F j ,
T k . A search must be performed using an arbitrary value appearing in F j (search condition is “T k .F j = Some Value”), and an operation such as applying an aggregation function to the result must be performed. For example, in the example shown in FIG. 18, the operation for calculating the total of the count and the salary of records where “salary> 25” for each affiliation in the personnel table is performed (the field “HR table. Affiliation”). Grouping). That is, the personnel table. The tally result of one group, “Laboratory” to which the user belongs is copied to the output table.
In order to create such an output table, the records of the personnel table are searched for in "Personnel table. Affiliation = research institute" (refer to the search condition slot of the aggregate function structure), and the "Research" used in the search is further searched. The value "place" has been copied to the output table (see record structure). Therefore, the example shown in FIG.

【0035】図14に示すルール4は、結合形式の問合
せ文を生成するための条件を示すものである。ルール4
の条件は、複数の入力表から出力表へのコピーを行った
場合に、得られた出力表が1行のレコードしか持たない
時である。すなわち、異なる2個の入力表T1 とT2
おいてそれぞれの表で1レコードのみがハイライトされ
(T1 でハイライトされたレコードをT1 .Rj ,T2
のレコードをT2 .Ri とする)、これらのレコードが
出力表の1つのレコードとしてコピーされた場合であ
る。さらにこれに加えて、表の結合が可能となるために
は、v(T1 .Fm ,T1 .Rj )=v(T2 .Fn
2 .Ri )となるフィールドの組(T1.Fm
2 .Fn )が少なくとも一つ以上存在しなければなら
ない。例えば、図19に示す例は、フィールド「人事
表.名前」と「年齢表.名前」において結合を行なう場
合のもので、人事表のv(人事表.名前,人事表.
1 )と年齢表のv(年齢表.名前,年齢表.R3
が、ともに「鈴木」で等しく、「鈴木」の給料と年齢と
を1つの表に結合した例である。
Rule 4 shown in FIG. 14 shows conditions for generating a query sentence in a combined form. Rule 4
Is when the obtained output table has only one row of records when a plurality of input tables are copied to the output table. That is, two different only one record in each table in the input table T 1 and T 2 is highlighted the highlighted record (T 1 T 1 .R j, T 2
Records of T 2 . R i ) when these records are copied as one record in the output table. In addition to this, in order to be able to join the tables, v (T 1 .F m , T 1 .R j ) = v (T 2 .F n ,
T 2 . R i ) (T 1 .F m ,
T 2 . F n ) must be present at least once. For example, the example shown in FIG. 19 is a case in which the fields “personnel table.name” and “age table.name” are combined, and v of the personnel table (personnel table.name, personnel table.name).
R 1 ) and v of the age table (age table. Name, age table. R 3 )
Are the same for "Suzuki", and the salary and age of "Suzuki" are combined into one table.

【0036】上記ルール1から4に当てはまらない場合
は、ルール5に従い、解釈不能と判断する。
If the above rules 1 to 4 do not apply, it is determined that interpretation is impossible according to rule 5.

【0037】以上のようにして、操作解釈部11で解釈
を行った結果(問合せ文の形式)は、問合せ文生成部1
2に引き渡される。また、解釈結果が結合形式の場合
は、結合可能な表とフィールドの全ての組(T1
2 ,T1 .Fm ,T2 .Fn )を表わす情報が操作解
釈部11から問合せ文生成部12へ引き渡される。
As described above, the result of interpretation by the operation interpretation unit 11 (the format of the query sentence) is
Delivered to 2. If the interpretation result is in a join format, all pairs of tables and fields (T 1 ,
T 2 , T 1 . F m , T 2 . Information representing F n ) is passed from the operation interpretation unit 11 to the query sentence generation unit 12.

【0038】問合せ文生成部12では、操作解釈部11
での解釈結果およびコピー操作記憶部10の記憶内容か
ら、問合せ文を生成する。ただし、操作解釈部11での
解釈結果が「解釈不能」であった場合には、問合せ文の
生成は行なわない。以下、本実施例ではデータベース問
合せ言語において最も標準的であるSQL形式の問合せ
文を生成する場合について説明する。
In the query sentence generator 12, the operation interpreter 11
An inquiry sentence is generated from the result of the interpretation in step S1 and the contents stored in the copy operation storage unit 10. However, if the result of interpretation by the operation interpretation unit 11 is “uninterpretable”, no query is generated. In the following, a description will be given of a case in which a query sentence in an SQL format, which is the most standard in a database query language, is generated.

【0039】SQLによって記述された問合せ文は、図
20に示すように、SELECT句、FROM句、JOIN句、WHERE
句、及びGROUP BY句によって構成される。そこで、問合
せ文生成部12では、後述するように、SELECT句、FROM
句、JOIN句、WHERE 句、及びGROUP BY句をそれぞれ生成
して、生成された各句をこの順序で連結し、問合せ文と
する。生成ルールの適用の結果、JOIN句、WHER
E句、GROUP BY句が空の場合は、問合せ文には
これらの句は組み込まれない。
As shown in FIG. 20, a query sentence described in SQL includes a SELECT clause, a FROM clause, a JOIN clause, and a WHERE clause.
Clause and GROUP BY clause. Therefore, the query statement generation unit 12, as described later,
A clause, a JOIN clause, a WHERE clause, and a GROUP BY clause are generated, and the generated clauses are concatenated in this order to form a query statement. As a result of applying the generation rule, JOIN clause, WHER
If the E clause and the GROUP BY clause are empty, the query statement does not include these clauses.

【0040】SELECT句の生成は、問合せ文生成部
12が、コピー操作記憶部10に記憶された全ての構造
体を走査し、出力表にコピーされた全てのフィールドを
SELECT句として記述することにより行われる。す
なわち、図21に示すように、レコード構造体の場合
は、フィールドリストスロットの内容をそのままSEL
ECT句に追加し、集計関数構造体の場合は、集計関数
スロット“Func1 ”、フィールドスロット“T1
3 ”、出力表フィールド名スロット“NewNam
e”を組合せ“Func1 (T1 .F3 )AS New
3 ”という形式に変換し、SELECT句に追加す
る。
The generation of the SELECT clause is performed by the query statement generation unit 12 scanning all the structures stored in the copy operation storage unit 10 and describing all the fields copied to the output table as the SELECT clause. Done. That is, as shown in FIG. 21, in the case of a record structure, the contents of the field list slot
In addition to the ECT clause, in the case of an aggregation function structure, the aggregation function slot “Func 1 ” and the field slot “T 1 .
F 3 ”, output table field name slot“ NewNam
e ”and“ Func 1 (T 1 .F 3 ) AS New
Into a format that F 3 ", to add to the SELECT clause.

【0041】FROM句を生成は、問合せ文生成部12
が、コピー操作記憶部10に記憶された全ての構造体を
走査し、入力表スロットに現れる全ての入力表をFRO
M句として記述することにより行われる。即ち、図22
に示すように、各構造体に含まれる入力表スロットの内
容をFROM句に追加する。
The generation of the FROM phrase is performed by the query statement generation unit 12.
Scans all structures stored in the copy operation storage unit 10 and replaces all input tables appearing in the input table slots with FRO.
This is done by describing it as an M clause. That is, FIG.
As shown in (1), the contents of the input table slot included in each structure are added to the FROM phrase.

【0042】JOIN句は、操作解釈部11の解釈の結
果が結合形式であった場合にのみ生成される。この場
合、問合せ文生成部12は、図23に示すように、操作
解釈部11から引き渡された表の結合を行なうべき表と
フィールドの組(T1 ,T2 ,T1 .F1 ,T2
1 ),…,(T1 ,T2 ,T1 .Fn ,T2 .Fn
の全てを、“T1 JOIN T2 ON(T1 .Fi =T
2 .Fi )”という形式に変換し、JOIN句とする。
The JOIN phrase is generated only when the result of the interpretation by the operation interpretation unit 11 is a combined form. In this case, as shown in FIG. 23, the query sentence generation unit 12 sets a table and a field (T 1 , T 2 , T 1 .F 1 , T 1) to be combined with the table passed from the operation interpretation unit 11. 2 .
F 1 ),..., (T 1 , T 2 , T 1 .F n , T 2 .F n )
All, "T 1 JOIN T 2 ON (T 1 .F i = T of
2 . F i ) "to form a JOIN clause.

【0043】WHERE句の生成は、図24に示すよう
に、検索形式と集計形式、グループ形式、及び結合形式
の場合に分けて行われる。操作解釈部11における解釈
の結果が、検索形式、集計形式の場合、問合せ文生成部
12は、コピー操作記憶部10から任意の構造体を抜き
だし、抜きだした構造体の検索条件スロットの内容“C
ond0”及びレコードリストスロットの内容“R1
…,Rn ”を用いて、WHERE句の条件文を生成す
る。同様に、グループ形式の場合には任意の集計関数構
造体を抜きだし、抜きだした構造体の検索条件スロット
の内容“Cond0”およびレコードリストスロットの
内容“R1 ,…,Rn ”を用いて、WHERE句の条件
文を生成する。なお、ここでは、マウスクリックによる
レコードRi のハイライトという操作を、COND(R
i )という条件のレコードを既存のハイライトに追加す
ると解釈し、“Cond0 COND(R1 ) … C
OND(Rn )”という条件をWHERE句として記述
する。
As shown in FIG. 24, the generation of the WHERE phrase is performed separately for the search format, the tabulation format, the group format, and the combination format. If the result of the interpretation by the operation interpreting unit 11 is a search format or a tabulation format, the query statement generation unit 12 extracts an arbitrary structure from the copy operation storage unit 10 and the contents of the search condition slot of the extracted structure. "C
ond0 ”and the contents of the record list slot“ R 1 ,
, R n ", the condition statement of the WHERE clause is generated. Similarly, in the case of the group format, an arbitrary aggregate function structure is extracted, and the content" Cond0 "of the search condition slot of the extracted structure is extracted. "and the contents of the record list slot" R 1, ..., with R n ", to generate a conditional statement wHERE clause. here, an operation of highlighting the record R i by mouse click, COND (R
i ) is interpreted as a record to be added to the existing highlight, and “Cond0 COND (R 1 )... C
OND (R n ) ”is described as a WHERE clause.

【0044】また、操作解釈部11における解釈の結果
が結合形式であった場合は、結合を行なった2つのレコ
ードをT1 .Ri 、T2 .Rj から“COND(T1
i) COND(T2 .Rj )”という条件を生成
し、WHERE句に記述する。
If the result of the interpretation in the operation interpreting section 11 is a combined form, the two combined records are represented by T 1 . R i , T 2 . From R j "COND (T 1.
R i ) COND (T 2 .R j ) "is generated and described in the WHERE clause.

【0045】GROUP BY句の生成は、操作解釈部
11における解釈の結果がグループ形式であった場合に
のみ行われる。問合せ文生成部12は、図25に示すよ
うに、操作記憶部11の全てのレコード構造体のフィー
ルドリストの内容を連結し、GROUP BY句とす
る。
The generation of the GROUP BY phrase is performed only when the result of the interpretation by the operation interpretation unit 11 is a group format. As shown in FIG. 25, the query sentence generation unit 12 concatenates the contents of the field lists of all record structures in the operation storage unit 11 to form a GROUP BY phrase.

【0046】以上のようにして生成されたSELECT句、FR
OM句、JOIN句、WHERE 句、及びGROUP BY句を連結する
と、図26に示すような問合せ文が得られる。例えば、
操作解釈部11で検索形式と解釈される図16に示す
例、集計形式とされる図17に示す例、グループ形式と
される図18に示す例、及び結合形式とされる図19の
例についてそれぞれ、問合せ文生成部12でSQLを用
いた問合せ文を生成させると、それぞれ図27、28、
29、及び30に示すようになる。
The SELECT clause and FR generated as described above
When the OM clause, JOIN clause, WHERE clause, and GROUP BY clause are linked, a query sentence as shown in FIG. 26 is obtained. For example,
The example shown in FIG. 16 interpreted as the search format by the operation interpreting unit 11, the example shown in FIG. 17 as the aggregation format, the example shown in FIG. 18 as the group format, and the example in FIG. 19 as the combined format When the query sentence generation unit 12 generates a query sentence using SQL, respectively, FIGS.
29 and 30 are obtained.

【0047】問合せ文一般化部13は、一般化命令を受
けて、JOIN句を含む問合せ文と、GROUP BY
句を含む問合せ文とを一般化する。本実施例の問合せ文
作成装置では、表の結合を行なう場合、ユーザは2レコ
ードを出力表の上で1レコードにするという操作をす
る。そのため、この装置が生成する問合せ文には、操作
対象となった2レコードを特定するためにWHERE句
が記述される。このWHERE句を削除してやれば、そ
の問合せ文は、結合可能なレコードの全ての組において
結合を行なう問合せ文となる。そこで、問合せ文一般化
部13は、問合せ文にJOIN句が含まれる場合、図3
1(a)に示すようにWHERE句を削除し、結合可能
なレコードの全ての組において結合を行なうための問合
せ文を生成する。
In response to the generalization instruction, the query sentence generalizing unit 13 sends a query sentence including a JOIN clause and a GROUP BY
Generalize query statements that contain clauses. In the query creation device of the present embodiment, when joining tables, the user performs an operation of changing two records into one record on the output table. Therefore, a WHERE clause is described in the query sentence generated by this device in order to identify the two records to be operated. If this WHERE clause is deleted, the query statement becomes a query statement that combines all the recordable pairs. Therefore, when the query sentence includes a JOIN clause, the query sentence generalizing unit 13
As shown in FIG. 1 (a), the WHERE clause is deleted, and a query sentence for performing a join is generated for all the sets of records that can be joined.

【0048】また、GROUP BY句の場合も同様
に、ユーザが行なう操作は、グループ化されたフィール
ドの特定の値(グループ)に対してのものであり、WH
ERE句の中にグループ化されたフィールドを指定する
項が含まれる。そこで、問合せ文一般化部13では、問
合せ文にGROUP BY句が含まれる場合、図31
(b)に示すようにWHERE句の中からグループ化さ
れたフィールドを含む項を削除し、グループ化されたフ
ィールドの全ての値に対して集計を行なうための問合せ
文を生成する。
Similarly, in the case of the GROUP BY clause, the operation performed by the user is for a specific value (group) of the grouped fields, and
A term that specifies a grouped field is included in the ERE clause. Therefore, when the query sentence includes the GROUP BY clause, the
As shown in (b), the term including the grouped fields is deleted from the WHERE clause, and a query sentence for performing the tally for all the values of the grouped fields is generated.

【0049】例えば、図29及び図30の問合せ文を一
般化すると、それぞれ、図32及び図33に示すような
問合せ文となる。
For example, when the query sentence in FIG. 29 and FIG. 30 is generalized, the query sentence is as shown in FIG. 32 and FIG. 33, respectively.

【0050】なお、上述のようにして得られた問合せ文
は、図示しない問合せ言語変換部において他の問合せ言
語で記述された問合せ文に容易に変換することができ
る。よって、この問合せ文作成装置のよって、様々な問
合せ言語を生成することができる。
The query sentence obtained as described above can be easily converted to a query sentence described in another query language by a query language converter (not shown). Therefore, various inquiry languages can be generated by the inquiry sentence creation device.

【0051】[0051]

【発明の効果】以上説明したように本発明によれば、ユ
ーザが入力表をディスプレイ上で直接操作し、さらに入
力表上のデータを出力表にコピーし、問合せの結果得ら
れるべき表データを作成することにより、操作履歴を操
作記憶部に記録し、操作記憶部に記録された操作履歴か
ら操作の意味づけを操作解釈部で行ない、その結果に基
づき問合せ文生成部において問合せ文を自動的に生成す
るため、ユーザは複雑な問合せ言語の文法などを覚える
必要はなく、入力表での簡単な操作方法を覚えるだけで
問合せ文を作成することが可能である。
As described above, according to the present invention, the user operates the input table directly on the display, further copies the data on the input table to the output table, and converts the table data to be obtained as a result of the inquiry. By creating, the operation history is recorded in the operation storage unit, the meaning of the operation is performed by the operation interpretation unit from the operation history recorded in the operation storage unit, and the query sentence is automatically generated in the query sentence generation unit based on the result. Therefore, the user does not need to memorize the grammar of a complicated query language and the like, and can create a query sentence only by learning a simple operation method in the input table.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明の一実施例の構成を示す図であって、
(a)は概略図、(b)は詳細を示すブロック図であ
る。
FIG. 1 is a diagram showing a configuration of an embodiment of the present invention,
(A) is a schematic diagram, (b) is a block diagram showing details.

【図2】図1のデータベース問合せ言語作成装置の動作
を説明するためのフローチャートである。
FIG. 2 is a flowchart for explaining the operation of the database query language creating device of FIG. 1;

【図3】入力表の概念図である。FIG. 3 is a conceptual diagram of an input table.

【図4】入力表に対する操作を説明するための図であ
る。
FIG. 4 is a diagram for explaining an operation on an input table.

【図5】入力表から出力表へのコピー操作を説明するた
めの図である。
FIG. 5 is a diagram illustrating a copy operation from an input table to an output table.

【図6】入力表から出力表へのコピー操作を説明するた
めの図である。
FIG. 6 is a diagram illustrating a copy operation from an input table to an output table.

【図7】入力表から出力表へのコピー操作を説明するた
めの図である。
FIG. 7 is a diagram illustrating a copy operation from an input table to an output table.

【図8】入力表から出力表へのコピー操作を説明するた
めの図である。
FIG. 8 is a diagram illustrating a copy operation from an input table to an output table.

【図9】入力表操作記憶部及びコピー操作記憶部の記憶
内容を説明するための図である。
FIG. 9 is a diagram for explaining storage contents of an input table operation storage unit and a copy operation storage unit;

【図10】図9に示された記憶内容に対応する入力表の
操作及びコピー操作を説明するための図である。
FIG. 10 is a diagram for explaining an operation of an input table and a copy operation corresponding to storage contents shown in FIG. 9;

【図11】操作解釈部されるルール1を説明するための
図である。
FIG. 11 is a diagram for explaining rule 1 to be interpreted by an operation;

【図12】操作解釈部されるルール2を説明するための
図である。
FIG. 12 is a diagram for explaining rule 2 to be interpreted by an operation interpreter.

【図13】操作解釈部されるルール3を説明するための
図である。
FIG. 13 is a diagram for explaining rule 3 to be interpreted by an operation interpreter.

【図14】操作解釈部されるルール4を説明するための
図である。
FIG. 14 is a diagram for explaining rule 4 to be interpreted by an operation interpreter.

【図15】操作解釈部されるルール5を説明するための
図である。
FIG. 15 is a diagram for explaining rule 5 to be interpreted by an operation interpreter.

【図16】検索形式と判定される出力表及びコピー操作
部の記憶内容を示す図である。
FIG. 16 is a diagram illustrating an output table determined as a search format and storage contents of a copy operation unit.

【図17】集計形式と判定される出力表及びコピー操作
部の記憶内容を示す図である。
FIG. 17 is a diagram illustrating an output table determined to be in an aggregation format and storage contents of a copy operation unit.

【図18】グループ形式と判定される出力表及びコピー
操作部の記憶内容を示す図である。
FIG. 18 is a diagram illustrating an output table determined as a group format and storage contents of a copy operation unit.

【図19】結合形式と判定される出力表及びコピー操作
部の記憶内容を示す図である。
FIG. 19 is a diagram illustrating an output table determined to be a combination format and storage contents of a copy operation unit.

【図20】SQL用いて記述された検索形式、集計形
式、グループ形式、及び結合形式の問合せ文の一例を示
す図である。
FIG. 20 is a diagram illustrating an example of a query sentence in a search format, a tally format, a group format, and a join format described using SQL.

【図21】SELECT句を生成する手順を説明するための図
である。
FIG. 21 is a diagram illustrating a procedure for generating a SELECT phrase.

【図22】FROM句を生成する手順を説明するための図で
ある。
FIG. 22 is a diagram for describing a procedure for generating a FROM phrase.

【図23】JOIN句を生成する手順を説明するための図で
ある。
FIG. 23 is a diagram illustrating a procedure for generating a JOIN phrase.

【図24】WHERE 句を生成する手順を説明するための図
である。
FIG. 24 is a diagram for explaining a procedure for generating a WHERE clause.

【図25】GROUP BY句を生成する手順を説明するための
図である。
FIG. 25 is a diagram for explaining a procedure for generating a GROUP BY clause.

【図26】SELECT句、FROM句、JOIN句、WHERE 句、及び
GROUP BY句を接続して得られる問合せ文の一例を示す図
である。
Fig. 26: SELECT clause, FROM clause, JOIN clause, WHERE clause, and
FIG. 9 is a diagram illustrating an example of a query sentence obtained by connecting GROUP BY clauses.

【図27】図16に示す例について得られる問合せ文を
示す図である。
FIG. 27 is a diagram showing a query sentence obtained for the example shown in FIG. 16;

【図28】図17の示す例について得られる問合せ文を
示す図である。
FIG. 28 is a diagram showing a query sentence obtained for the example shown in FIG. 17;

【図29】図18の示す例について得られる問合せ文を
示す図である。
FIG. 29 is a diagram showing a query sentence obtained for the example shown in FIG. 18;

【図30】図19の示す例について得られる問合せ文を
示す図である。
FIG. 30 is a diagram showing a query sentence obtained for the example shown in FIG. 19;

【図31】問合せ文の一般化を説明するための図であっ
て、(a)は結合形式(JOIN形式)の問合せ文の一般化
を、(b)はグループ形式(GROUP BY形式)の問合せ文
の一般化を示す。
FIGS. 31A and 31B are diagrams for explaining generalization of a query sentence, in which FIG. 31A shows generalization of a query sentence in a join format (JOIN format), and FIG. 31B shows a query in a group format (GROUP BY format). Shows a generalization of a sentence.

【図32】図29に示す問合せ文を一般化したときに得
られる問合せ文を示す図である。
FIG. 32 is a diagram showing a query sentence obtained when the query sentence shown in FIG. 29 is generalized.

【図33】図30に示す問合せ文を一般化したときに得
られる問合せ文を示す図である。
FIG. 33 is a diagram showing a query sentence obtained when the query sentence shown in FIG. 30 is generalized.

【符号の説明】[Explanation of symbols]

1 表示装置 2 入力装置 3 記憶装置 4 コンピュータ 5 データベース 6 入力表 7 操作記憶部 8 入力表操作記憶部 9 出力表 10 コピー操作記憶部 11 操作解釈部 12 問合せ文生成部 13 問合せ文一般化部 REFERENCE SIGNS LIST 1 display device 2 input device 3 storage device 4 computer 5 database 6 input table 7 operation storage unit 8 input table operation storage unit 9 output table 10 copy operation storage unit 11 operation interpretation unit 12 query sentence generation unit 13 query sentence generalization unit

───────────────────────────────────────────────────── フロントページの続き (56)参考文献 特開 平7−36919(JP,A) 特開 平7−78176(JP,A) 特開 昭63−156229(JP,A) 特開 平5−289920(JP,A) 特開 平4−38563(JP,A) 特開 平5−2611(JP,A) 特開 平6−68157(JP,A) 特開 平8−171508(JP,A) 情報処理学会第36回全国大会講演論文 集、P.515−516 (58)調査した分野(Int.Cl.6,DB名) G06F 12/00 G06F 17/30──────────────────────────────────────────────────続 き Continuation of the front page (56) References JP-A-7-36919 (JP, A) JP-A-7-78176 (JP, A) JP-A-63-156229 (JP, A) 289920 (JP, A) JP-A-4-38563 (JP, A) JP-A-5-2611 (JP, A) JP-A-6-68157 (JP, A) JP-A-8-171508 (JP, A) Proc. Of the 36th National Convention of IPSJ, P.S. 515-516 (58) Field surveyed (Int. Cl. 6 , DB name) G06F 12/00 G06F 17/30

Claims (2)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 データベースに登録されたデータの表
示、表示データに対する直接選択操作、前記表示データ
に対する論理検索式による選択操作、及びこれらの選択
操作により得た選択データを対象とする集計演算による
新規データの作成操作が可能な入力表から、当該入力表
において選択されたデータ及び新規作成されたデータを
出力表へコピーし、該出力表上に検索結果として必要な
データの一部または全体を作成することにより、データ
ベース検索を行なうデータベースの問合せ文作成装置で
あって、 前記 入力表及び前記出力表を表示する表示手段と、 前記入力表に対する操作及び前記入力表から前記出力表
へのコピー操作を行うための入力手段と、 前記表示手段と前記入力手段とを制御する制御手段と、 前記入力表に対する操作を表す情報を保持する操作記憶
手段と、 前記コピー操作でコピーされたデータに関連する情報の
みを前記操作記憶手段から取得し記憶するコピー操作記
憶手段と、 該コピー操作記憶手段に記憶された前記情報に基づいて
前記操作の意味を解釈することによりユーザが意図した
問合わせの種類を推定する操作解釈手段と、 該操作解釈手段が解釈した意味に基づいて前記コピー操
作記憶手段に記憶された情報に対応する問合せ文を作成
する問合わせ文生成手段とを有することを特徴とするデ
ータベース問合せ文作成装置。
1. A table of data registered in a database
Display, direct selection operation on display data, the display data
Operations by using a logical search expression for, and their selection
By aggregation operation on the selected data obtained by the operation
From the input table where you can create new data,
In the selected data and newly created data
Copy it to the output table and use it as a search result on the output table.
By creating some or all of the data,
A query generator for a database that performs a base search
There are, display means for displaying the input table and the output table, input means for performing a copy operation to the output table from the operation and the input table for the input table, and the display means and the input means Control means for controlling the operation of the input table, and an operation storage means for storing information representing an operation on the input table ;
A copy operation storage unit for obtaining and storing only the operation from the operation storage unit; and interpreting the meaning of the operation based on the information stored in the copy operation storage unit .
Operation interpretation means for estimating the type of inquiry, and inquiry sentence generation means for creating an inquiry sentence corresponding to the information stored in the copy operation storage means based on the meaning interpreted by the operation interpretation means. An apparatus for creating a database query sentence.
【請求項2】 前記コピー操作により出力表上に検索結
果として必要なデータの一部が作成された場合に、この
時点で前記問合せ文生成手段において作成された問合わ
せ文を、検索結果全体が取得可能な問合わせ文に変換す
る問合せ文一般化手段をさらに有することを特徴とする
請求項1に記載のデータベース問合せ文作成装置。
2. When a part of necessary data is created as a search result on an output table by the copy operation, the query sentence created by the query sentence generating means at this time is replaced with the entire search result. 2. The database query sentence creating apparatus according to claim 1, further comprising a query sentence generalizing unit that converts the query sentence into an obtainable query sentence.
JP7071439A 1995-03-29 1995-03-29 Database query statement creation device Expired - Fee Related JP2798118B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP7071439A JP2798118B2 (en) 1995-03-29 1995-03-29 Database query statement creation device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP7071439A JP2798118B2 (en) 1995-03-29 1995-03-29 Database query statement creation device

Publications (2)

Publication Number Publication Date
JPH08272660A JPH08272660A (en) 1996-10-18
JP2798118B2 true JP2798118B2 (en) 1998-09-17

Family

ID=13460582

Family Applications (1)

Application Number Title Priority Date Filing Date
JP7071439A Expired - Fee Related JP2798118B2 (en) 1995-03-29 1995-03-29 Database query statement creation device

Country Status (1)

Country Link
JP (1) JP2798118B2 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2365552B (en) * 2000-03-30 2004-11-17 Canon Kk Machine interface
GB2365551B (en) * 2000-03-29 2004-04-28 Canon Kk Machine interface
US7043439B2 (en) 2000-03-29 2006-05-09 Canon Kabushiki Kaisha Machine interface
JP4603401B2 (en) * 2005-03-30 2010-12-22 株式会社野村総合研究所 Data conversion system and data conversion program

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63156229A (en) * 1986-12-19 1988-06-29 Fujitsu Ltd Data base retrieving device
JPH05289920A (en) * 1992-04-15 1993-11-05 Hitachi Ltd Method and system for retrieving data base
JPH0778176A (en) * 1993-06-30 1995-03-20 Mitsubishi Electric Corp Data base system
JP2586382B2 (en) * 1993-07-19 1997-02-26 日本電気株式会社 Search condition specification method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
情報処理学会第36回全国大会講演論文集、P.515−516

Also Published As

Publication number Publication date
JPH08272660A (en) 1996-10-18

Similar Documents

Publication Publication Date Title
US5495567A (en) Automatic interface layout generator for database systems
US5428737A (en) Comprehensive bilateral translation between SQL and graphically depicted queries
US6279006B1 (en) Structured data management system and computer-readable recording medium storing structured data management program
US6292792B1 (en) System and method for dynamic knowledge generation and distribution
US5721900A (en) Method and apparatus for graphically displaying query relationships
US7725501B1 (en) System and method for rapid database application deployment and use
US5950190A (en) Dynamic, self-modifying graphical user interface for relational database applications
US5175814A (en) Direct manipulation interface for boolean information retrieval
US6594669B2 (en) Method for querying a database in which a query statement is issued to a database management system for which data types can be defined
US6035300A (en) Method and apparatus for generating a user interface from the entity/attribute/relationship model of a database
JPH07101418B2 (en) How to generate a database query
JPH0475170A (en) Data base operation system
JP2008512794A (en) Object processing graph application development system
EP0753819A1 (en) System and method for accessing cobol data with a cobol compatible structured query language
JPH0844759A (en) System and method for information retrieval
JPH0675738A (en) Apparatus and method for dialog box display
JP3223645B2 (en) Database access method and apparatus
JP2798118B2 (en) Database query statement creation device
JP2839555B2 (en) Information search method
JPH06195189A (en) Configuration system of interactive command
JPS63157228A (en) Hierarchical prosing system
JPH06236305A (en) Method for realization of cursor function in relational database
JPS63282840A (en) Order generation assistance
JPH08255169A (en) Retrieving method for database
JPH052520A (en) Data base system

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 19980603

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20070703

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080703

Year of fee payment: 10

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090703

Year of fee payment: 11

LAPS Cancellation because of no payment of annual fees