WO2008131465A1 - Method for controlling a relational database system - Google Patents
Method for controlling a relational database system Download PDFInfo
- Publication number
- WO2008131465A1 WO2008131465A1 PCT/AT2007/000195 AT2007000195W WO2008131465A1 WO 2008131465 A1 WO2008131465 A1 WO 2008131465A1 AT 2007000195 W AT2007000195 W AT 2007000195W WO 2008131465 A1 WO2008131465 A1 WO 2008131465A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- decision
- companies
- sql statement
- statement
- superordinate
- Prior art date
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2453—Query optimisation
- G06F16/24534—Query rewriting; Transformation
- G06F16/24539—Query rewriting; Transformation using cached or materialised query results
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/242—Query formulation
- G06F16/2433—Query languages
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2452—Query translation
- G06F16/24524—Access plan code generation and invalidation; Reuse of access plans
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2452—Query translation
- G06F16/24526—Internal representations for queries
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2453—Query optimisation
- G06F16/24534—Query rewriting; Transformation
Definitions
- the invention relates to a method for controlling a relational database system by executing a database query in a relational database containing as associated data structure a plurality of data tables linked by relations as well as a table of relations, using a database language.
- the starting point for the invention is the occurrence in practice of similar requests to a relational database. Despite the apparent relationship similar
- a further object of the invention is to enable the non-specialist to easily and intuitively formulate statements which are subsequently automatically converted into statements that are sometimes very complex and even difficult to formulate for the person skilled in the art.
- the object of the invention is to achieve the greatest possible independence from formulated statements and underlying data structures by means of a short notation, which focuses on the nature of a problem. According to the invention, this is achieved in a method mentioned in the introduction by comprising the following steps:
- Value fields is defined and each has at least one decision path
- each decision path at least one of the decision positions can always be reached, which specifies by means of an associated flag that it contains at least one table field which is unambiguously assignable to one of the data tables, possibly by means of supplementary specification of a data table name, to the specific underlying data structure,
- Creating a user SQL statement by a user in a formulating step in which at least one of the table-superordinate value fields is selected from the set of table-superordinate value fields by the user and optionally with parameters, in at least one of the processing areas in at least one of the hierarchy levels, but independent of the data tables used in the user SQL statement, used in the formulation of the user SQL statement, and in which, where appropriate, relationship-based operations are not included
- one or more table-superordinated value fields are created by the user as required, the inner, directed decision graph of the same depending on the existing tables and queries of the given data structure.
- a semi-automated creation of the table-superordinated value fields can be provided.
- table-superordinate value field in the context of the present application, an element is understood which is treated as a table field or as a table in the specification of SQL statements, thus to be treated as such in the statements for the user.
- a value or a set of values can be expected from each table-superordinate value field at the respective position of the statement.
- tablette superordinate refers to the independence of the value fields from the defined tables and queries in the respective data structure
- table parent value fields sometimes return one or more tables after their call, which are not in any relational relationship specified by a user in the statement to the tables or queries associated with them according to an SQL statement, a completion of the missing relational operations is under Application preferably a table of relations and gradually described method in these cases necessary.
- the table of relations contains at least all relationships between all the tables and queries of the respective underlying data structure, and it can also contain freely generated relations.
- a directed decision graph of a table-superordinated value field denotes a directed graph according to the prior art, the nodes of the graph representing decision positions.
- a decision path denotes a possible path by the directed decision graph from a first reachable decision position within it to a last decision position defined. The sum of all decision paths thus gives rise to all possibilities of traversing a decision graph from first decision positions to last decision positions, the superimposition of these different pass possibilities over the decision paths is graphically represented such that branch points arise at certain points of the resulting decision graph.
- the statement resolution step which calls and uses all table-superordinated value fields used in a statement with parameters specified according to the statement
- the decision paths that are affected by the given parameters and their pre-definable evaluation are displayed in each table-superordinate value field until the end of the table-superordinate value field Value field tracked.
- all decision positions are collected and returned as a result, which by means of an associated flag determine that they contain at least one table field that can be uniquely assigned to a table or set of the concrete underlying data structure, as well as all results of those Decision items on which a table-superordinate value field with specified parameters is traversed.
- the result of the passage of a table-superordinate value field is created either as a criterion, grouping, additional quantity and / or lower hierarchy level - SUB-SELECT etc.
- the query language SQL consists of predefined processing areas and processing sequences, such as SELECT, FROM, WHERE, GROUP BY, HAVING, ORDER BY, LIMIT, UNION.
- Table superordinate value fields can sometimes be used in more than one processing area of a specified SQL statement.
- the main element of an SQL query is formed by relationship-based operations, such as projection, join, or selection, or set-based operations, such as set union, set intersection, or set difference.
- relationship-based operations such as projection, join, or selection
- set-based operations such as set union, set intersection, or set difference.
- the invention relates to relational database systems that allow access to the data stored in a database using a database language.
- the widely used database language SQL is used, but the invention is not limited to the use thereof.
- the main tasks of a database system are attaching, modifying, deleting, and managing data and providing it through database queries.
- a relational database system which comprises a computer system with a relational database, a data processing unit and a memory, wherein the data processing unit operates according to the inventive method.
- a computer program may be stored on a computer-readable medium, such as a floppy disk, CD or DVD, having computer program code means, upon loading the computer program, a computer through the program for carrying out the method of producing a data carrier or electronic carrier signal according to the invention is caused.
- a computer program product which has a computer program on an electronic carrier signal in which, after the computer program has been loaded, a computer is caused by the program for carrying out the method according to the invention.
- the invention relates to a computer program having instructions that are set up for carrying out the method according to the invention.
- the invention relates to a computer program product which has a computer-readable medium with computer program code means, in which, after loading the computer program, a computer is caused by the program for carrying out the method according to the invention.
- the invention also relates to a computer program product which has a computer program on an electronic carrier signal, in which, in each case after loading the computer program, a computer is caused by the program for carrying out the method according to the invention.
- 1 is a schematic representation of hierarchy levels within an SQL statement in the form of an ordered tree for the application of an embodiment of the method according to the invention to a query example; 2 shows a schematic representation of Hierarcliiecut within an SQL statement in the form of an ordered tree for the application of an embodiment of the method according to the invention to a further query example; 3 shows a schematic representation of an SQL RTN according to the prior art; 4, 5, 6 each show a schematic representation of tabular value fields according to the invention with their inner directed decision graphs and their decision positions.
- relations-related operations all the required relations of a particular statement are referred to collectively as relations-related operations.
- each relational database there is an associated data structure in the form of a plurality of data tables linked by relations. These are understood to mean data organized in columns and rows, as given below by way of example in Tables 1 to 10.
- the term "row relation” is understood to mean in each case the rows of a table, that is to say, for example, Table 1 companies (company ID, name, street, postcode, city, country, employees, supervisor) and for table 2 departments (department ID, company no "Relationships", however, the connections between each two data tables on each at least one key field, eg 1: 1, 1: n, n: m - 1: n applies to: Companies (Firmald) ⁇ -> Departments (CompanyNr).
- the Firmald column in the Companies table (Table 1) is a primary key for which there can be any number of values in the Departments table (Table 2) in the CompanyNr column.
- each data structure there is a table of relations in which all the data structures associated with the queried database are contained, as well as optionally freely generated relations.
- Sales of certain items in a given period Sales of certain groups of items in a given period
- Each of these sales or count values to be calculated can be formulated via a particular query by a user in SQL. This effort must be provided by the user for each sales query. For all these cases, the SQL queries look fundamentally different and must be reformulated depending on the case. This is possible for the normal user sometimes only with great time and effort. Especially if the underlying data structure, for example due to a Enlargement of the system, all requests must be redesigned.
- a table-superordinate value field and thus also the specifically used table superordinate value field "turnover" in a user SQL statement can be used independently of the data tables and the processing areas defined in this user SQL statement in respective hierarchy levels.
- a concrete question may be:
- the application of the statement resolution step will be shown later in the description to show the focus in this part of the introduction on the basic advantages of the simple, short and data structure independent notation by formulation of user SQL statements according to the invention.
- the used table-superordinate value field returns the turnover taking into account the parameters specified in each case, but at the positions used after the resolution step and the completion of the relationship-related operations in the completion step, the turnover per data set company is calculated taking into account the relation-related operations.
- Another specific question posed by a user may be:
- a simple user SQL statement is specified, which contains the table-superordinate value field turnover with a parameter, whereby the value of this value field delivers the turnover per contact person per company through the statement resolution step and after completing the relationship-related operations in the completion step.
- the inner, directed decision graph of the table-superordinate value field is, according to the underlying data structure, taken into account by the optional parameter "gross "extended by at least one further decision position.
- table-superordinate value field SalesBrutto can contain the same optional parameters as the table-superordinate value field Sales, whereby the inner, directed decision graph of the table-superordinate value field
- SalesBrutto contains only one decision item. This one decision item in the table-superordinate value field SalesBrutto calls the table-superordinate value field Sales with all its optional parameters, with the parameter "Gross" as
- table-superordinate value fields such as these three table-superordinate value fields:
- these table-superordinate value fields use the same parameters as the table-superordinate value field Sales and set these as parameters for their single decision position, which contains the table-superordinate value field Sales.
- the advantage of using table-superordinate value fields at decision positions of an inner, directed decision graph of another table-superordinated value field is that a change of the inner, directed decision graph of the inserted table-superordinate value field does not influence the table-superordinated value field containing this table-superordinate value field at at least one of its decision positions.
- Another example is to supply all the columns of the table companies, the number of events of the last 3 years and the turnover of the last 3 years of the companies that booked more than 10 events in 2006 and more than 1000 euros in 2006:
- the following user SQL statement presents this question:
- This example shows the multiple usage of two different table-superordinate value fields, each with different processing areas.
- the application of the statement resolution step as well as the application of the completion step will be shown later in the description in detail for a variety of examples.
- An RTN is the abbreviation for the well-known term "recursive transition network.”
- An RTN defines the expressive power of a language in which syntactically formable options are defined in it.An extension of the RTN of a language leads to a stronger expressiveness of the same.
- First-to-fourth-generation languages, including SQL, are turing-complete, meaning a language's increased expressiveness means that complex questions can be defined more easily and more accurately, especially by a non-specialist given statements.
- Each request request is from a fixed predetermined sequence of compulsory sequentially arranged processing areas 340, 341, 342, 343, 344, 345 with keywords 20, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331
- decision positions 310, 311, 312, 313 - for the sake of simplicity only for the introductory keywords 324, 326, 328, 330 of the processing areas 342, 343, 344 and 345 - a very specific selection of keywords can be made to receive the desired inquiry result.
- a particular grouping of keywords each form a processing area, eg, FROM (keywords 322, 323), WHERE (keywords 324, 325), GROUP BY (keywords 326, 327), etc., each processing area performing a set processing function associated with it, eg, forming FROM Cartesian products with the possibility of special JOINs.
- SQL and related query languages are relatively limited and there are a number of queries which can only be described in a very cumbersome and tedious manner with the given processing areas in the given processing order and therefore become more complex and complex slower access plan is generated than actually required.
- Table-higher value fields are created in a preset step.
- the definition of table-superordinate value fields with possibly optional parameters as well as their inner, directed decision graph can be done, for example, in a system table, in a text or XML file.
- the table-superordinated value fields are preferably read into the memory once prior to the analysis of SQL statements, so that they can be accessed quickly at any time.
- table-superimposed value fields are created by means of the introductory string "Define ConnectionField” followed by a freely selectable name corresponding to the function of this field.
- the name of the table-superordinate value field is followed by an open parenthesis and a list of the optional parameters Listing is terminated with a closed parenthesis
- the end of a table-superordinate value field is identified in the description by means of the string “End Define”, which concludes a table-superordinate value field.
- the inner, directed decision graph of a table-superordinate value field is defined within the introductory string and the string terminating this table-superordinate value field.
- each decision path at least one decision position can always be reached, which specifies by means of an associated flag that it contains at least one table field which is unambiguously assignable to one of the data tables, possibly by means of supplementary specification of a data table name, of the specific underlying data structure.
- a table-superordinate value field is created whose inner, directed decision graph has a single decision path with only one decision position.
- a decision position is reached which, regardless of a given data structure, reaches a table field.
- This decision position also contains a processing function and the specification of the data table to which the table field used refers.
- a first table-superordinate value field is created, which is added to the entirety of the table-superordinate value fields and, for the sake of simplicity, contains no optional parameters: Define ConnectionField Count () Count (Distinct Fi ⁇ nen.FirmalD) End Define
- the inner directional decision graph which exists on the single decision path 1051, becomes a table-superordinate value field 1001 is shown in FIG.
- the decision position 1101 contains a value which, upon reaching this decision position 1101, is added to the result of the passage of the table-superordinate value field 1001.
- the inner, directed decision graph of this table-superordinate value field has no influence on the use in a user SQL statement, so for a different data structure a table-like value field of the same name can be created, which has the following inner, directed decision graphs with possibly only one Decision position contains:
- FIG. 5 shows the inner, directed decision path 1051 and its decision position 1101 of the table-superordinated value field 1001 adapted for another data structure.
- At least one data table to be reached is defined, in concrete terms, the data table companies or table_companies. On the basis of a specified statement, it is searched from which data table or set of these at least one table to be reached is to be reached.
- SELECT Count Distinct Company.CompanyID AS Number of companies or SELECT Count (Table_Firmen.PK_Firma) AS Number of companies
- SELECT Count Distinct Company.CompanyID AS Number of Companies FROM Companies or SELECT Count (Distinct Table_Firmen.PK_Firma) AS Number of Companies FROM Table_Companies
- This final statement contains all the necessary relationship-based operations and can thus be parsed by a SQL engine.
- all SQL statements are user SQL statements in which at least one of the table-superordinate value fields from the entirety of the table-superordinate value fields is selected by the user and optionally with parameters, in at least one of the processing areas in at least one of the hierarchy levels, but independent of the User SQL statement used in the formulation of the user SQL statement, and in which, where appropriate, relationship-based operations are not included.
- This transient SQL statement like all subsequent transient SQL statements as well, can be augmented with the necessary relational operations as shown below.
- the following final SQL statement is generated and passed to an SQL processing engine for analysis, optimization, and execution:
- the converted transitional SQL statement automatically creates the following new and final SQL statement into which the relationship-related operations are already inserted by means of the procedures shown below:
- the converted transitional SQL statement automatically creates the following new and final SQL statement into which the relationship-related operations are already inserted by means of the methods shown below:
- the principle shown above can also be used to omit the GROUP BY processing area in the user SQL statement, since an identical statement can be generated in this case.
- the transitional SQL statement automatically converted in the statement resolution step is as follows:
- This transient SQL statement contains all the necessary relationship-based operations, so the final SQL statement in this case equals the transient SQL statement.
- An algorithm can detect that there is an aggregate function in the SQL processing area WHERE, which is why this processing information is moved to the HAVING processing area and the final SQL statement therefore has the following syntax, which is extended by the missing relationship-based operations:
- a table-superordinate value field can also be set in the FROM processing area of a user SQL statement, which creates a separate quantity for this table-superordinate value field in the FROM processing area:
- Processing range FROM is used and can generate a corresponding, simple final SQL statement:
- An advanced RTN based on which SQL statements can be created, can transform the following question into a state-of-the-art SQL statement: First, a simple table-superordinate value field is created, which returns the revenue in each case in connection with the tables used in an SQL statement:
- the table-superordinate value field Umatz_Ge Scheme which is specified in the processing area SELECT of the user SQL statement, refers to the individual data records of the Cartesian product, ie the total turnover per company and contact person is calculated using this table-superordinate value field.
- a simple algorithm recognizes that the result of the table-superordinate value field Sales_Total () at the two positions used in the respective processing areas in the user SQL statement contains at least - in the specific case exactly - a data table which is not stored in the user SQL Statement specified in the data tables or Cartesian products of the respective hierarchy level.
- an intermediate set or a SUB-SELECT is formed in the resolution step for the conversion of this user SQL statement into the transitional SQL statement.
- This final SQL statement is passed to a SQL engine which analyzes, optimizes and calculates this state-of-the-art statement.
- a simple algorithm recognizes that, in the processing area WHERE, a table is connected to a table-superordinate value field via a point, and therefore this information must be transferred to the processing area FROM.
- This table-superordinate value field 1002 is shown in FIG.
- This table-superordinated value field 1002 has an inner, directed decision graph 1051, from which, depending on the evaluation of the parameters 1102, partial decision paths are traversed, whereby when passing through this table-superordinate value field 1002, each time results in a tracked decision path.
- the product-formation processing area which contains the data tables to be used in the respective hierarchy level and describes the formation of a Cartesian product for them, is defined as an optional decision path only, and in those cases where this product-building processing area is not specified in the user SQL statement, it is automatically created in a later step and, for example, by means of a table of relations, determines all the data tables needed to resolve the user's SQL statement be inserted in this processing area and
- the SQL RTN can be extended to extend those decision positions in the RTN of SQL to which a table name can be specified independently of the processing areas, such that instead of a table name, a table-superordinate value field is allowed at those decision locations, with a table-topping Value field does not necessarily have to follow further decision positions, and the user SQL statements concerned by this RTN extension are first transformed in the resolution step into a transitional SQL statement and subsequently into a final SQL statement
- the following simple user SQL statement shows two table-superordinated value fields, which are specified in each case at a decision position in the user SQL statement on which a data table name is also permitted:
- RTN of SQL to which a table field name can be specified independently of the processing areas, are extended in such a way that instead of a
- Table field name a table-superordinate value field is permitted at these decision positions, whereby the table-superordinate value field does not necessarily require more
- User SQL statements in the resolution step are first converted into a transient SQL statement and subsequently into a final SQL statement, and
- table-superordinate value field is inserted in the statement resolution step in a directly subordinate hierarchy level containing this table-superordinate value field.
- the user SQL statement shows two table-superordinated value fields, which are used at decision positions in the SQL RTN, to which a table field name is also permitted.
- This user SQL statement returns the company name, department name, and revenue per department, with results sorted by company sales.
- the SQL RTN can also be extended by extending those decision positions in the RTN of SQL to which a table name can be specified independently of the processing areas such that these table names optionally have a connection character, preferably a period followed by a table, a table field, a table-superordinate value field, a comparison operation, or an aggregate function.
- the following example shows a user SQL statement in which an aggregate function, a table name with a following aggregate function and a table name with a table-superordinate value field.
- This user SQL statement is converted into this final SQL statement in the following statement analysis step and then in the completion step:
- the SQL RTN can also be extended such that those decision positions in the RTN of SQL to which a table field name can be specified independently of the processing areas are extended in such a way that optionally a connection character, preferably A point followed by a table, a table field, a table-top value field, a comparison operation, or an aggregate function is allowed.
- AVG Firmen.PLZ.AniereKontaktpersonen ()
- AVG Companies.PLZ.Abricen.Count
- the SQL RTN can also be extended by expanding those decision positions at which a table-superordinate value field can be specified independently of the processing areas in such a way that a connection character, preferably a point, is optionally added to these table-superordinate value fields.
- a connection character preferably a point
- the Supervisor table field in the Firms table will not be included as a text field but as a numeric field and contain a relation to a separate table, such as the Employees table ,
- the text field Maintainer in the Company table is converted to the Number field MaintainerNo and another table Employee (employee), Last name, First name, ...) is created, which contains the following relation to the Company table:
- this user SQL statement is converted into:
- this automatically generated SQL statement will be augmented by the relational operations, as shown later in the application. This results in the following final SQL statement for the currently underlying data structure:
- This statement given by a user, is automatically converted into the following statement via a table of relations after the statement resolution step and the completion of missing relationship-related operations, for example, as shown below:
- ConnectionField companies NumberContact Persons () Count (Distinct Contacts.ContactID) End Define
- ConnectionField Company_GetPLZsOfOrt (OfOrt) SELECT Location_PLZ.PLZ WHERE LocationJPLZ.loc IN (Param: OfOrt) End Define
- ConnectionField Company_GetOrtOfPLZ (OfPLZ) SELECT Location_PLZ.Location WHERE Location_PLZ .PLZ IN (ParamOfPLZ) End Define
- an additional table-superordinate value field Firmen.Ort can be created which calls the table-related value field GetOrtOfPLZ () at its single decision position of its inner, directed decision graph and the PLZ as parameter the current company hands over:
- the inner, directed decision graph of the table superordinate value field FirmenMitParametern () can be changed as follows, without already existing SQL statements using this table-top value field in at least one of its processing areas need to change:
- Equivalent can be the inner, directed decision graph of the table-superordinate value field Companies. Have the following single decision position in its single decision path:
- table-superordinated value fields are superior to all tables present in a data structure. This means that all tables and all sets can access each table-superordinate value field from the set of table-superordinate value fields and use it in SQL statements.
- ConnectionField Number of events time period, supervisor, ActEventStatus
- Param Period THEN Events.
- V ADatum Param: Period IF Param: Supervisor THEN Company Supervisor IN (Param: Supervisor) IF Param: Act EventStatus THEN
- Last (auxiliary status code) Param: AktVerwegungStatus END IF
- the table-superordinate value field returns in its result processing information which relates to the table Events.
- the table-superordinate value field is inserted, for example, as a SUB-SELECT:
- the following step in which it is determined that the relationship-related operations are incomplete in this automatically generated statement, completes this example by the relation-related operations according to the method shown below.
- the final statement is not shown due to its immense length. Only the first analysis step is shown, in which the algorithm recognizes that the table Articles is used in the first hierarchy level and the tables Events, Employees in the second and third hierarchy levels (the two SUB-SELECTS Müller 2006 and Müller2005) and companies are present.
- the relational connections between these tables are automatically inserted taking into account the respective hierarchy levels by means of the method shown below, whereby a final, optimizable and processable SQL statement that can be analyzed by a SQL engine is automatically made available.
- This user SQL statement is converted into the following final SQL statement by means of the resolution step and the completion step:
- Sub_Ort_PLZ.Location WHERE Sub_Firmen.PLZ Sub_Ort_PLZ.PLZ GROUP BY Sub_Ort_PLZ.Location HAVING Count (*)> 100)
- This statement is automatically updated in a subsequent step around the missing relation-related operations automatically, for example by means of a table of relations and following the procedure shown below, resulting in this new, definitive SQL statement:
- the algorithm which automatically inserts the relationship-related operations in a new, final SQL statement, taking into account the hierarchy levels and the table of relations, is given the information by the information "Sub_" & table name
- ConnectionField sales (period, seller, net) IF Param: Room THEN
- VADatum Param: Period END IF
- statement resolution step is further applied, resulting in a final processable SQL statement according to the prior art.
- This statement resolution step as well as the subsequent step, in which the relationship-related operations are inserted in a new statement, has already been shown many times and is therefore no longer executed here.
- the following example shows the number of contact persons per location by abstracting the contact's data tables as a table-topped value field for the aggregated Company.Order table field.
- This statement will be changed after applying the resolution step in subsequent SQL statement, which contains no relation-related operations, and extended in a further step to the missing relationship-related operations.
- the resolution of the table-superordinate value field Companies. Place is not shown in this step to focus the example.
- Event.VADatum Param: Minimum_Turn_Time END IF END IF
- a decision position is reached in each of the five defined decision paths, which contains at least one table field that can be uniquely assigned to a table.
- the processing command DISTINCT often follows the keyword COUNT in the examples shown. This processing command can always be inserted and the need for it can be determined by a subsequent SQL optimizer. Likewise, it can be automatically recognized that the processing command DISTINCT in combination with the processing command COUNT is only required if in a hierarchy level the processing function COUNT is to be applied to a table of the defined quantity, which table is not the last level in this hierarchy level.
- This user-created statement is automatically converted as follows:
- processing function Count in combination with the table companies does not refer to the last level of the defined quantity, ie the Cartesian product of the two tables companies and departments. It is also recognized that the
- Processing function Count in combination with the table Departments refers to last level of the defined quantity. Accordingly, the keyword DISTINCT is only inserted in combination with COUNT companies.FirmalD.
- Table superordinate value fields are also very suitable for use in a graphical user interface. If a table is selected, the totality of all existing table-superordinate value fields can also be displayed for selection. Likewise, those table-superordinate value fields whose names are made up of a table name, a dot, and a table-field-naming name can be displayed as table fields of a respective table.
- Table superordinate value fields have the same meaning for the use of all relational data structures and SQL dialects, such as OLAP, Geo-SQL, T-SQL, etc. Similarly, the method according to the invention can be applied to all other other request languages such as e.g. OQL be used.
- ad 1) specify processing functions and data tables and their columns to which the processing functions are to be applied and the order and hierarchy level with which the processing is to be performed.
- This request contains only the tables without relations to which processing functions are to be applied. This provides independence from any data structure and at the same time results in a shortening of the spelling and thus an increase in clarity.
- otherwise usual Cartesian product formations which are restricted by relations, away, because in the statement all information is present, which can be used in combination with the table of relations for the determination of an access path of the respective data structure, so given on the one hand independence of the concrete data structure and on the other hand the input of the request for the user is shortened and limited only to the essentials, which in turn increases the clarity.
- the query results in a natural order of the data tables used as well as hierarchy levels, which, using the table of relations (Table 11), result in sub-access paths for the generation of an SQL query. Statements are determined for the respective data structure.
- the above-mentioned order and the hierarchical levels of the data tables used are preferably represented in the form of an ordered tree 7 (FIG. 1) containing a root 10 and nodes 11, 12, 13 and 14, the node 14 being a subnode to the node 13 ,
- the root 10 of the ordered tree 7 contains as information field 21 all names of the data tables only of the higher-level request, for example in the form of a list or an array, conveniently in the order given in the statement, optionally without duplicate data table names.
- the information field 21 includes the data table COMPANIES (Table 1).
- Subordinate queries (SUBSELECT) and their subordinate subqueries (SUBSELECT in SUBSELECT) 3 are subordinate to the root 10 and are entered as nodes 11, 12, 13, 14 in the tree structure.
- the information fields 22, 23, 24, 25 of the nodes 11, 12, 13, 14 contain the sub-queries assigned names of the data tables that were specified in the respective SUBSELECT, also in the form of a list or an array.
- node 13 For node 13, these are the data tables EVENTS (Table 5), DEPARTMENTS (Table 2) and EVENTS (Table 5) in information field 24.
- the SUBSELECT of node 13 contains, according to the question, another SUBSELECT by node 14, which in its turn Information field the data tables INVOICE POSITIONS (Table 9) and
- This tree 7 is traversed in a preorder pass: node 10, node 11, node 12, node 13 and node 14.
- the access path determination which specifies an access order to the database concretely, by using the table of relations between each two consecutive selected data tables, a partial access path based on the is calculated between the successive data tables existing relations, and composed of all calculated partial access paths of the access path.
- Example B Based on the access paths determined with the table of relations given above (Table 11), it is now possible to use relationship-oriented operations in the database statement specified in accordance with the invention (Example B), whereby the following SQL statement emerges (the operations used are in italics) which of each one SQL standard supporting database system can be processed. A possible form of calculation will be explained below.
- the notation according to the invention and the generated notation can be adopted and a recalculation is omitted. This is only done when the data structure changes or at the same or the statement itself. As a result, the very short period of time for the conversion falls into place
- the access path refers step by step to the data tables. These references are followed step by step to access the database.
- a root of the ordered tree includes, for example: A, C, F, B. Sub-paths thus arise
- Subpath AC A B C
- Subpath CF C D E
- Subpath FB F E D C B
- Root (node) 101 with information field 201 which contains C 5 A 5 D node 102 with information field 202, which contains G 5 E node 103 with information field 203, which contains F, I, G node 104 with information field 204, which K 3 H 3 K 5 B contains node 105 with information field 205, which contains G 5 D.
- the table of relations belonging to the selected data structure simplifies the representation by connecting alphabetically successive data tables in each case by a common relation field, thus A ⁇ -> B 5 B ⁇ -> C 5 C ⁇ -> D,
- the ordered tree created for a particular query is traversed in a so-called preorder order by traversing all other nodes 102, 103, 104, 105 corresponding to the hierarchy levels, starting from a first node, the root 101 of the ordered tree 107.
- FIG. 2 shows a tree representation of a request that is not specified in more detail.
- the root 101 (top node) contains a list or array or the like in the information field 201. all of the data table names contained in the hierarchical level 1 of the higher-level request, wherein in the query not specified-as described above-only the data tables to which processing functions are applied are given.
- the order of the given data tables is C, A, D.
- a node 102, 103, 105 has been created for each subquery of the superordinate request, which contains as information field 202, 203, 205 the data table names used in this subquery as list, array or the like.
- the order is for 102 eg G 5 E, for 103 eg F 5 I 5 G etc
- the hierarchy level 1.2.1 represents the subquery to subquery 1.2 (node 103), which in turn contains as information field 204 the data table names K 5 H 5 K, B used therefor.
- the list of data tables is e.g. In the information field 201, the data tables C, A, D are traversed, and for each two consecutive data tables in the list, the partial access paths are calculated, as already described above, multiple passes are eliminated to unnecessary product formations, which result in a false product , to avoid.
- the next node in the preorder sequence is searched for. Between the first data table of the list of the information field of this next node and the last data table of the list of the information field of its direct predecessor, the sub-access path is determined, then the list of this next node is traversed to the last data table as described above. For example,
- Node 104 Passing the List of Data Tables in Information Field 204: K, H, K, B
- next node is node 105, but its direct predecessor is node 101, therefore the connection between G (node 105) and D (node 101) is searched for and the sub-access path computed. Thereafter, the passage of the data tables G, D in the information field 205 in the node 105 of the tree 107th
- duplicate sub-paths are removed, discarding any duplicate or multiple data table names and relations for the particular node or any of its predecessors, up to and including the root.
- the table of relations (Table 12) in e.g. read in a graph, wherein the edges of the graph also each contain the relations conditions to determine using the graph theory connections between two data tables on the relations.
- C ⁇ A results as a path between C and A as a result of e.g. shortest route calculation following list:
- a -> D is the path A, B 5 C, D
- This one is at the end of the list of the current node, here the root, arrived.
- the next step is to determine if there are any previous nodes. In the case of the root this is by definition not true.
- Next node 103, predecessor node 101 first data table current node and last data table predecessor node
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention relates to a method for controlling a relational database system by carrying out a database query in a relational database, comprising the following steps: creation of at least one value field, which is superordinated to the tables and which contains an internal oriented decision graph, in an initialization step; creation of a client SQL statement in which at least one of the value fields superordinated to the tables is used, in a formulation step; carrying out of a subsequent, automatic statement-resolution step in which a new transition SQL statement is created by retrieving and processing the value fields which are superordinated to the tables and used in the client SQL statement, optionally along with additional parameters, and the result of this processing is used in the original SQL statement in place of the value field superordinated to the tables; automatic completion of the transition SQL statement by optionally adding, in a completion step, faulty and/or incomplete relation-related operations, producing a final SQL statement which can be analyzed, optimized, and processed by any engine supporting the SQL standard.
Description
Verfahren zur Steuerung eines relationalen Datenbanksystems Method for controlling a relational database system
Die Erfindung betrifft ein Verfahren zur Steuerung eines relationalen Datenbanksystems durch Ausführung einer Datenbankanfrage in einer relationalen Datenbank, welche als zugeordnete Datenstruktur eine Vielzahl durch Relationen miteinander verbundene Datentabellen sowie eine Tabelle der Relationen enthält, unter Verwendung einer Datenbanksprache.The invention relates to a method for controlling a relational database system by executing a database query in a relational database containing as associated data structure a plurality of data tables linked by relations as well as a table of relations, using a database language.
Der Ausgangspunkt für die Erfindung ist das in der Praxis vorkommende Auftreten ähnlicher Anfragen an eine relationale Datenbank. Trotz der ersichtlichen Verwandtschaft ähnlicherThe starting point for the invention is the occurrence in practice of similar requests to a relational database. Despite the apparent relationship similar
Fragestellungen sind bisher mit unter stark von einander abweichende, lange und unübersichtliche SQL-Statements notwendig. Insbesondere für den Nicht-Fachmann ist derenQuestions are so far with under strongly divergent, long and confusing SQL statements necessary. In particular for the non-specialist is their
Anwendung mitunter sehr schwierig. Das redundante Teilformulieren ähnlicher Bereiche ist bei leichten Änderungen der Datenstruktur besonders nachteilig. Auch wenn ähnliche Anfragen erfordert sind, welche weitere Berücksichtigungen bzw. veränderte Antworten liefern sollen, müssen jeweils aufwendig gänzlich neue Statements erzeugt werden.Application sometimes very difficult. The redundant sub-formulation of similar regions is particularly disadvantageous with slight changes in the data structure. Even if similar queries are required, which are to provide further considerations or changed answers, elaborate new statements must be generated in each case.
Ausgehend davon ist es ein Ziel der Erfindung, ein oben genanntes Verfahren anzugeben, welches bei ungefähr ähnlicher Fragestellung in verschiedenen Statements eine Vereinheitlichung der Abfragestatements ermöglicht und damit eine deutliche Verringerung der erforderlichen Anfragezeilen erzielt. Dies erhöht auch die Übersichtlichkeit und nachfolgende Veränderbarkeit insbesondere durch Dritte der von Anwendern formulierten Statements wesentlich.Proceeding from this, it is an object of the invention to specify an above-mentioned method, which makes it possible to unify the query statements with approximately similar questions in various statements and thus achieves a significant reduction in the number of request lines required. This significantly increases the clarity and subsequent variability, especially by third parties of the statements formulated by users.
Weiteres Ziel der Erfindung ist es, dem Nicht-Fachmann die einfache und intuitive Formulierung von Statements zu ermöglichen, welche nachfolgend automatisch in mitunter sehr komplexe und sogar für den Fachmann nicht ohne Mühe formulierbare Statements umgewandelt werden.A further object of the invention is to enable the non-specialist to easily and intuitively formulate statements which are subsequently automatically converted into statements that are sometimes very complex and even difficult to formulate for the person skilled in the art.
Ebenfalls ist es Ziel der Erfindung, mittels kurzer Schreibweise, welche den Fokus auf das Wesen einer Fragestellung richtet, eine höchstmögliche Unabhängigkeit von formulierten Statements und zugrunde liegenden Datenstrukturen zu erreichen.
Erfindungsgemäß wird dies bei einem eingangs genannten Verfahren dadurch gelöst, dass es die folgenden Schritte umfasst:Likewise, the object of the invention is to achieve the greatest possible independence from formulated statements and underlying data structures by means of a short notation, which focuses on the nature of a problem. According to the invention, this is achieved in a method mentioned in the introduction by comprising the following steps:
Erstellen zumindest eines tabellenübergeordneten Wertefeldes, gegebenenfalls optionale Parameter enthaltend, in einem Voreinstellungsschritt, wobei das oder die erstellten tabellenübergeordneten Wertefelder zu einer Gesamtheit von tabellenübergeordnetenCreating at least one table-superordinated value field, possibly containing optional parameters, in a presetting step, wherein the table or parent table created is one of a set of table-superordinated value fields
Wertefeldern zusammengefasst werden, und wobei jedes der erstellten tabellenübergeordneten Wertefelder einen inneren, gerichteten Entscheidungsgraphen aufweist, der unabhängig von den inneren, gerichteten Entscheidungsgraphen der anderen erstellten tabellenübergeordneten Wertefelder der Gesamtheit der tabellenübergeordnetenValue fields are summarized, and wherein each of the created table-superordinated value fields has an inner, directed decision graph, which is independent of the inner, directed decision graphs of other created table-superordinate value fields of the entirety of the table superordinate
Wertefelder definiert ist und jeweils zumindest einen Entscheidungspfad aufweist,Value fields is defined and each has at least one decision path,
wobei für jedes tabellenübergeordnete Wertefeld die erforderlichen Entscheidungspfade und deren jeweilige Entscheidungspositionen durch die vorbestimmbare Auswertung der dem jeweiligen tabellenübergeordneten Wertefeld zugehörigen optionalen Parameter und/oder von vorgegebenen Funktionen bestimmt werden,wherein for each table-superordinated value field the required decision paths and their respective decision positions are determined by the predeterminable evaluation of the respective table-superordinate value field associated optional parameters and / or predetermined functions,
und wobei in jedem Entscheidungspfad immer zumindest eine der Entscheidungspositionen erreichbar ist, welche mittels eines zugehörigen Kennzeichens festlegt, dass diese zumindest ein Tabellenfeld enthält, das eindeutig einer der Datentabellen, gegebenenfalls mittels ergänzender Angabe eines Datentabellennamens, der konkret zugrunde liegenden Datenstruktur zuordenbar ist,and wherein in each decision path at least one of the decision positions can always be reached, which specifies by means of an associated flag that it contains at least one table field which is unambiguously assignable to one of the data tables, possibly by means of supplementary specification of a data table name, to the specific underlying data structure,
Erstellen eines Anwender-SQL-Statements durch einen Anwender in einem Formulierungsschritt, in welchem zumindest eines der tabellenübergeordneten Wertefelder aus der Gesamtheit der tabellenübergeordneten Wertefelder von dem Anwender ausgewählt und gegebenenfalls mit Parametern, in zumindest einem der Verarbeitungsbereiche in zumindest einer der Hierarchiestufen, aber unabhängig von den im Anwender-SQL-Statement verwendeten Datentabellen, bei der Formulierung des Anwender-SQL-Statements eingesetzt wird, und in welchem gegebenenfalls relationenbezogene Operationen nicht enthalten sindCreating a user SQL statement by a user in a formulating step in which at least one of the table-superordinate value fields is selected from the set of table-superordinate value fields by the user and optionally with parameters, in at least one of the processing areas in at least one of the hierarchy levels, but independent of the data tables used in the user SQL statement, used in the formulation of the user SQL statement, and in which, where appropriate, relationship-based operations are not included
Ausführen eines nachfolgenden, automatischen Statement-Auflösungsschritts, in dem ein neues Übergangs-SQL-Statement dadurch erstellt wird, dass sämtliche im Anwender- SQL-Statement eingesetzten tabellenübergeordneten Wertefelder gegebenenfalls unter
Berücksichtigung der mitgegebenen Parameter aufgerufen und durchlaufen werden und das Ergebnis dieser Durchläufe anstelle des jeweils verwendeten tabellenübergeordneten Wertefeld in das ursprünglich angegebene SQL-Statement eingesetzt wird,Execution of a subsequent, automatic statement resolution step, in which a new transitional SQL statement is created by the fact that all the table-superordinate value fields used in the user SQL statement are under Considering the given parameters are called and run through and the result of these runs is used instead of the table-superordinate value field used in the originally specified SQL statement,
wobei die inneren, gerichteten Entscheidungsgraphen der im angegebenen Anwender-SQL- Statement enthaltenen tabellenübergeordneten Wertefelder erst bei Ausführung des Statement-Auflösungsschritt in Abhängigkeit von den Verarbeitungsbereichen, in denen sie jeweils verwendet werden, für die Verarbeitung herangezogen werden,wherein the inner, directed decision graphs of the table-superordinated value fields contained in the specified user SQL statement are used for processing only when the statement resolution step is executed, depending on the processing areas in which they are used,
wobei bei Aufruf der tabellenübergeordneten Wertefelder dem sich jeweils über die Auswertung der mitgegebenen Parameter aus dem Anwender-SQL-Statement und/oder der Funktionen ergebenden Entscheidungspfad des inneren, gerichteten Entscheidungsgraphen desselben bis zum Ende gefolgt wird,wherein, when calling the table-superordinate value fields, the decision path of the inner, directed decision graph of the same, which results from the evaluation of the given parameters from the user SQL statement and / or the functions, is followed until the end;
und als Ergebnis eines Aufrufes und Durchlaufens der tabellenübergeordneten Wertefelder die Werte all jener erreichten Entscheidungspositionen zurückgeliefert werden, welche mittels des jeweils zugehörigen Kennzeichens festlegen, dass diese zumindest ein Tabellenfeld, das eindeutig einer der Datentabellen der konkret zugrunde liegenden Datenstruktur zuordenbar ist, enthalten, sowie alle Ergebnisse jener erreichten Entscheidungspositionen, an denen ein tabellenübergeordnetes Wertefeld mit mitgegebenen Parametern durchlaufen wird,and as a result of invoking and traversing the table-superordinate value fields the values of all those reached decision positions are returned, which by means of the respective associated flag specify that they contain at least one table field unambiguously assignable to one of the data tables of the specific underlying data structure and all Results of decision positions reached where a table-superordinate value field with specified parameters is passed through,
und somit ein Übergangs-SQL-Statement zur Verfügung steht, welches gegebenenfalls unvollständige relationenbezogene Operationen enthältand thus a transient SQL statement is available, which may contain incomplete relationship-based operations
- Automatisches Vervollständigen des Übergangs-SQL-Statements durch Hinzufügen gegebenenfalls fehlender und/oder unvollständiger relationenbezogener Operationen in einem Vervollständigungsschritt, wodurch ein endgültiges SQL-Statement erzeugt wird, das von jeder, den SQL-Standard unterstützenden Engine analysiert, optimiert und verarbeitet werden kann.Automatically complete the transient SQL statement by adding any missing and / or incomplete relationship-related operations in a completion step, creating a final SQL statement that can be optimized and processed by any SQL-standard supporting engine.
In dem erfmdungsgemäßen Voreinstellungsschritt werden vom Anwender je nach Bedarf ein oder mehrere tabellenübergeordnete Wertefelder erstellt, wobei der innere, gerichtete Entscheidungsgraph derselben sich nach den vorhandenen Tabellen und Abfragen der
gegebenen Datenstruktur richtet. Ein halb-automatisiertes Erstellen der tabellenübergeordneten Wertefelder kann dabei vorgesehen sein.In the pre-adjustment step according to the invention, one or more table-superordinated value fields are created by the user as required, the inner, directed decision graph of the same depending on the existing tables and queries of the given data structure. A semi-automated creation of the table-superordinated value fields can be provided.
Als tabellenübergeordnetes Wertefeld wird im Rahmen der gegenständlichen Anmeldung ein Element verstanden, welches in der Angabe von SQL-Statements gleich wie ein Tabellenfeld oder wie eine Tabelle behandelt wird, somit für den Anwender wie solche in den Statements zu behandeln sind. Somit ist von jedem tabellenübergeordneten Wertefeld aus Sicht des Anwenders an der jeweiligen Stelle des Statements ein Wert bzw. eine Wertemenge zu erwarten.As a table-superordinate value field, in the context of the present application, an element is understood which is treated as a table field or as a table in the specification of SQL statements, thus to be treated as such in the statements for the user. Thus, from the point of view of the user, a value or a set of values can be expected from each table-superordinate value field at the respective position of the statement.
Das Attribut „tabellenübergeordnet" bezieht sich auf die Unabhängigkeit der Wertefelder von den definierten Tabellen und Abfragen in der jeweiligen Datenstruktur. Somit ergibt sich ein fundamentales Prinzip der Erfindung, wonach jedes erstellte tabellenübergeordnete Wertefeld als zusätzliches Tabellenfeld für jede vorhandene oder hinzukommende Tabelle bzw. Abfrage fungiert.The attribute "table superordinate" refers to the independence of the value fields from the defined tables and queries in the respective data structure Thus, a fundamental principle of the invention results, according to which each created table superordinate value field acts as an additional table field for each existing or additional table or query ,
Da tabellenübergeordnete Wertefelder nach ihrem Aufruf mitunter eine oder mehrere Tabellen zurückliefern, welche in keiner von einem Anwender im Statement angegebenen relationalen Beziehung zu der bzw. den ihnen laut einem SQL-Statement zugeordneten Tabellen bzw. Abfragen stehen, ist eine Vervollständigung der fehlenden relationenbezogenen Operationen unter Anwendung vorzugsweise einer Tabelle der Relationen und nach und nach unten beschriebenen Verfahren in diesen Fällen notwendig.Since table parent value fields sometimes return one or more tables after their call, which are not in any relational relationship specified by a user in the statement to the tables or queries associated with them according to an SQL statement, a completion of the missing relational operations is under Application preferably a table of relations and gradually described method in these cases necessary.
In der Tabelle der Relationen sind zumindest alle Beziehungen zwischen sämtlichen Tabellen und Abfragen der jeweils zugrunde liegenden zugeordneten Datenstruktur enthalten und es können weiters frei generierte Relationen enthalten sein.The table of relations contains at least all relationships between all the tables and queries of the respective underlying data structure, and it can also contain freely generated relations.
In der Praxis ist es sinnvoll, die vorhandene Tabelle der Relationen nach dem Stand der Technik als Tabelle der Relationen heranzuziehen, da diese Tabelle der Relationen die zugrunde liegende Datenstruktur in jedem Fall vollständig abbildet.In practice, it makes sense to use the existing table of relations according to the prior art as a table of relations, since this table of relations completely maps the underlying data structure in each case.
Unter einem gerichteten Entscheidungsgraphen eines tabellenübergeordneten Wertefeldes wird ein gerichteter Graph nach Stand der Technik bezeichnet, wobei die Knoten des Graphen Entscheidungspositionen darstellen. Ein Entscheidungspfad bezeichnet einen möglichen Weg
durch den gerichteten Entscheidungsgraphen von einer innerhalb desselben als erste erreichbare Entscheidungsposition bis zu einer als letzte definierten Entscheidungsposition. Die Summe aller Entscheidungspfade ergeben daher alle Möglichkeiten, einen Entscheidungsgraphen von ersten Entscheidungspositionen bis zu letzten Entscheidungspositionen zu durchlaufen, die Überlagerung dieser verschiedenen Durchlaufmöglichkeiten über die Entscheidungspfade wird graphisch so dargestellt, dass sich an bestimmten Punkten des daraus resultierenden Entscheidungsgraphen Abzweigstellen ergeben.A directed decision graph of a table-superordinated value field denotes a directed graph according to the prior art, the nodes of the graph representing decision positions. A decision path denotes a possible path by the directed decision graph from a first reachable decision position within it to a last decision position defined. The sum of all decision paths thus gives rise to all possibilities of traversing a decision graph from first decision positions to last decision positions, the superimposition of these different pass possibilities over the decision paths is graphically represented such that branch points arise at certain points of the resulting decision graph.
Zur Kennzeichnung einer Entscheidungsposition, welche eine Aufteilung in mehrere Entscheidungspfade durch die vorbestimmbare Auswertung von zugehörigen Parametern und/oder Funktionen vorschreibt, werden vorzugsweise zumindest die Schlüsselworte IF ... THEN ... und SELECT CASE ... mit der in Programmiersprachen üblichen Deutung verwendet.To identify a decision position which prescribes a division into a plurality of decision paths by the predeterminable evaluation of associated parameters and / or functions, preferably at least the keywords IF ... THEN ... and SELECT CASE ... are used with the usual interpretation in programming languages ,
Um zu kennzeichnen, dass der Wert eines Parameters entweder für einen Vergleich, für eine Berechnung, eine Prüfung auf Existenz oder als konstanter Wert herangezogen werden soll, ist eine Kennzeichnung dafür sinnvoll. In der Beschreibung erfolgt dies durch die einem Parameter vorgestellte Zeichenfolge „PARAM:"In order to indicate that the value of a parameter is to be used either for a comparison, for a calculation, for a test for existence or as a constant value, an identification is useful. In the description, this is done by the string "PARAM:" introduced to a parameter
Weiters werden in der Beschreibung jene Entscheidungspositionen, welche kein spezielles Kennzeichen vorangestellt haben, als bei einem Aufruf und Durchlauf des zugehörigen tabellenübergeordneten Wertefeldes zu sammelnde Entscheidungspositionen angenommen. Dies kann über auch mittels eines eigens dafür vorgesehenem Kennzeichen erfolgen.Furthermore, in the description, those decision items that have not prefixed a specific tag are assumed to be decision items to be collected in a call and pass of the associated table-superordinated value field. This can also be done by means of a specially designated indicator.
Bei Anwendung des Statement-Auflösungsschritt, welcher alle in einem Statement verwendeten tabellenübergeordneten Wertefelder mit jeweils laut Statement mitgegebenen Parametern aufruft und durchläuft, werden in jedem tabellenübergeordneten Wertefeld die Entscheidungspfade, die aufgrund der gegebenen Parameter und deren vorbestimmbarer Auswertung betroffen sind, bis zum Ende des tabellenübergeordneten Wertefeldes verfolgt. In diesem Durchlauf werden alle Entscheidungspositionen gesammelt und als Ergebnis zurückgeliefert, welche mittels eines zugehörigen Kennzeichens festlegen, dass diese zumindest ein Tabellenfeld, das eindeutig einer Tabelle oder Menge der konkret zugrunde liegenden Datenstruktur zuordenbar ist, enthalten, sowie alle Ergebnisse jener erreichten
Entscheidungspositionen, an denen ein tabellenübergeordnetes Wertefeld mit mitgegebenen Parametern durchlaufen wird.When using the statement resolution step, which calls and uses all table-superordinated value fields used in a statement with parameters specified according to the statement, the decision paths that are affected by the given parameters and their pre-definable evaluation are displayed in each table-superordinate value field until the end of the table-superordinate value field Value field tracked. In this run, all decision positions are collected and returned as a result, which by means of an associated flag determine that they contain at least one table field that can be uniquely assigned to a table or set of the concrete underlying data structure, as well as all results of those Decision items on which a table-superordinate value field with specified parameters is traversed.
Unter Berücksichtigung der Verarbeitungsbereiche und der zugeordneten Tabellen und/oder Tabellenfelder wird das Ergebnis des Durchlaufes eines tabellenübergeordneten Wertefeldes entweder als Kriterium, Gruppierung, zusätzliche Menge und/oder tiefere Hierarchiestufe - SUB-SELECT usw. angelegt.Taking into account the processing areas and the assigned tables and / or table fields, the result of the passage of a table-superordinate value field is created either as a criterion, grouping, additional quantity and / or lower hierarchy level - SUB-SELECT etc.
Die Anfragesprache SQL besteht aus vorgegebenen Verarbeitungsbereichen und Verarbeitungsreihenfolgen, wie SELECT, FROM, WHERE, GROUP BY, HAVING, ORDER BY, LIMIT, UNION. Tabellenübergeordnete Wertefelder können, mitunter auch mehrfach, in einem oder mehreren Verarbeitungsbereichen eines angegebenen SQL- Statements verwendet werden.The query language SQL consists of predefined processing areas and processing sequences, such as SELECT, FROM, WHERE, GROUP BY, HAVING, ORDER BY, LIMIT, UNION. Table superordinate value fields can sometimes be used in more than one processing area of a specified SQL statement.
Das Hauptelement einer SQL-Abfrage wird in vielen Fällen durch relationenbezogene Operationen, wie Projektion, Verbund (Join) oder Selektion oder mengenorientierte Operationen, wie Mengenvereinigung, Mengenschnitt oder Mengendifferenz gebildet. Dabei kommt praktisch immer zumindest die Bildung eines kartesischen Produktes von Datentabellen und Einschränkungen unter Zuhilfenahme der Relationenangabe zur Anwendung.In many cases, the main element of an SQL query is formed by relationship-based operations, such as projection, join, or selection, or set-based operations, such as set union, set intersection, or set difference. Practically always at least the formation of a Cartesian product of data tables and restrictions with the help of the relation specification is used.
Die Erfindung bezieht sich dabei auf relationale Datenbanksysteme, die unter Verwendung einer Datenbanksprache einen Zugriff auf die in einer Datenbank gespeicherten Daten ermöglichen. In den gezeigten Ausführungsbeispielen wird die weit verbreitete Datenbanksprache SQL verwendet, die Erfindung ist aber nicht auf die Verwendung derselben beschränkt. Die Hauptaufgaben eines Datenbanksystems sind das Anfügen, Ändern, Löschen und Verwalten von Daten und das Bereitstellen derselben durch Datenbankabfragen.The invention relates to relational database systems that allow access to the data stored in a database using a database language. In the embodiments shown, the widely used database language SQL is used, but the invention is not limited to the use thereof. The main tasks of a database system are attaching, modifying, deleting, and managing data and providing it through database queries.
Alle Ausführungsformen des erfindungsgemäßen Verfahrens eignen sich in gleichem Maße auch zur programmtechnischen Einrichtung eines relationalen Datenbanksystems, welches ein Computersystem mit einer relationalen Datenbank, eine Datenverarbeitungseinheit und einen Speicher umfasst, wobei die Datenverarbeitungseinheit nach dem erfindungsgemäßen Verfahren arbeitet.
Ein solches Computerprogramm kann auf einem computerlesbaren Medium, wie etwa eine Diskette, CD oder DVD, wobei es Computerprogamm-Code-Mittel aufweist, bei dem nach Laden des Computerprogramms ein Computer durch das Programm zur Durchführung des Verfahrens zur Erzeugung eines erfindungsgemäßen Datenträgers oder elektronischen Trägersignals veranlaßt wird. Es kann aber etwa auch als Computeφrogrammprodukt, welches ein Computerprogramm auf einem elektronischen Trägersignal aufweist, bei dem jeweils nach Laden des Computerprogramms ein Computer durch das Programm zur Durchführung des erfindungsgemäßen Verfahrens veranlaßt wird, vorliegen.All embodiments of the method according to the invention are equally suitable for the program-technical setup of a relational database system, which comprises a computer system with a relational database, a data processing unit and a memory, wherein the data processing unit operates according to the inventive method. Such a computer program may be stored on a computer-readable medium, such as a floppy disk, CD or DVD, having computer program code means, upon loading the computer program, a computer through the program for carrying out the method of producing a data carrier or electronic carrier signal according to the invention is caused. However, it can also be present, for example, as a computer program product which has a computer program on an electronic carrier signal in which, after the computer program has been loaded, a computer is caused by the program for carrying out the method according to the invention.
Die erfindungsgemäße Aufgabenstellung wird somit auch durch einen Datenträger, oder in äquivalenter Weise durch ein elektronisches Trägersignal zum Einlesen in ein relationales Datenbanksystem gemäß den Merkmalen des Anspruches 16 gelöst.The task according to the invention is thus also solved by a data medium, or equivalently by an electronic carrier signal for reading into a relational database system according to the features of claim 16.
Ferner betrifft die Erfindung ein Computerprogramm, das Instruktionen aufweist, die zur Durchführung des erfindungsgemäßen Verfahrens eingerichtet sind.Furthermore, the invention relates to a computer program having instructions that are set up for carrying out the method according to the invention.
Weiters betrifft die Erfindung ein Compuerprogrammprodukt, welches ein computerlesbares Medium mit Computerprogramm-Code-Mitteln aufweist, bei dem jeweils nach Laden des Computerprogramms ein Computer durch das Programm zur Durchführung des erfindungsgemäßen Verfahrens veranlasst wird.Furthermore, the invention relates to a computer program product which has a computer-readable medium with computer program code means, in which, after loading the computer program, a computer is caused by the program for carrying out the method according to the invention.
Die Erfindung betrifft schließlich auch ein Computeφrogrammprodukt, welches ein Computerprogramm auf einem elektronischen Trägersignal aufweist, bei dem jeweils nach Laden des Computerprogramms ein Computer durch das Programm zur Durchführung des erfindungsgemäßen Verfahrens veranlasst wird.Finally, the invention also relates to a computer program product which has a computer program on an electronic carrier signal, in which, in each case after loading the computer program, a computer is caused by the program for carrying out the method according to the invention.
Nachfolgend wird die Erfindung anhand der in den Zeichnungen erläuterten Ausführungsformen und anhand von weiteren Ausführungsbeispielen eingehend beschrieben.The invention will be described in detail below with reference to the embodiments explained in the drawings and to other exemplary embodiments.
Fig, .1 eine schematische Darstellung von Hierarchiestufen innerhalb eines SQL-Statements in Form eines geordneten Baumes für die Anwendung einer Ausfuhrungsform des erfindungsgemäßen Verfahrens auf ein Anfragebeispiel;
Fig.2 eine schematische Darstellung von Hierarcliiestufen innerhalb eines SQL-Statements in Form eines geordneten Baumes für die Anwendung einer Ausführungsform des erfindungsgemäßen Verfahrens auf ein weiteres Anfragebeispiel; Fig. 3 zeigt eine schematische Darstellung eines SQL-RTNs gemäß Stand der Technik; Fig. 4, 5, 6 zeigen jeweils eine schematische Darstellung von erfindungsgemäßen tabellenübergeordneten Wertefeldern mit deren inneren gerichteten Entscheidungsgraphen und deren Entscheidungspostionen.1 is a schematic representation of hierarchy levels within an SQL statement in the form of an ordered tree for the application of an embodiment of the method according to the invention to a query example; 2 shows a schematic representation of Hierarcliiestufe within an SQL statement in the form of an ordered tree for the application of an embodiment of the method according to the invention to a further query example; 3 shows a schematic representation of an SQL RTN according to the prior art; 4, 5, 6 each show a schematic representation of tabular value fields according to the invention with their inner directed decision graphs and their decision positions.
Im nachfolgend angegebenen Beispiel A wird der Einfluss der Datenstruktur auf die Formulierung der Abfrage verdeutlicht.In the following example A, the influence of the data structure on the formulation of the query is clarified.
Beispiel A:Example A:
Ausgabe aller Firmen aus Wien, sortiert nach Firmennamen, deren Abteilungen und deren KontaktpersonenEdition of all companies from Vienna, sorted by company name, their departments and their contact persons
Datenstruktur 1:Data structure 1:
Relationen: Firmen <-> Abteilungen <-> KontaktpersonenRelations: Companies <-> Departments <-> Contacts
SELECT Firmen.*, Abteilungen.*, Kontaktpersonen.* VerarbeitungsfunktionSELECT companies. *, Departments. *, Contact persons. * Processing function
FROM Firmen, Abteilungen, Kontaktpersonen kart. Produkt; RelationenangabeFROM companies, departments, contact persons kart. Product; relation specification
WHERE (Firmen. FirmalD = Abteilungen. FirmaNr) Relationenangabe AND (Abteilungen.AbteilungID = Kontaktpersonen.AbteilungNr) RelationenangabeWHERE (Firms, FirmalD = Departments., CompanyNo) Relationship AND (Departments.DepartmentID = Contact Persons.DepartmentNo) Relationship
AND (Firmen.Ort = „Wien") VerarbeitungsfunktionAND (Firmen.Ort = "Vienna") processing function
ORDER BY Firmen. Name VerarbeitungsfunktionORDER BY companies. Name processing function
Datenstruktur 2:Data structure 2:
Relationen: Firmen <-> Geschäftsbereich <-> Abteilungen <-> KontaktpersonenRelations: Companies <-> Division <-> Departments <-> Contacts
SELECT Firmen.*, Abteilungen.*, Kontaktpersonen.* VerarbeitungsfunktionSELECT companies. *, Departments. *, Contact persons. * Processing function
FROM Firmen, Geschäftsbereich, Abteilungen, Kontaktpersonen kart. Produkt;FROM companies, division, departments, contact persons kart. Product;
Relationenangaberelation specification
WHERE ( Firmen. FID = Geschäftsbereich. FNr) RelationenangabeWHERE (companies, FID = business unit, FNr) relation information
AND (Geschäftsbereich. BereichID = Abteilungen. BereichNr) Relationenangabe AND (Abteilungen. AID = Kontaktpersonen. ANr) RelationenangabeAND (Business Area, AreaID = Departments, AreaNo) Relationship AND (Departments, AID = Contact persons, ANr) Relationship information
ORDER BY Firmen. Name Verarbeitungsfunktion
Wie zu ersehen ist, liegen je nach Datenstruktur jeweils Relationen vor, die für jede Datenbankanweisung (Statement) immer wieder neu angegeben werden müssen, wodurch sich eine Abhängigkeit von der Datenstruktur ergibt.ORDER BY companies. Name processing function As can be seen, depending on the data structure, there are relations that must be specified again and again for each database statement, which results in a dependency on the data structure.
In der Beschreibung werden nachfolgend alle benötigten Relationenangaben eines jeweiligen Statements zusammenfassend als relationenbezogene Operationen bezeichnet.In the description below, all the required relations of a particular statement are referred to collectively as relations-related operations.
In jeder relationalen Datenbank existiert eine zugeordnete Datenstruktur in Form einer Vielzahl durch Relationen miteinander verbundenen Datentabellen. Darunter werden in Spalten und Zeilen organisierte Daten verstanden, wie sie nachfolgend beispielhaft in den Tabellen 1 bis 10 angegeben sind.In each relational database, there is an associated data structure in the form of a plurality of data tables linked by relations. These are understood to mean data organized in columns and rows, as given below by way of example in Tables 1 to 10.
Im Rahmen der Beschreibung wird unter dem Begriff „Zeilenrelation" jeweils die Zeilen einer Tabelle verstanden, also für z.B. Tabelle 1 Firmen(FirmaID, Name, Straße, PLZ, Ort, Land, AnzMitarbeiter, Betreuer) und für Tabelle 2 Abteilungen (AbteilungID, FirmaNr, Abteilungsname). Als „Relationen" werden hingegen die Verbindungen zwischen jeweils zwei Datentabellen über jeweils zumindest ein Schlüsselfeld, also z.B. 1:1, 1 :n, n:m - 1 :n gilt für: Firmen (Firmald) <-> Abteilungen (FirmaNr) bezeichnet. Die Spalte Firmald in der Tabelle Firmen (Tabelle 1) ist ein Primärschlüssel, für den es in der Tabelle Abteilungen (Tabelle 2) in der Spalte FirmaNr beliebig viele Werte geben kann.In the context of the description, the term "row relation" is understood to mean in each case the rows of a table, that is to say, for example, Table 1 companies (company ID, name, street, postcode, city, country, employees, supervisor) and for table 2 departments (department ID, company no "Relationships", however, the connections between each two data tables on each at least one key field, eg 1: 1, 1: n, n: m - 1: n applies to: Companies (Firmald) <-> Departments (CompanyNr). The Firmald column in the Companies table (Table 1) is a primary key for which there can be any number of values in the Departments table (Table 2) in the CompanyNr column.
Für jede Datenstruktur ist eine Tabelle der Relationen vorhanden, in der alle der abgefragten Datenbank zugeordneten Datenstruktur entsprechenden Relationen sowie gegebenenfalls frei generierte Relationen enthalten sind.For each data structure, there is a table of relations in which all the data structures associated with the queried database are contained, as well as optionally freely generated relations.
In der Praxis werden von Anwendern viele Anfragen beispielsweise zum Thema Umsatz gestellt, welche zwar ähnlich sind, aber im SQL-Standard mitunter jeweils sehr unterschiedlich zu formulieren sind: In practice, many requests are made by users, for example, on the subject of sales, which are similar, but in the SQL standard may sometimes be formulated very differently:
Bezogen auf die gezeigten Tabellen Tabelle 1 bis Tabelle 10 sind folgende Fragestellungen in zumindest einem der Verarbeitungsbereiche von SQL denkbar:Referring to the tables shown in Table 1 to Table 10, the following questions are conceivable in at least one of the processing areas of SQL:
Umsatz einer Firma insgesamtTotal turnover of a company
Umsatz einer Firma in einem bestimmten Zeitraum Umsatz einer Firma bei bestimmten ArtikelnTurnover of a company in a certain period Turnover of a company with certain articles
Umsatz aller Firmen von einem bestimmten BetreuerSales of all companies from a specific supervisor
Umsatz aller Firmen in bestimmten OrtenSales of all companies in certain locations
Umsatz je Kontaktperson einer FirmaSales per contact person of a company
Umsatz bestimmter Artikel in einem bestimmten Zeitraum Umsatz bestimmter Artikelgruppen in einem bestimmten ZeitraumSales of certain items in a given period Sales of certain groups of items in a given period
Umsatz bestimmter Artikel je FirmaSales of certain articles per company
Umsatz sämtlicher Veranstaltungen in einem bestimmten ZeitraumSales of all events in a certain period
Kombination dieser KriterienCombination of these criteria
Unterscheidung: Umsatz netto oder bruttoDistinction: turnover net or gross
Unterscheidung: Umsatz bei Ausländischen Firmen ohne MwStDistinction: turnover of foreign companies excluding VAT
Gleiche Fragestellungen könnten auch für die Anzahl der Veranstaltungen, Anzahl der stornierten Veranstaltungen, Anzahl der unterschiedlichen Artikel usw. gestellt werden. Diese angefragten Werte können jeweils ebenfalls je Ort, je Firma, je Mitarbeiter, je Artikelgruppe usw. sowie in Kombination mehrerer dieser Anzahl- und Summenfelder gestellt werden.The same questions could be asked for the number of events, the number of canceled events, the number of different articles and so on. These requested values can also be made per location, per company, per employee, per article group, etc. as well as in combination with several of these number and sum fields.
Jeder dieser zu berechnenden Umsatz- oder Anzahlswerte kann über eine bestimmte Abfrage von einem Anwender in SQL formuliert werden. Dieser Aufwand muss vom Anwender für jede Umsatzabfrage erbracht werden. Für alle diese Fälle schauen die SQL-Anfragen prinzipiell unterschiedlich aus und müssen je nach Fall neu formuliert werden. Dies ist für den normalen Anwender mitunter nur mit großem Zeitaufwand und viel Mühe möglich. Besonders, wenn die dahinter liegende Datenstruktur beispielsweise aufgrund einer
Erweiterung des Systems verändert werden muss, müssen sämtliche Anfragen neu gestaltet werden.Each of these sales or count values to be calculated can be formulated via a particular query by a user in SQL. This effort must be provided by the user for each sales query. For all these cases, the SQL queries look fundamentally different and must be reformulated depending on the case. This is possible for the normal user sometimes only with great time and effort. Especially if the underlying data structure, for example due to a Enlargement of the system, all requests must be redesigned.
Insbesondere, wenn komplexere Verknüpfungen gefragt sind, wird eine Formulierung in SQL auch für den Fachmann sehr schwierig. Eine Konvertierung bereits vorhandener Anfragen auf andere Datenstrukturen ist ebenfalls nur mit einer Umstellung sämtlicher betroffener SQL- Statements möglich.In particular, when more complex links are required, formulation in SQL becomes very difficult even for the skilled person. Conversion of already existing queries to other data structures is also only possible with a conversion of all affected SQL statements.
Diese Problematik kann durch Anwendung des erfϊndungsgemäßen Verfahrens weitgehend gelöst werden, wie es die weiter unten gezeigten Teil-Fragestellungen in Übersichtsform darstellen: Es wird ein tabellenübergeordnetes Wertefeld mit Parametern erstellt, im konkreten Fall das tabellenübergeordnete Wertefeld „Umsatz", welches zumindest die jeweils optionalen Parameter Zeitraum, Artikelgruppe, Betreuer, Ort, und GroupBy enthält. Der innere, gerichtete Entscheidungsgraph eines tabellenübergeordneten Wertefeldes ist für die Verwendung in Anwender-SQL-Statements nicht von Relevanz und wird je nach gegebener Datenstruktur definiert. Deswegen wird auf eine Darstellung des inneren, gerichteten Entscheidungsgraphen für die gegebene Datenstruktur, welche sich aus den Tabellen 1 bis 10 und den in der Tabelle der Relationen gespeicherten Relationen zwischen jeweils zwei Tabellen über jeweils zumindest ein Schlüsselfeld ergibt, an dieser Stelle verzichtet.This problem can be largely solved by applying the erfϊndungsgemäßen method, as shown in more detail below the sub-questions: It is a table superordinate value field created with parameters, in the specific case, the table superordinate value field "sales", which at least the respective optional parameters The inner, directed decision graph of a table-superordinate value field is not relevant for use in user SQL statements and is defined according to the given data structure Decision graphs for the given data structure, which results from the tables 1 to 10 and the relations stored in the table of relations between each two tables on each at least one key field, omitted at this point.
Es wird gezeigt, dass ein tabellenübergeordnetes Wertefeld und somit auch das konkret verwendete tabellenübergeordnete Wertefeld „Umsatz" in einem Anwender-SQL-Statement unabhängig von den in diesem Anwender-SQL-Statement in jeweiligen Hierarchiestufen definierten Datentabellen und den Verarbeitungsbereichen verwendet werden kann.It is shown that a table-superordinate value field and thus also the specifically used table superordinate value field "turnover" in a user SQL statement can be used independently of the data tables and the processing areas defined in this user SQL statement in respective hierarchy levels.
Es wird nachstehend die einfache Formulierung von angegebenen Teil-Fragestellungen gezeigt, welche nach dem Statement- Auflösungsschritt in jeweils mitunter gänzlich unterschiedliche Übergangs-SQL-Statements und nachfolgend in endgültige SQL-Statements umgewandelt werden. Durch die Verwendung der tabellenübergeordneten Wertefelder bleibt das Anwender-SQL-Statement einerseits sehr kurz, übersichtlich und leicht änderbar, anderseits ist eine größtmögliche Unabhängigkeit des Anwender-SQL-Statments von einer Datenstruktur gegeben.Below is the simple formulation of given sub-questions, which are converted after the statement resolution step into sometimes completely different transitional SQL statements and subsequently into final SQL statements. By using the table-superordinate value fields, the user SQL statement on the one hand remains very short, clear and easy to change, on the other hand, the greatest possible independence of the user SQL-Statment is given by a data structure.
Umsatz einer Firma insgesamt
Firmen.UmsatzQ Umsatz einer Firma in einem bestimmten Zeitraum (Jahr 2006)Total turnover of a company Firmen.UmsatzQ turnover of a company in a certain period (year 2006)
Firmen.Umsatz(Zeitraum=2006) Umsatz einer Firma bei bestimmten Artikelgrappen Fimen.UmsatzfArtikelgruppe="Speisen")Firmen.Umsatz (period = 2006) Turnover of a company with certain article grappen Fimen.UmsatzfArtikelgruppe = "food")
Umsatz aller Firmen von einem bestimmten BetreuerSales of all companies from a specific supervisor
Firmen.UmsatzfBetreuer="Meier") Umsatz aller Firmen in bestimmten OrtenFirmen.UmsatzfBetreuer = "Meier") sales of all companies in certain locations
Firnien.Umsatz(Ort="Wien,St.PöIten") Umsatz j e Kontaktperson einer FirmaFirnien.Umsatz (City = "Vienna, St.Pölten") Turnover j e Contact person of a company
Firmen.Umsatz(GroupBy="Kontaktρersonen"') Umsatz bestimmter Artikel in einem bestimmten ZeitraumFirmen.Umsatz (GroupBy = "Kontaktρersonen '') sales of certain products in a given period
Artikel.UmsatzfZeitraum=2006)Artikel.UmsatzfZeitraum = 2006)
Umsatz bestimmter Artikelgruppen in einem bestimmten Zeitraum Artikel.Artikelgruppe.UmsatzCZeitraum^OOό)Sales of certain article groups in a certain period Article.Article.req.CZeitraum ^ OOό)
Umsatz bestimmter Artikel je FirmaSales of certain articles per company
Artikel.Umsatz(GroupBv="Firma") Umsatz sämtlicher Veranstaltungen in einem bestimmten ZeitraumArticle sales (GroupBv = "company") sales of all events in a given period
Veranstaltungen. UmsatzCZeitraum^OOθ)Events. UmsatzCZeitraum ^ OOθ)
Eine konkrete Fragestellung kann lauten:A concrete question may be:
Alle Firmen und deren Umsatz je Artikelgruppe als Spalten im SELECT- Verarbeitungsbereich im Jahr 2006, deren Umsatz in der Artikelgruppe „Speisen" zumindest 1000 Euro im Jahr 2006 betragen hat:All companies and their turnover per article group as columns in the SELECT processing area in the year 2006, whose turnover in the article group "food" amounted to at least 1000 Euro in the year 2006:
Diese wird im folgenden Anwender-SQL-Statement angegeben, welches zwei mal das tabellenübergeordnete Wertefeld Umsatz mit jeweils zwei unterschiedlich angegebenen Parametern verwendet und welches keine vollständigen relationenbezogenen Operationen enthält:This is specified in the following user SQL statement, which twice uses the table-superordinate value field Sales with two differently specified parameters and which does not contain complete relationship-related operations:
Beispiel:Example:
SELECT Firmen.Umsatz(GroupBy=" Artikelgruppe", Zeitraum=2006)SELECT Companies.Upload (GroupBy = "Article Group", Period = 2006)
WHERE Firmen.Umsatz(Zeitraum=2006, Artikelgruppe="Speisen")> 1000
Die Anwendung des Statement-Auflösungsschrittes wird später in der Beschreibung gezeigt, um den Fokus in diesem Teil der Einleitung auf die grundsätzlichen Vorteile der einfachen, kurzen und Datenstruktur unabhängigen Schreibweise durch Formulierung von erfindungsgemäßen Anwender-SQL-Statements zu zeigen. Das verwendete tabellenübergeordnete Wertefeld liefert den Umsatz unter Berücksichtigung der jeweils angegebenen Parameter, aber an beiden eingesetzten Positionen wird nach dem Auflösungsschritt und der Vervollständigung der relationenbezogenen Operationen im Veivollständigungsschritt der Umsatz je Datensatz Firma unter Berücksichtigung der relationenbezogenen Operationen berechnet.WHERE company.revenue (period = 2006, article group = "food")> 1000 The application of the statement resolution step will be shown later in the description to show the focus in this part of the introduction on the basic advantages of the simple, short and data structure independent notation by formulation of user SQL statements according to the invention. The used table-superordinate value field returns the turnover taking into account the parameters specified in each case, but at the positions used after the resolution step and the completion of the relationship-related operations in the completion step, the turnover per data set company is calculated taking into account the relation-related operations.
Eine weitere konkrete Fragestellung eines Anwenders kann lauten:Another specific question posed by a user may be:
Umsatz je Jahr als Spalte im SELECT- Verarbeitungsbereich aller Kontaktpersonen in derSales per year as a column in the SELECT processing area of all contact persons in the
Firma „Bauer GmbH"Company "Bauer GmbH"
Es wird ein einfaches Anwender-SQL-Statement angegeben, welches das tabellenübergeordnete Wertefeld Umsatz mit einem Parameter enthält, wobei der Wert dieses Wertefeldes durch den Statement-Auflösungsschritt und nach der Vervollständigung der relationenbezogenen Operationen im Vervollständigungsschritt den Umsatz je Kontaktperson je Firma liefert.A simple user SQL statement is specified, which contains the table-superordinate value field turnover with a parameter, whereby the value of this value field delivers the turnover per contact person per company through the statement resolution step and after completing the relationship-related operations in the completion step.
Beispiel:Example:
SELECT Kontaktpersonen.Nachname , Umsatz(GroupBy=Year(Veranstaltungen. VADatum))SELECT contact persons.lastname, sales (GroupBy = Year (events. VADatum))
WHERE Firmen.Name ="Bauer GmBH"WHERE Company.Name = "Bauer GmBH"
GROUP BY Kontaktpersonen.NachnameGROUP BY contact persons.lastname
Soll der Umsatz Brutto geliefert werden, so kann dies beispielsweise mittels eines weiteren optionalen Parameters „Brutto" für das tabellenübergeordnete Wertefeld Umsatz erfolgen. Der innere, gerichtete Entscheidungsgraph des tabellenübergeordneten Wertefeldes wird, entsprechend der zugrunde liegen Datenstruktur, um die Berücksichtigung des optionalen Parameters „Brutto" mittels zumindest einer weiteren Entscheidungsposition erweitert.If the gross sales are to be delivered, this can be done, for example, by means of another optional parameter "gross" for the table-superordinated value field "sales." The inner, directed decision graph of the table-superordinate value field is, according to the underlying data structure, taken into account by the optional parameter "gross "extended by at least one further decision position.
Somit kann in Anwender-SQL-Statements einfach zwischen dem Brutto-Umsatz und dem Netto-Umsatz gewählt werden, wobei ebenfalls über den inneren, gerichteten Entscheidungsgraphen des tabellenübergeordneten Wertefeldes Umsatz definiert wird,
welcher dieser beiden Umsatzwerte in den Fällen ausgegeben wird, in denen kein Parameter „Brutto" vorhanden ist. Im konkreten wird bei fehlendem Parameter „Brutto" im inneren, gerichteten Entscheidungsgraphen vorgeschrieben, dass die Entscheidungsposition erreicht wird, welche die notwendige Verarbeitungsinformation und das bzw. die notwendigen Tabellenfelder enthält, um den Netto-Umsatz je nach gewünschter Definition abhängig oder unabhängig von den anderen, optional mitzugebenden Parametern zu berechnen.Thus, in user SQL statements, it is easy to choose between the gross revenue and the net revenue, whereby revenue is also defined via the inner, directed decision graph of the table-superordinate value field. In the concrete case, in the absence of the parameter "gross" in the inner, directed decision graph, it is prescribed that the decision position be reached, which contains the necessary processing information and / or contains the necessary table fields in order to calculate the net turnover depending on the desired definition depending on or independent of the other optional parameters to be given.
Somit kann folgendes tabellenübergeordnetes Wertefeld unabhängig von Datentabellen, welche in einem Teil-Anwender-SQL-Statement verwendet werden, einfach den Brutto- Umsatz und den Netto-Umsatz j eweils für das Jahr 2006 liefern:Thus, regardless of data tables used in a sub-user SQL statement, the following table-superordinate value field can simply provide the gross revenue and the net revenue for the year 2006, respectively:
Umsatz(Zeitraum=2006, Brutto), Umsatz(Zeitraum-2006)Sales (period = 2006, gross), sales (period-2006)
Ebenso kann ein neues tabellenübergeordnetes Wertefeld „UmsatzBrutto" im Voreinstellungsschritt erstellt werden, womit Umsatz Brutto und Umsatz Netto jeweils für die Artikelgruppe „Speisen" in einem Teil-Anwender-SQL-Statement wie folgt erfragt werden kann:Likewise, a new table-superordinate value field "SalesBrutto" can be created in the pre-setting step, whereby the gross and sales net revenues for the "Food" article group in a sub-user SQL statement can be queried as follows:
UmsatzBrutto(ArtikelGruppe="Speisen"), Umsatz(Artikelgruppe="Speisen")TurnoverBrutto (item group = "food"), turnover (article group = "food")
Die Existenz des tabellenübergeordneten Wertefeldes UmsatzBrutto schließt die ExistenzThe existence of the table-superordinate value field SalesBrutto excludes the existence
oder Verwendung des tabellenübergeordneten Wertefeldes Umsatz mit dem Parameteror using the table-superordinate value field Sales with the parameter
„Brutto" keineswegs aus. Es kann sogar das tabellenübergeordnete Wertefeld UmsatzBrutto die gleichen optionalen Parameter wie das tabellenübergeordnete Wertefeld Umsatz enthalten, wobei der innere, gerichtete Entscheidungsgraph des tabellenübergeordneten WertefeldesEven the table-superordinate value field SalesBrutto can contain the same optional parameters as the table-superordinate value field Sales, whereby the inner, directed decision graph of the table-superordinate value field
UmsatzBrutto nur eine Entscheidungsposition enthält. Diese eine Entscheidungsposition im tabellenübergeordneten Wertefeld UmsatzBrutto ruft das tabellenübergeordnete Wertefeld Umsatz mit sämtlichen seiner optionalen Parameter auf, wobei der Parameter „Brutto" alsSalesBrutto contains only one decision item. This one decision item in the table-superordinate value field SalesBrutto calls the table-superordinate value field Sales with all its optional parameters, with the parameter "Gross" as
Konstante mitgegeben wird.
Es ist somit vorgesehen, dass auch alle anderen erstellten tabellenübergeordneten Wertefelder an beliebigen Entscheidungspositionen von inneren, gerichteten Entscheidungsgraphen von tabellenübergeordneten Wertefeldern eingesetzt und bei Erreichen dieser Entscheidungspositionen aufgerufen und durchlaufen werden können. Der Wert jener Entscheidungspositionen, in welche ein tabellenübergeordnetes Wertefeld mit vorgegebenen Parametern eingesetzt wurde, entspricht dem Ergebnis des Durchlaufes des eingesetzten tabellenübergeordneten Wertefeldes. Somit können auch beliebig oftmalige, endliche Verschachtelungen von tabellenübergeordneten Wertefeldern vorgenommen werden.Constant is given. It is thus envisaged that all other created table-superordinate value fields can be used at arbitrary decision positions of inner, directed decision graphs of table-superordinate value fields and can be called and traversed upon reaching these decision positions. The value of those decision positions in which a table-superordinate value field with predetermined parameters was used corresponds to the result of the passage of the table-superordinate value field used. Thus, arbitrarily frequent, finite interleaves of table-superordinate value fields can be made.
Auf gleiche Weise können sehr einfach weitere ähnliche, tabellenübergeordnete Wertefelder erstellt werden, so zum Beispiel diese drei tabellenübergeordneten Wertefelder:In the same way, you can easily create more similar, table-superordinate value fields, such as these three table-superordinate value fields:
UmsatzAktuellesJahr UmsatzVorjahr UmsatzLetzteDrei JahreTurnoverNewsYear TurnoverPrevious yearLastThree years
Diese tabellenübergeordneten Wertefelder verwenden, wie oben beschrieben, die gleichen Parameter wie das tabellenübergeordnete Wertefeld Umsatz und setzen diese als Parameter für ihre jeweils einzige Entscheidungsposition ein, welche das tabellenübergeordnete Wertefeld Umsatz enthält. Dem eingesetzten tabellenübergeordneten Wertefeld werden alle optionalen Parameter mitgegeben, einzig der Parameter Zeitraum ist konstant und je dieser tabellenübergeordneten Wertefelder beispielsweise: Date.Year, Date.Year-1, >=Date-Year-3.As described above, these table-superordinate value fields use the same parameters as the table-superordinate value field Sales and set these as parameters for their single decision position, which contains the table-superordinate value field Sales. The table superimposed value field is given all optional parameters, only the parameter period is constant and each table superordinate value fields, for example: Date.Year, Date.Year-1,> = Date-Year-3.
Der Vorteil der Verwendung von tabellenübergeordneten Wertefeldern an Entscheidungspositionen eines inneren, gerichteten Entscheidungsgraphen eines anderen tabellenübergeordneten Wertefeldes ist, dass eine Änderung des inneren, gerichteten Entscheidungsgraphen des eingesetzten tabellenübergeordneten Wertefeldes keinen Einfluss auf das dieses tabellenübergeordnete Wertefeld an zumindest einer seiner Entscheidungspositionen enthaltenden tabellenübergeordneten Wertefeld ausübt.The advantage of using table-superordinate value fields at decision positions of an inner, directed decision graph of another table-superordinated value field is that a change of the inner, directed decision graph of the inserted table-superordinate value field does not influence the table-superordinated value field containing this table-superordinate value field at at least one of its decision positions.
Ein weiteres Beispiel soll alle Spalten der Tabelle Firmen, die Anzahl der Veranstaltungen der letzten 3 Jahre und den Umsatz der letzen 3 Jahre jener Firmen liefern, die im Jahr 2006 mehr als 10 Veranstaltungen gebucht und im Jahr 2006 mehr als 1000 Euro Umsatz haben:
Folgendes Anwender-SQL-Statement stellt diese Fragestellung dar:Another example is to supply all the columns of the table companies, the number of events of the last 3 years and the turnover of the last 3 years of the companies that booked more than 10 events in 2006 and more than 1000 euros in 2006: The following user SQL statement presents this question:
Beispiel:Example:
SELECT Firmen.*, AnzahlVeranstaltungen(>=Date.Year-3)3 Umsatz(Zeitraurn>=Date.Year-3)SELECT companies. *, Number of events (> = Date.Year-3) 3 sales (time> = Date.Year-3)
WHERE (ArizahlVeranstaltungen(Zeitraum=2006) > 10) AND (Umsatz(Zeitraum=2006)>1000)WHERE (Arizahl events (period = 2006)> 10) AND (turnover (period = 2006)> 1000)
Die Konstante Date. Year liefert das aktuelle Jahr zurück.The constant Date. Year returns the current year.
In diesem Beispiel wird die mehrfache Verwendung von zwei unterschiedlichen tabellenübergeordneten Wertefeldern mit jeweils unterschiedlichen Verarbeitungsbereichen gezeigt. Die Anwendung des Statement-Auflösungsschritts sowie die Anwendung des Vervollständigungsschrittes werden später in der Beschreibung ausführlich für eine Vielzahl an Beispielen gezeigt.This example shows the multiple usage of two different table-superordinate value fields, each with different processing areas. The application of the statement resolution step as well as the application of the completion step will be shown later in the description in detail for a variety of examples.
Um die Verwendung von tabellenübergeordneten Wertefeldern zu standardisieren, ist eine Erweiterung des RTN von SQL sinnvoll. Diese Erweiterung wird weiter unten in der Beschreibung im Detail gezeigt, soll aber hier vorab kurz beschrieben werden:To standardize the use of table-superordinate value fields, it makes sense to extend the RTN of SQL. This extension is shown in detail below in the description, but should be briefly described here in advance:
Ein RTN ist die Abkürzung für den bekannten Begriff „rekursives Übergangsnetzwerk". Mittels eines RTN wird die Ausdruckskraft einer Sprache festgelegt, in dem syntaktisch formulierbare Möglichkeiten in demselben festgelegt werden. Eine Erweiterung des RTN einer Sprache führt zu einer stärkeren Ausdruckskraft derselben. Da EDV-Sprachen der ersten bis vierten Generation, also auch SQL, turing-vollständig sind, bedeutet eine höhere Ausdruckskraft einer Sprache, dass komplexe Fragestellungen einfacher und zielgenauer - insbesondere durch einen Nicht-Fachmann - definiert werden können. Des Weiteren erhöht ein erweitertes RTN die Übersichtlichkeit von angegebenen Statements.An RTN is the abbreviation for the well-known term "recursive transition network." An RTN defines the expressive power of a language in which syntactically formable options are defined in it.An extension of the RTN of a language leads to a stronger expressiveness of the same. First-to-fourth-generation languages, including SQL, are turing-complete, meaning a language's increased expressiveness means that complex questions can be defined more easily and more accurately, especially by a non-specialist given statements.
Fig.3 zeigt einen vereinfachten Entscheidungsgraphen nach dem Stand der Technik für die SELECT- Anweisung der Anfragesprache SQL, aus dem schematisch die Struktur des RTN für SQL ersichtlich wird.
Jedes Anfragestatement wird aus einer fix vorgegebenen Abfolge von zwingend aufeinander folgend angeordneten Verarbeitungsbereichen 340, 341, 342, 343, 344, 345 mit Schlüsselworten 20, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331 gebildet, wobei an Entscheidungspositionen 310, 311, 312, 313 - der Einfachheit halber nur für die einleitenden Schlüsselworte 324, 326, 328, 330 der Verarbeitungsbereiche 342, 343, 344 und 345 gezeigt - eine ganz bestimmte Auswahl an Schlüsselworten getroffen werden kann, um das gewünschte Anfrageergebnis zu erhalten. Eine bestimmte Gruppierung von Schlüsselworten bildet jeweils einen Verarbeitungsbereich, z.B. FROM (Schlüsselworte 322, 323), WHERE (Schlüsselworte 324, 325), GROUP BY (Schlüsselworte 326, 327) usw., wobei jeder Verarbeitungsbereich eine ihm zugeordnete Mengenverarbeitungsfunktion ausführt, z.B. FROM bildet kartesische Produkte mit der Möglichkeit spezieller JOINs.3 shows a simplified decision graph according to the prior art for the SELECT statement of the query language SQL, from which the structure of the RTN for SQL is schematically apparent. Each request request is from a fixed predetermined sequence of compulsory sequentially arranged processing areas 340, 341, 342, 343, 344, 345 with keywords 20, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331 At decision positions 310, 311, 312, 313 - for the sake of simplicity only for the introductory keywords 324, 326, 328, 330 of the processing areas 342, 343, 344 and 345 - a very specific selection of keywords can be made to receive the desired inquiry result. A particular grouping of keywords each form a processing area, eg, FROM (keywords 322, 323), WHERE (keywords 324, 325), GROUP BY (keywords 326, 327), etc., each processing area performing a set processing function associated with it, eg, forming FROM Cartesian products with the possibility of special JOINs.
Nach jedem einleitenden Schlüsselwort 320, 322, 324, 326, 328, 330 können weitere Schlüsselworte folgen, die in Fig.l aus Gründen der Übersichtlichkeit nicht gezeigt sind. So kann z.B. nach dem Schlüsselwort 324 „WHERE" die Schlüsselworte „(", „NOT", ein Tabellenname, ein Tabellenfeldname, definierte Funktionen usw. direkt folgen. Ein SUBSELECT, also die rekursive Anwendung des RTN immer beginnend bei SELECT (Schlüsselwort 320) z.B. durch „(" kann an vorgegebenen Entscheidungspositionen auftreten. Somit kann an diesen Stellen jeweils immer nur das gesamte RTN als eine Einheit rekursiv eingesetzt werden.After each introductory keyword 320, 322, 324, 326, 328, 330 further keywords may follow which are not shown in FIG. 1 for the sake of clarity. Thus, e.g. after the keyword 324 "WHERE" the keywords "(", "NOT", a table name, a table field name, defined functions etc. directly follow.) A SUBSELECT, ie the recursive application of the RTN always starting at SELECT (keyword 320) eg by " ("can occur at predefined decision positions, so only the entire RTN can be recursively used as a unit at these locations.
Trotz der Vielzahl an möglichen auswählbaren Schlüsselworten besteht für SQL und verwandte Anfragesprachen eine relativ starke Eingeschränktheit und es gibt eine Reihe von Anfragen, welche sich mit den vorgegebenen Verarbeitungsbereichen in der vorgegebenen Verarbeitungsreihenfolge nur sehr umständlich und langwierig umschreiben lassen und daher aus dieser Beschreibung ein komplexerer und langsamerer Zugriffsplan generiert wird als tatsächlich erforderlich.Despite the large number of possible selectable keywords, SQL and related query languages are relatively limited and there are a number of queries which can only be described in a very cumbersome and tedious manner with the given processing areas in the given processing order and therefore become more complex and complex slower access plan is generated than actually required.
In der Formulierung dieser Fragestellungen kann auf die Gesamtheit von definierten tabellenübergeordneten Wertefeldern zugegriffen werden, welche in einem vorzugsweise erweiterten RTN, welches der Anfragesprache SQL zugrunde liegt, an genau jenen Entscheidungspositionen zugelassen werden, an welchen eine Tabelle oder ein Tabellenfeld erlaubt ist. Ebenso ist es im erweiterten RTN von SQL möglich, dass jenen Entscheidungspositionen, die eine Tabelle oder ein Tabellenfeld vorschreiben, optional eine
verbindende Entscheidungsposition folgt, welches zum Beispiel das Schlüsselwort „." vorschreibt, aufweiche wiederum zwingend eine Entscheidungsposition, welche eine Tabelle, ein Tabellenfeld oder tabellenübergeordnetes Wertefeld vorschreibt folgt. Detailreiche Darstellungen eines erweiterten RTN von SQL werden in der Beschreibung weiter unten gezeigt.In the formulation of these questions, it is possible to access the set of defined table-superordinate value fields, which are admitted in a preferably extended RTN based on the query language SQL at precisely those decision positions to which a table or a table field is permitted. Similarly, in the extended RTN of SQL, it is possible for those decision positions that dictate a table or table field to have an optional for example, the keyword ".", which in turn necessarily follows a decision position dictating a table, table field, or table-superordinate value field Detailed illustrations of an extended RTN of SQL are shown in the description below.
Eine konkrete Implementierung von tabellenübergeordneten Wertefeldern sowie die Auflösung von Anwender-SQL-Statements, in welchen diese Verwendung finden, wird aus Gründen der Übersichtlichkeit zuerst für einfache tabellenübergeordnete Wertefelder gezeigt.A concrete implementation of table-superordinate value fields as well as the resolution of user SQL statements in which they are used is shown for the sake of clarity first for simple table-superordinate value fields.
Tabellenübergeordnete Wertefelder werden in einem Voreinstellungsschritt erstellt. Die Definition von tabellenübergeordneten Wertefeldern mit gegebenenfalls optionalen Parametern sowie deren innerer, gerichteter Entscheidungsgraph können beispielsweise in einer System-Tabelle, in einer Text- oder XML-Datei erfolgen. Die tabellenübergeordneten Wertefelder werden vorzugsweise vor der Analyse von SQL-Statements einmalig in den Speicher eingelesen, um sie jederzeit schnell im Zugriff zu haben.Table-higher value fields are created in a preset step. The definition of table-superordinate value fields with possibly optional parameters as well as their inner, directed decision graph can be done, for example, in a system table, in a text or XML file. The table-superordinated value fields are preferably read into the memory once prior to the analysis of SQL statements, so that they can be accessed quickly at any time.
In der gegenständlichen Anmeldung erfolgt die Erstellung von tabellenübergeordneten Wertefeldern mittels der einleitenden Zeichenfolge „Define ConnectionField" gefolgt von einem frei wählbaren, der Funktion dieses Feldes entsprechenden Namen. Auf den Namen des tabellenübergeordneten Wertefeldes folgen eine geöffnete Klammer und eine Auflistung der jeweils optionalen Parameter. Diese Auflistung wird mit einer geschlossenen Klammer beendet. Das Ende eines tabellenübergeordneten Wertefeldes wird in der Beschreibung mittels der Zeichenfolge „End Define" gekennzeichnet, womit ein tabellenübergeordnetes Wertefeld abgeschlossen wird.In the present application, table-superimposed value fields are created by means of the introductory string "Define ConnectionField" followed by a freely selectable name corresponding to the function of this field.The name of the table-superordinate value field is followed by an open parenthesis and a list of the optional parameters Listing is terminated with a closed parenthesis The end of a table-superordinate value field is identified in the description by means of the string "End Define", which concludes a table-superordinate value field.
Der innere, gerichtete Entscheidungsgraph eines tabellenübergeordneten Wertefeldes wird innerhalb der einleitenden Zeichenfolge und der dieses tabellenübergeordnete Wertefeld abschließenden Zeichenfolge definiert.The inner, directed decision graph of a table-superordinate value field is defined within the introductory string and the string terminating this table-superordinate value field.
Der Fachmann kann aber auch eine andere Form der Angabe und Beschreibung der tabellenübergeordneten Wertefelder wählen.
Die Anwendung des Voreinstellungsschrittes folgt erfindungsgemäß nachfolgendem Verfahren:However, the person skilled in the art can also choose another form of specification and description of the table-superordinated value fields. The application of the presetting step follows according to the invention following method:
Erstellen zumindest eines tabellenübergeordneten Wertefeldes, gegebenenfalls optionale Parameter enthaltend, in einem Voreinstellungsschritt, wobei das oder die erstellten tabellenübergeordneten Wertefelder zu einer Gesamtheit von tabellenübergeordneten Wertefeldern zusammengefasst werden, und wobei jedes der erstellten tabellenübergeordneten Wertefelder einen inneren, gerichteten Entscheidungsgraphen aufweist, der unabhängig von den inneren, gerichteten Entscheidungsgraphen der anderen erstellten tabellenübergeordneten Wertefelder der Gesamtheit der tabellenübergeordneten Wertefelder definiert ist und jeweils zumindest einen Entscheidungspfad aufweist,Creating at least one table-superordinate value field, optionally containing optional parameters, in a presetting step, wherein the table parent data fields are combined to a set of table-superordinate value fields, and wherein each of the created table-superordinate value fields has an inner, directed decision graph which is independent of the inner ones , directed decision graphs of the other created table-superordinated value fields of the entirety of the table-superordinate value fields is defined and in each case has at least one decision path,
wobei für jedes tabellenübergeordnete Wertefeld die erforderlichen Entscheidungspfade und deren jeweilige Entscheidungspositionen durch die vorbestimmbare Auswertung der dem jeweiligen tabellenübergeordneten Wertefeld zugehörigen optionalen Parameter und/oder von vorgegebenen Funktionen bestimmt werden,wherein for each table-superordinated value field the required decision paths and their respective decision positions are determined by the predeterminable evaluation of the respective table-superordinate value field associated optional parameters and / or predetermined functions,
und wobei in jedem Entscheidungspfad immer zumindest eine Entscheidungsposition erreichbar ist, welche mittels eines zugehörigen Kennzeichens festlegt, dass diese zumindest ein Tabellenfeld enthält, das eindeutig einer der Datentabellen, gegebenenfalls mittels ergänzender Angabe eines Datentabellennamens, der konkret zugrunde liegenden Datenstruktur zuordenbar ist.and wherein in each decision path at least one decision position can always be reached, which specifies by means of an associated flag that it contains at least one table field which is unambiguously assignable to one of the data tables, possibly by means of supplementary specification of a data table name, of the specific underlying data structure.
Nachfolgend wird ein tabellenübergeordnetes Wertefeld erstellt, dessen innerer, gerichteter Entscheidungsgraph einen einzigen Entscheidungspfad mit nur einer Entscheidungsposition aufweist. In diesem einzigen Entscheidungspfad wird eine Entscheidungsposition erreicht, welche, unabhängig von einer gegebenen Datenstruktur, ein Tabellenfeld erreicht. Diese Entscheidungsposition enthält ebenfalls eine Verarbeitungsfunktion sowie die Angabe jener Datentabelle, auf die sich das verwendete Tabellenfeld bezieht.Subsequently, a table-superordinate value field is created whose inner, directed decision graph has a single decision path with only one decision position. In this single decision path, a decision position is reached which, regardless of a given data structure, reaches a table field. This decision position also contains a processing function and the specification of the data table to which the table field used refers.
Somit wird ein erstes tabellenübergeordnetes Wertefeld erstellt, welches der Gesamtheit der tabellenübergeordneten Wertefelder hinzugefügt wird, und der Einfachheit halber keine optionalen Parameter enthält:
Define ConnectionField AnzahlFirmen() Count (Distinct Fiπnen.FirmalD) End DefineThus, a first table-superordinate value field is created, which is added to the entirety of the table-superordinate value fields and, for the sake of simplicity, contains no optional parameters: Define ConnectionField Count () Count (Distinct Fiπnen.FirmalD) End Define
Der innere, gerichtete Entscheidungsgraph, welcher auf dem einzigen Entscheidungpfad 1051 besteht, wird für ein tabellenübergeordnetes Wertefeld 1001 wird in FIG 4 gezeigt.The inner directional decision graph, which exists on the single decision path 1051, becomes a table-superordinate value field 1001 is shown in FIG.
Die Entscheidungsposition 1101 enthält einen Wert, welcher bei Erreichen dieser Entscheidungsposition 1101 dem Ergebnis des Durchlaufes des tabellenübergeordneten Wertefeldes 1001 hinzugefügt wird.The decision position 1101 contains a value which, upon reaching this decision position 1101, is added to the result of the passage of the table-superordinate value field 1001.
Zu beachten ist, dass der innere, gerichtete Entscheidungsgraph dieses tabellenübergeordneten Wertefeldes keinen Einfluss auf die Verwendung in einem Anwender-SQL-Statement hat, so kann für eine andere Datenstruktur ein gleichnamiges tabellenübergeordnetes Wertefeld erstellt werden, welches folgenden inneren, gerichteten Entscheidungsgraphen mit ebenenfalls nur einer Entscheidungsposition enthält:It should be noted that the inner, directed decision graph of this table-superordinate value field has no influence on the use in a user SQL statement, so for a different data structure a table-like value field of the same name can be created, which has the following inner, directed decision graphs with possibly only one Decision position contains:
Define ConnectionField AnzahlFirmen() Count (Distinct Table_Firmen.PK_Firma)Define ConnectionField count companies () Count (Distinct Table_Firmen.PK_Firma)
End DefineEnd Define
Figur 5 zeigt den für eine andere Datenstruktur angepassten inneren, gerichteten Entscheidungspfad 1051 und dessen Entscheidungsposition 1101 des tabellenübergeordneten Wertefeldes 1001.FIG. 5 shows the inner, directed decision path 1051 and its decision position 1101 of the table-superordinated value field 1001 adapted for another data structure.
Vermittels eines tabellenübergeordneten Wertefeldes wird zumindest eine zu erreichende Datentabelle, im konkreten die Datentabelle Firmen bzw. Table_Firmen, festgelegt. Anhand eines angegebenen Statements wird gesucht, von welcher Datentabelle oder Menge aus diese zumindest eine zu erreichende Tabelle erreicht werden soll.By means of a table-superordinate value field, at least one data table to be reached is defined, in concrete terms, the data table companies or table_companies. On the basis of a specified statement, it is searched from which data table or set of these at least one table to be reached is to be reached.
Folgende Fragestellung verwendet das tabellenübergeordnete Wertefeld AnzahlFirmenO, um die Fragestellung: Wie viele Datensätze „Firmen" gibt es in der entsprechenden Datentabelle?
Es wird ein Anwender-SQL-Statement erstellt, um diese Fragestellung zu formulieren:The following question is used by the table-superordinate value field Number of Companies to answer the question: How many records "Companies" are there in the corresponding data table? A user SQL statement is created to formulate this question:
Beispiel :Example:
SELECT AnzahlFirmenOSELECT number companiesO
Bei der Analyse dieses Statements wird im Statement-Auflösungsschritt festgestellt, dass das tabellenübergeordnete Wertefeld AnzahlFirmenO verwendet wird. Der Durchlauf dieses tabellenübergeordneten Wertefeldes liefert - je nach für die vorhandene Datenstruktur definierten inneren, gerichteten Entscheidungsgraphen - folgende Verarbeitungsinformation:When analyzing this statement, it is detected in the statement resolution step that the table superordinate value field NumberFirmenO is used. The passage of this table-superordinate value field provides the following processing information, depending on the internal, directed decision graphs defined for the existing data structure:
Count (Distinct Firmen.FiraiaID) bzw.Count (Distinct Firmen.FiraiaID) or
Count (Distinct Table_Firmen.PK_Firma)Count (Distinct Table_Firmen.PK_Firma)
Es wird nun ein neues Übergangs-SQL-Statement erstellt, indem das Ergebnis des eingesetzten tabellenübergeordneten Wertefeldes AnzahlFirmenO durch Aufrufen und Durchlaufen desselben berechnet und im ursprünglichen Anwender-SQL-Statement mit diesem ersetzt wird:A new transient SQL statement is created by calculating the result of the used table superordinate value field NumberFirmenO by invoking and traversing it and replacing it with the original user SQL statement:
SELECT Count (Distinct Firma.FirmaID) AS AnzahlFirmen bzw. SELECT Count (Table_Firmen.PK_Firma) AS AnzahlFirmenSELECT Count (Distinct Company.CompanyID) AS Number of companies or SELECT Count (Table_Firmen.PK_Firma) AS Number of companies
Die Information „AS AnzahlFirmen" wird beispielsweise automatisch angefügt, da das an dieser Stelle eingesetzte tabellenübergeordnete Wertefeld diesen Namen trägt und kein AS auf dieses tabellenübergeordnete Wertefeld folgt.For example, the information "AS number of companies" is appended automatically because the table-superordinate value field used at this point carries this name and no AS follows this table-superordinate value field.
Soll das tabellenübergeordnete Wertefeld AnzahlFirmen einen anderen Spaltennamen aufweisen, z.B. „InsgesamteAnzahlFirmen", so ist vom Anwender die folgende Schreibweise im Anwender-SQL-Statement zu wählen:If the table-superordinate value field Number of companies has a different column name, e.g. "Total number of companies" means that the user has to choose the following notation in the user SQL statement:
SELECT AnzahlFirmenO AS msgesamteAnzahlFirmen
Dieses neue Übergangs-SQL-Statement enthält keine relationenbezogenen Operationen, weshalb diese, z.B. mittels der Tabelle der Relationen und mit dem weiter unten in der Beschreibung gezeigten Verfahren ermittelt und eingesetzt werden müssen. Somit wird im Vervollständigungsschritt ein endgültiges SQL-Statement erstellt, welches dem Stand der Technik entspricht und alle relationenbezogenen Operationen enthält und nun von jeder den SQL-Standard unterstützenden Engine analysiert, optimiert und verarbeitet werden kann:SELECT number companiesO AS ms total number of companies This new transient SQL statement does not contain any relationship-based operations, so these must be determined and used, for example, using the table of relations and the methods shown later in the description. Thus, the completion step creates a final state-of-the-art SQL statement that contains all the relationships-related operations and can now be parsed, optimized, and processed by any SQL-standard supporting engine:
SELECT Count (Distinct Firma.FirmaID) AS AnzahlFirmen FROM Firmen bzw. SELECT Count (Distinct Table_Firmen.PK_Firma) AS AnzahlFirmen FROM Table_FirmenSELECT Count (Distinct Company.CompanyID) AS Number of Companies FROM Companies or SELECT Count (Distinct Table_Firmen.PK_Firma) AS Number of Companies FROM Table_Companies
Dieses endgültige Statement enthält alle notwendigen relationenbezogenen Operationen und kann somit von einer SQL-Engine analysiert werden.This final statement contains all the necessary relationship-based operations and can thus be parsed by a SQL engine.
Jedenfalls ist es auch möglich, sämtliche relationenbezogene Operationen bereits in einem Anwender-SQL-Statement anzugeben, welches tabellenübergeordnete Wertefelder enthält:In any case, it is also possible to specify all relationship-related operations in a user SQL statement containing table-superordinate value fields:
SELECT AnzahlFirmenO FROM FirmenSELECT number companiesO FROM companies
Ein Algorithmus stellt fest, dass in diesem Anwender-SQL-Statement bereits sämtliche rβlationenbezogenen Operationen angegeben sind, daher fällt der Schritt der Vervollständigung aller benötigen relationenbezogenen Operationen aus und das Übergangs- SQL-Statement entspricht dem endgültigen SQL-Statement. Dies ist aber insofern nachteilig, als dass sich dieses Anwender-SQL-Statement somit genau auf eine konkrete Datenstruktur bezieht.An algorithm finds that this user SQL statement already specifies all the relational operations, so the step of completing all the required relational operations is eliminated, and the transient SQL statement is the final SQL statement. However, this is disadvantageous in that this user SQL statement thus relates precisely to a specific data structure.
Für die folgenden Beispiele wird auf die parallele Umwandlung für zwei oder mehrere Datenstrukturen, welche aufgrund unterschiedlicher innerer Entscheidungspfade von tabellenübergeordneten Wertefeldern und einer unterschiedlich befüllten Tabelle der Relationen automatisch vorgenommen wird, verzichtet, da sie immer dem gleichen Prinzip folgt und somit für den Fachmann verständlich ist.For the following examples, the parallel conversion for two or more data structures, which is performed automatically due to different inner decision paths of table-superordinate value fields and a differently populated table of relations, is dispensed with, since it always follows the same principle and thus is understandable to the person skilled in the art ,
Des Weiteren wird festgelegt, dass sämtliche Beispiele, welche direkt einer vorhergehenden umgangssprachlich formulierten Fragestellung folgen, in einem Formulierungsschritt erzeugte
Anwender-SQL-Statements sind. Weiters sind alle SQL-Statements Anwender-SQL- Statements, in welchen zumindest eines der tabellenübergeordneten Wertefelder aus der Gesamtheit der tabellenübergeordneten Wertefelder von dem Anwender ausgewählt und gegebenenfalls mit Parametern, in zumindest einem der Verarbeitungsbereiche in zumindest einer der Hierarchiestufen, aber unabhängig von den im Anwender-SQL-Statement verwendeten Datentabellen, bei der Formulierung des Anwender-SQL-Statements eingesetzt wird, und in welchem gegebenenfalls relationenbezogene Operationen nicht enthalten sind.Furthermore, it is stipulated that all examples which directly follow a previous colloquially formulated question were generated in a formulation step User SQL statements are. Furthermore, all SQL statements are user SQL statements in which at least one of the table-superordinate value fields from the entirety of the table-superordinate value fields is selected by the user and optionally with parameters, in at least one of the processing areas in at least one of the hierarchy levels, but independent of the User SQL statement used in the formulation of the user SQL statement, and in which, where appropriate, relationship-based operations are not included.
Ebenso werden SQL-Statements, in welchen tabellenübergeordnete Wertefelder im Aufiösungsschritt bereits verfahrensgemäß Aufgerufen und Durchlaufen wurden und welche keine bzw. nur unvollständige relationenbezogene Operationen enthalten, in der gegenständlichen Anmeldung als Übergangs-SQL-Statements definiert.Likewise, SQL statements in which table-superordinate value fields have already been called and executed according to the method in the resolution step and which contain no or only incomplete relation-related operations are defined in the present application as transitional SQL statements.
Somit sind all jene SQL-Statement, welche kein ein tabellenübergeordnetes Wertefeld und vollständige relationenbezogene Operationen enthalten, endgültige SQL-Statments, welche von einer SQL-Engine nach dem Stand der Technik analysiert, optimiert und verarbeitet werden können. In diesem Zusammenhang sei angemerkt, dass es nicht Ziel der Erfindung ist, die Erstellung eines optimierten Zugriffsplans auf Basis eines endgültigen SQL-Statement, der konkreten, mit Indexes und Statistiken versehenen Datenstruktur sowie unter Berücksichtung von vorhandenen Arbeitsspeicher usw... auszuführen. Die Aufgabe der Erfindung besteht hingegen darin, Übersichtlichkeit, kurze Schreibweise und Unabhängigkeit von zugrunde liegenden Datenstrukturen von Anwender-SQL-Statements zu ermöglichen sowie die anzuwendenden Schritte bereitzustellen, um ein automatisch endgültiges SQL- Statement ausgehend von einen Anwender-SQL-Statement zu erhalten.Thus, all those SQL statements that do not contain a table-topped value field and complete relational-related operations are final SQL statements that can be parsed, parsed, and processed by a state-of-the-art SQL engine. In this context, it should be noted that it is not an object of the invention to execute the creation of an optimized access plan on the basis of a final SQL statement, the concrete, provided with indexes and statistics data structure and taking into account existing memory, etc .. The object of the invention, however, is to provide clarity, short notation and independence from underlying data structures of user SQL statements and to provide the steps to be taken to obtain an automatically final SQL statement from a user SQL statement.
Eine unter Anwendung des erfindungsgemäßen Verfahren formulierbare Fragestellung ist: Es sollen die Anzahl Firmen je Ort berechnet und angezeigt werden:A question which can be formulated using the method according to the invention is as follows: The number of companies per location is to be calculated and displayed:
Beispiel : SELECT Firmen.Ort, AnzahlFiπnen() AS AnzahlFirmen GROUP BY Firmen.Ort
Nach Ersetzen des tabellenübergeordneten Wertefeldes AnzahlFirmen() mit dem Ergebnis seines Durchlaufs im Anwender-SQL-Statement wird folgendes neues Übergangs-SQL- Statement ohne relationenbezogene Operationen erstellt:Example: SELECT companies.location, numbering () AS numberof companies GROUP BY companies.location After replacing the table superordinate value field NumberCompanies () with the result of its passage in the user SQL statement, the following new transitional SQL statement is created without relationship-based operations:
SELECT Firmen.Ort, Count (Distinct Firmen.FirmalD) AS AnzahlFirmen GROUP BY Firmen.OrtSELECT Firmen.Ort, Count (Distinct Firmen.FirmalD) AS Number of companies GROUP BY Firmen.Ort
Dieses Übergangs-SQL-Statement kann, wie alle nachfolgenden Übergangs-SQL-Statements ebenso, nach dem unten gezeigten Verfahren um die notwendigen relationenbezogenen Operationen erweitert werden. Somit wird folgendes endgültiges SQL-Statement erzeugt und einer SQL-Verarbeitungsengine zur Analyse, Optimierung und Ausführung übergeben:This transient SQL statement, like all subsequent transient SQL statements as well, can be augmented with the necessary relational operations as shown below. Thus, the following final SQL statement is generated and passed to an SQL processing engine for analysis, optimization, and execution:
SELECT Firmen. Ort, Count (Distinct Firmen.FirmalD) GROUP BY Firmen.OrtSELECT companies. Place, Count (Distinct Companies.FirmalD) GROUP BY Companies.Location
Eine noch kürzere und für den Nicht-Fachmann intuitive Schreibweise für ein Anwender- SQL-Statement ist ebenfalls möglich und fuhrt zum gleichen, endgültigen SQL-Statement:An even shorter and for the non-specialist intuitive notation for a user SQL statement is also possible and leads to the same, final SQL statement:
SELECT Firmen.Ort, AnzahlFirmen()SELECT companies.location, numberof companies ()
Dieses Statement wird im Auflösungsschritt in folgendes Übergangs-SQL-Statement umgewandelt:This statement is converted to the following transient SQL statement in the resolution step:
SELECT FirmenOrt, Count (Distinct Firmen.FirmalD) AS AnzahlFirmenSELECT FirmenOrt, Count (Distinct Firmen.FirmalD) AS Number of companies
Die Analyse dieses Statements ergibt, dass die Aggregatsfunktion Count anzuwenden ist, wobei das Statement das Tabellenfeld Ort einschließt, welches nicht Teil einer Aggregatsfunktion ist.The analysis of this statement shows that the count aggregate function is to be used, with the statement including the table field Location, which is not part of an aggregate function.
Somit kann mittels eines einfachen Algorithmus dem Anwender beispielsweise die Frage gestellt werden, obThus, by means of a simple algorithm, for example, the user can be asked whether
- aus der Tabelle Firmen die Spalte Ort und daneben die insgesamte Anzahl Firmen gezeigt werden soll,- from the Companies table, the City column and, in addition, the total number of companies should be shown,
- je Ort die Anzahl Firmen gezeigt werden soll
Im ERSTEN Fall wird aus dem umgewandelten Übergangs-SQL-Statement automatisch folgendes neues und endgültiges SQL-Statement, in welches die relationenbezogenen Operationen bereits mittels unten gezeigten Verfahren eingefügt sind, erstellt:- for each location the number of companies should be shown In the FIRST case, the converted transitional SQL statement automatically creates the following new and final SQL statement into which the relationship-related operations are already inserted by means of the procedures shown below:
SELECT Firmen.Ort, (SELECT Anzahl(Firmen.FirmaΙD) FROM Firmen) AS AnzahlFirmen FROM Firmen;SELECT companies.location, (SELECT number (companies.companyΙD) FROM companies) AS number companies FROM companies;
Im ZWEITEN, wahrscheinlicheren Fall wird aus dem umgewandelten Übergangs-SQL- Statement automatisch folgendes neues und endgültiges SQL-Statement, in welches die relationenbezogenen Operationen bereits mittels unten gezeigten Verfahren eingefügt sind, erstellt:In the SECOND, more probable case, the converted transitional SQL statement automatically creates the following new and final SQL statement into which the relationship-related operations are already inserted by means of the methods shown below:
SELECT Firmen. Ort, Count (Distinct Firmen.FirmalD) AS AnzahlFirmen FROM FirmenSELECT companies. Place, Count (Distinct Companies.FirmalD) AS Number of Companies FROM Companies
GROUP BY Firmen.Ort;GROUP BY companies.location;
Es wird nun ein weiteres tabellenübergeordnetes Wertefeld definiert und der Gesamtheit der von einander unabhängigen, tabellenübergeordneten Wertefelder angefügt:Now another table-superordinated value field is defined and added to the totality of the independent, table-superordinate value fields:
Define ConnectionField FirmenAusWien() (Firmen.Ort="Wien")Define ConnectionField CompaniesAusWien () (Firmen.Ort = "Wien")
End DefineEnd Define
Nun wird ein Beispiel gezeigt, welches zwei unterschiedliche, von einander unabhängige tabellenübergeordnete Wertefelder (AnzahlFirmen, FirmenAusWien) in zwei unterschiedlichen Verarbeitungsbereichen (SELECT, WHERE) eines SQL-Statements verwendet:Now an example is shown, which uses two different table independent value fields (Number of Companies, Companies of Vienna) in two different processing areas (SELECT, WHERE) of an SQL Statement:
Zeige von allen Firmen aus Wien je Postleitzahl die Anzahl Firmen:Of all companies from Vienna per zip code the number of companies:
Beispiel:Example:
SELECT Firmen.PLZ, AnzahlFirmen()
WHERE FirmenPLZAusWienO GROUP BY Firmen.PLZSELECT Companies.PLZ, Number of Companies () WHERE FirmenPLZAusWienO GROUP BY Firmen.PLZ
Nach oben gezeigten Prinzip kann auch der GROUP BY- Verarbeitungsbereich im Anwender- SQL-Statement weggelassen werden, da in diesem Fall ein identes Statement generiert werden kann.The principle shown above can also be used to omit the GROUP BY processing area in the user SQL statement, since an identical statement can be generated in this case.
Dieses Statement wird aufgrund der Ergebnisse des Durchlaufs der tabellenübergeordneten Wertefeldern im Statement-Auflösungsschritt in folgendes Übergangs-SQL-Statement umgewandelt:This statement is converted to the following transient SQL statement based on the results of passing the table-superordinate value fields in the statement resolution step:
SELECT Firmen.PLZ, Count (Distinct Firmen.FirmalD) WHERE Firmen.Ort="Wien" GROUP BY Firmen.PLZSELECT Firmen.PLZ, Count (Distinct Firmen.FirmalD) WHERE Firmen.Ort = "Wien" GROUP BY Firmen.PLZ
Nach dem automatischen Einfügen der relationenbezogenen Operationen in das Übergangs- SQL-Statement wird folgendes endgültiges SQL-Statement erstellt:After automatically inserting the relationship-based operations into the transient SQL statement, the following final SQL statement is created:
SELECT Firmen.PLZ, Count(Distinct Firmen.FirmaID) FROM FirmenSELECT Companies.PLZ, Count (Distinct Companies.CompanyID) FROM Companies
WHERE Firmen.Ort="Wien" GROUP BY Firmen.PLZWHERE company.location = "Vienna" GROUP BY Firmen.PLZ
Ein weites, einfaches Anwender-SQL-Statement zeigt die Verwendung des tabellenübergeordneten Wertefeldes FirmenAusWien im Verarbeitungsbereich SELECT:A simple, simple user SQL statement shows the use of the table superordinate value field FirmenAusWien in the processing area SELECT:
Beispiel:Example:
SELECT Firmen.Firmennarne, Firmen. Ort, FirmenAusWien() FROM FirmenSELECT companies. Company brands, companies. Location, Companies Auslands () FROM Companies
Ein einfacher Algorithmus kann erkennen, dass das ConnectionField FirmenAusWien() im SQL-Verarbeitungsbereich SELECT angegeben ist und dass dieses tabellenübergeordnete Wertefeld je Datensatz Firma das boolesche Ergebnis WHERE Firmen. Ort=" Wien" liefert.
Somit wird als Ergebnis in der Spalte FirmenAusWien ein Boolean-Wert zurückgeliefert, der besagt, ob die jeweils aktuelle Firma aus Wien ist oder nicht:A simple algorithm can detect that the ConnectionField CompanyExplorer () is specified in the SQL processing area SELECT, and that this table-superordinate value field per record company has the Boolean result WHERE companies. Place = "Vienna" delivers. Thus, a Boolean value is returned as the result in the column CompaniesAusWien, which states whether the respective current company is from Vienna or not:
Das im Statement-Auflösungsschritt automatisch umwandelte Übergangs-SQL-Statement lautet wie folgt:The transitional SQL statement automatically converted in the statement resolution step is as follows:
SELECT Firmen.Firmenname, Firmen. Ort, Firaιen.Ort="Wien" AS FirmenAusWien FROM FirmenSELECT companies.company name, companies. Location, Firaιen.Ort = "Vienna" AS FirmenAusWien FROM Companies
Dieses Übergangs-SQL-Statement enthält alle notwendigen relationenbezogenen Operationen, weshalb das endgültige SQL-Statement in diesem Fall dem Übergangs-SQL- Statement entspricht.This transient SQL statement contains all the necessary relationship-based operations, so the final SQL statement in this case equals the transient SQL statement.
Es wird ein Beispiel gezeigt, aus welchem ersichtlich ist, dass die Verarbeitungsinformation im endgültigen SQL-Statement gegenüber der ursprünglichen Formulierung im Anwender- SQL-Statement verschoben und geändert werden muss:An example is shown showing that the processing information in the final SQL statement must be moved and changed from the original formulation in the user SQL statement:
Gefragt sind alle Orte, in denen es mehr als 100 Firmen mit mehr als jeweils 10 Mitarbeitern gibt, sowie die insgesamte Anzahl der Firmen in diesem Ort, also unabhängig von der Mitarbeiteranzahl :In demand are all locations where there are more than 100 companies with more than 10 employees each, as well as the total number of companies in this location, irrespective of the number of employees:
Beispiel:Example:
SELECT Firmen.0rt, AnzahlFirmen() FROM FirmenSELECT companies. 0rt, number companies () FROM companies
WHERE AnzahlFirmen0>100 AND Firmen. AnzahlMitarbeiter >= 10 GROUP BY FirmenOrtWHERE number of companies0> 100 AND companies. Number of Employees> = 10 GROUP BY CompanyOrt
Nach Einsetzten der Ergebnisse der tabellenübergeordneten Wertefelder wird folgendes, weiter zu analysierendes Übergangs-SQL-Statement gebildet:After inserting the results of the table-superordinated value fields, the following transient SQL statement to be analyzed is formed:
SELECT FirmenOrt, ( SELECT Count (Distinct Firmen. FirmalD) ) AS AnzahlFirmen FROM Firmen
WHERE Count (Distinct Firmen.FirmaID)>100 AND Firmen. AnzahlMitarbeiter >= 10 GROUP BY Firmen.OrtSELECT FirmenOrt, (SELECT Count (Distinct Firms. FirmalD)) AS Number of companies FROM companies WHERE Count (Distinct Companies.CompanyID)> 100 AND Companies. Number of Employees> = 10 GROUP BY Companies.Location
Ein Algorithmus kann erkennen, dass eine Aggregatsfunktion im S QL- Verarbeitungsbereich WHERE vorliegt, weshalb diese Verarbeitungsinformation in den HAVING- Verarbeitungsbereich verschoben wird und das endgültige SQL-Statement daher folgende Syntax aufweist, welches um die fehlenden relationenbezogenen Operationen erweitert ist:An algorithm can detect that there is an aggregate function in the SQL processing area WHERE, which is why this processing information is moved to the HAVING processing area and the final SQL statement therefore has the following syntax, which is extended by the missing relationship-based operations:
SELECT Firmen.Ort, ( SELECT Count (Distinct Sub_Firmen.FirmaID)SELECT Company.location, (SELECT Count (Distinct Sub_Company.CompanyID)
FROM Firmen AS SubJFirmen WHERE Firmen.Ort= Sub_Firmen.Ort ) AS AnzahlFirmen FROM Firmen WHERE Firmen.AnzahlMitarbeiter >= 10 GROUP BY Firmen.Ort HAVING Count(Distinct Firmen.FirmaID)>100FROM Companies AS SubJcompanies WHERE Companies.location = sub_company.location) AS Numbers Companies FROM Companies WHERE Companies.Numberemployees> = 10 GROUP BY Companies.location HAVING Count (Distinct Companies.CompanyID)> 100
Die kürzeste Schreibweise für dieses Anwender-SQL-Statement lautet:The shortest notation for this user SQL statement is:
SELECT Firmen.Ort, AnzahlFirmen()SELECT companies.location, numberof companies ()
WHERE AnzahlFirmen()>100 AND Firmen. AnzahlMitarbeiter >= 10WHERE number of companies ()> 100 AND companies. Number of employees> = 10
und wird nach dem beschriebenen Verfahren in das oben gezeigte, endgültige SQL-Statement umgewandelt. Für die folgenden Beispiele werden die unterschiedlich kurzen Schreibweisen von SQL-Statements nicht mehr immer gezeigt, das sie immer dem gleichen Prinzip folgen.and is converted to the final SQL statement shown above using the procedure described. For the following examples, the different shorthand notations of SQL statements are no longer always shown to follow the same principle.
Ein tabellenübergeordnetes Wertefeld kann auch in den FROM- Verarbeitungsbereich eines Anwender-SQL-Statements gesetzt werden, wodurch für dieses tabellenübergeordnete Wertefeld im FROM-Verarbeitungsbereich eine eigene Menge gebildet wird:A table-superordinate value field can also be set in the FROM processing area of a user SQL statement, which creates a separate quantity for this table-superordinate value field in the FROM processing area:
Alle Firmen aus Wien und deren Kontaktpersonen:
Beispiel:All companies from Vienna and their contact persons: Example:
SELECT Firmen.*, Kontaktpersonen.*SELECT companies. *, Contact persons. *
FROM FirmenAusWien() AS Firmen, Abteilungen, Kontaktpersonen WHERE (Firmen.FirmaID=Abteilungen.FirmaNr) AND (Abteilungen.AbteilunglD^Kontaktpersonen.AbteilungNr)FROM CompaniesAusWien () AS Companies, Departments, Contacts WHERE (Companies.CompanyID = Departments.CompanyNo) AND (Departments.ApartmentIDs * Contact Persons.DepartmentNo)
Ein einfacher Algorithmus kann erkennen, dass ein tabellenübergeordnetes Wertefeld imA simple algorithm can detect that a table-superordinate value field in the
Verarbeitungsbereich FROM verwendet wird und kann ein entsprechendes, einfaches endgültiges SQL-Statement erzeugen:Processing range FROM is used and can generate a corresponding, simple final SQL statement:
SELECT Firmen.*, Kontaktpersonen.*SELECT companies. *, Contact persons. *
FROM ( SELECT Firmen.* FROM Firmen WHERE Firmen.Ort="Wien") ) AS Firmen, Abteilungen, KontaktpersonenFROM (SELECT Companies. * FROM Companies WHERE Companies.Ort = "Vienna")) AS Companies, Departments, Contacts
WHERE (Firmen.FirmaID=Abteilungen.FirmaNr) AND (Abteilungen. AbteilungID=Kontaktpersonen.AbteilungNr)WHERE (Company.CompanyID = Departments.CompanyNo) AND (Departments. DepartmentID = Contact Persons. DivisionNo)
Die kürzeste Schreibweise für dieses Anwender-SQL-Statement ohne relationenbezogene Operationen, welche in einem der nachfolgenden Schritte nach dem Statement- Auflösungsschritt automatisch eingefügt werden, wie unten in der Beschreibung gezeigt beispielsweise vermittels einer Tabelle der Relationen, wird für das gleiche Beispiel gezeigt:The shortest notation for this user SQL statement with no relation-related operations automatically inserted in any of the following steps after the statement resolution step, as shown below in the description, for example, by means of a table of relations, is shown for the same example:
SELECT Firmen.*, Kontaktpersonen.* FROM FirmenAusWien() AS FirmenSELECT companies. *, Contact persons. * FROM CompaniesAusWien () AS companies
Die relationenbezogenen Operationen werden nach dem unten gezeigten Verfahren in das vom Anwender angegebene Anwender-SQL-Statement eingefügt und ergeben das oben gezeigte endgültige SQL-Statement.The relative operations are inserted into the user-specified SQL statement, as shown below, resulting in the final SQL statement shown above.
Ein erweitertes RTN, auf dessen Grundlage SQL-Statements erstellt werden können, kann folgende Fragestellung in ein SQL-Statement nach dem Stand der Technik umwandeln:
Zuerst wird ein einfaches tabellenübergeordnetes Wertefeld erstellt, welches den Umsatz jeweils im Zusammenhang mit den in einem SQL-Statement verwendeten Tabellen liefert:An advanced RTN, based on which SQL statements can be created, can transform the following question into a state-of-the-art SQL statement: First, a simple table-superordinate value field is created, which returns the revenue in each case in connection with the tables used in an SQL statement:
Defme ConnectionField Umsatz_Gesamt () Sum (Rechnungspositionen.Positionsbetrag)Defme ConnectionField Sales Total () Sum (Invoice Items.Position Amount)
End DefϊneEnd Defϊne
Es folgt nun ein Beispiel, welches ein fundamentales Grundprinzip und somit einen der größten Vorteile der tabellenübergeordneten Tabellenfelder zeigt:Here is an example that shows a fundamental principle and thus one of the biggest advantages of table-superordinate table fields:
Alle Firmen und deren Kontaktpersonen sowie der Umsatz je Kontaktperson von jenen Firmen, bei denen im Jahr 2006 einen Umsatz von mehr als 1000 Euro erzielt wurde.All companies and their contact persons as well as the turnover per contact person of those companies, where in the year 2006 a turnover of more than 1000 Euro was achieved.
Beispiel: SELECT Firmen. * , Kontaktpersonen. * , Umsatz_Gesamt() FROM Firmen.Umsatz_Gesamt()>1000 AS FirmenExample: SELECT companies. *, Contact persons. *, Turnover_Total () FROM Firms. Turnover_Total ()> 1000 AS Firms
Durch die Angabe Firmen.Umsatz GesamtQ im Verarbeitungsbereich FROM des Anwender- SQL-Statements wird festgelegt, dass dieses tabellenübergeordnete Wertefeld für die jeweils aktuelle Firma und nicht je Datensatz des kartesischen Produktes, welches sich nach der Vervollständigung der relationenbezogenen Operationen des Statements ergibt, berechnet und auswertet werden soll.By specifying Companies.Turnover TotalQ in the processing area FROM of the user SQL statement, it is determined that this table-superordinate value field is calculated for the current company and not for each Cartesian product record that results after completing the relationship-related operations of the statement to be evaluated.
Das tabellenübergeordnete Wertefeld Umatz_Gesamt, welches im Verarbeitungsbereich SELECT des Anwender-SQL-Statements angegeben ist, bezieht sich auf die einzelnen Datensätze des kartesischen Produktes, es wird also mittels diesen tabellenübergeordneten Wertefeldes der gesamte Umsatz je Firma und Kontaktperson berechnet.The table-superordinate value field Umatz_Gesamt, which is specified in the processing area SELECT of the user SQL statement, refers to the individual data records of the Cartesian product, ie the total turnover per company and contact person is calculated using this table-superordinate value field.
Ein einfacher Algorithmus erkennt, dass Ergebnis des tabellenübergeordneten Wertefeldes Umsatz_Gesamt() an den beiden verwendeten Positionen in den jeweiligen Verarbeitungsbereichen im Anwender-SQL-Statement jeweils zumindest - im konkreten Fall genau - eine Datentabelle enthält, welche jeweils nicht in der im Anwender-SQL-Statement angegebenen Datentabellen oder kartesischen Produkten der jeweiligen Hierarchiestufe enthalten sind.
Somit wird für die Umwandlung dieses Anwender-SQL-Statements in das Übergangs-SQL- Statement im Auflösungsschritt jeweils entweder eine Zwischenmenge oder ein SUB- SELECT gebildet.A simple algorithm recognizes that the result of the table-superordinate value field Sales_Total () at the two positions used in the respective processing areas in the user SQL statement contains at least - in the specific case exactly - a data table which is not stored in the user SQL Statement specified in the data tables or Cartesian products of the respective hierarchy level. Thus, either an intermediate set or a SUB-SELECT is formed in the resolution step for the conversion of this user SQL statement into the transitional SQL statement.
Die Auflösung dieses Statements ergibt somit folgendes Übergangs-SQL-Statement:The resolution of this statement thus yields the following transitional SQL statement:
SELECTSELECT
Firmen.*, Kontaktpersonen.*, ( SELECT Sum (Rechnungspositionen.Positionsbetrag ) AS Umsatz_GesamtCompanies. *, Contact persons. *, (SELECT Sum (invoice items.position item) AS turnover_total
FROM ( SELECT Firmen.*FROM (SELECT companies. *
WHERE (SELECT Sum (Rechnungsρositionen.Positionsbetrag ) ) > 1000WHERE (SELECT Sum (invoice items))> 1000
Dieses Übergangs-SQL-Statement wird nach dem unten gezeigten Verfahren um relationenbezogenen Operationen erweitert und ergibt folgendes endgültiges SQL-Statement:This transient SQL statement is extended to include relation-related operations using the procedure below, resulting in the following final SQL statement:
SELECT Firmen.*, Kontaktpersonen.*SELECT companies. *, Contact persons. *
( SELECT Sum (Rechnungspositionen.Positionsbetrag) FROM Veranstaltungen, Rechnungen, Rechnungspositionen(SELECT Sum (Invoice Items.Position Amount) FROM Events, Invoices, Invoice Items
WHERE (Kontak1personen.KontaktpersonID=Veranstaltungen.KontaktpersonNr) AND (yeranstaltungen.VeranstaltungID=Rechnungen.VeranstaltungNr) AND (Rechnungen.RechnungID=Rechnungspositionen.RechnungNr) ) AS Umsatz_Gesamt FROM ( SELECT Firmen. *WHERE (Contact person.Contact personID = Events.Contact personNo) AND (events.EventsID = Invoices.OperationNo) AND (Invoices.RequestID = Invoice items.Number)) AS Revenue_Total FROM (SELECT Companies. *
WHERE ( SELECT Sum (Rechnungspositionen.Positionsbetrag ) WHERE (Firmen.FirmaID=Abteilungen.FirmaNr) AND (Abteilungen.AbteilungID=Kontaktpersonen.AbteilungNr) AND (Kontaktpersonen. KontaktpersonID=Veranstaltungen.KontaktpersonNr) AND ( Veranstaltungen. VeranstaltungID=Rechnungen.VeranstaltungNr)WHERE (SELECT Sum (Invoice items.Position amount) WHERE (Company.CompanyID = Departments.CompanyNo) AND (Departments.DepartmentID = Contact Persons.DepartmentNo) AND (Contact Persons.contactID = Events.Contact PersonNo) AND (Events.OrderID = Invoice.OrderNo)
AND (Rechnungen.RechnungID=Rechnungspositionen.RechnungNr) ) > 1000 ) AS Firmen, Abteilungen, Kontaktpersonen WHERE (Firmen.FirmaID=Abteilungen.FirmaNr)
AND (Abteilungen.AbteilungID=Kontaktpersonen.AbteilungNr)AND (Invoice.RateID = Invoice Item.No))> 1000) AS Companies, Departments, Contacts WHERE (Company.CompanyID = Departments.CompanyNo) AND (Departments.DepartmentID = contact persons.DepartmentNo)
Dieses endgültige SQL-Statement wird einer SQL-Engine übergeben, welche dieses Statement nach dem Stand der Technik analysiert, optimiert und berechnet.This final SQL statement is passed to a SQL engine which analyzes, optimizes and calculates this state-of-the-art statement.
Es sei nochmals angemerkt, dass der Vorteil der tabellenübergeordneten Wertefelder besonders in der kurzen, für den Nicht-Fachmann einfach verständlichen Schreibweise und in der Unabhängigkeit eines Statements von der zugrunde liegenden Datenstruktur liegt. So würde für gleiches oben gezeigtes Bespiel so wie alle anderen Anwender-SQL-Statements für eine andere zugrunde liegende Datenstruktur, für welche die tabellenübergeordneten Wertefelder einen entsprechend anderen inneren, gerichteten Entscheidungsgraphen aufweisen und welcher eine der zugrunde liegenden Datenstruktur entsprechend andere Tabelle der Relationen zugrunde liegt, jeweils ein mitunter gänzlich anderes, endgültiges SQL-Statement generiert werden. Dies geschieht aber automatisch sowohl im Statement- Auflösungsschritt als auch im Vervollständiungsschritt und insbesondere ohne Veränderung jenes vom Anwender angegebenen Anwender-SQL-Statements, welches tabellenübergeordnete Wertefelder und unvollständige bzw. keine relationenbezogenen Operationen enthält.It should be noted once again that the advantage of the table-superordinate value fields lies in particular in the short spelling that is easy for the person skilled in the art and in the independence of a statement from the underlying data structure. Thus, for the same example shown above, like all other user SQL statements, for another underlying data structure for which the table-parent value fields would have a correspondingly different inner directed decision graph and which would underlie a different table of relations for one of the underlying data structures , each one sometimes completely different, final SQL statement generated. However, this happens automatically both in the statement resolution step and in the completion step and in particular without changing the user SQL statement specified by the user, which contains table-superordinate value fields and incomplete or no relationship-related operations.
Die Formulierung des obigen Beispiels kann gleichwertig auch mit folgender Schreibweise dargestellt werden, welche ebenfalls auf gleiche Weise in ein endgültiges SQL-Statement umgewandelt wird:The wording of the above example can be equivalently represented with the following notation, which is also converted into a final SQL statement in the same way:
SELECT Firmen.*, Kontaktpersonen.*, Umsatz_Gesamt() WHERE Firmen.Umsatz_Gesamt()> 1000SELECT Companies. *, Contacts. *, Revenue_Total () WHERE Company.Total_Total ()> 1000
In diesem Fall erkennt ein einfacher Algorithmus, dass im Verarbeitungsbereich WHERE eine Tabelle über einen Punkt mit einem tabellenübergeordneten Wertefeld verbunden ist und diese Information daher in den Verarbeitungsbereich FROM übernommen werden muss.In this case, a simple algorithm recognizes that, in the processing area WHERE, a table is connected to a table-superordinate value field via a point, and therefore this information must be transferred to the processing area FROM.
Es wird ein weiteres tabellenübergeordnetes Wertefeld mit optionalen Parametern angelegt:Another table-superordinated value field is created with optional parameters:
Define ConnectionField FirmenMitParametern( Betreuer, Ort, PLZ5 CountResults )
IF Param:Betreuer THEN Firmen.Betreuer IN (Param:Betreuer) IF Param:Ort THEN Firmen.Ort IN ( Param:Ort ) IF Param:PLZ THEN Firmen.PLZ IN (Param:PLZ) IF Param:CountResults THEN Count(Distinct Firmen.FirmaID)Define ConnectionField CompaniesWithParameters (Supervisor, Location, Postcode 5 CountResults) IF Param: Supervisor THEN Company Supervisor IN (Param: Supervisor) IF Param: Location THEN Company Location IN (Param: Location) IF Param: Post code THEN Company.PLZ IN (Param: Post code) IF Param: CountResults THEN Count (Distinct Firmen.FirmaID)
ELSEELSE
Finnen.* - END IF End DefineFinns. * - END IF End Define
Dieses tabellenübergeordnete Wertefeld 1002 ist in Fig. 6 gezeigt. Dieses tabellenübergeordnete Wertefeld 1002 hat einen inneren, gerichteten Entscheidungsgraphen 1051, aus welchem je nach der Auswertung der Parameter 1102 Teil-Entscheidungspfade durchlaufen werden, wodurch sie bei Durchlaufen dieses tabellenübergeordneten Wertefeldes 1002 j eweils ein verfolgter Entscheidungspfad ergibt.This table-superordinate value field 1002 is shown in FIG. This table-superordinated value field 1002 has an inner, directed decision graph 1051, from which, depending on the evaluation of the parameters 1102, partial decision paths are traversed, whereby when passing through this table-superordinate value field 1002, each time results in a tracked decision path.
Als Ergebnis dieses tabellenübergeordneten Wertefeldes werden alle aufgrund der Auswertung, also aufgrund des Aufrufens und Durchlaufens, der in einem konkreten Fall angegebenen Parameter erreichten Entscheidungspositionen 1101 als Teil des Statement- Auflösungsschritt zurückgeliefert.As a result of this table-superordinate value field, all decision positions 1101 reached on the basis of the evaluation, that is to say on the basis of the call and pass, of the parameters specified in a specific case are returned as part of the statement resolution step.
Mit der Gesamtheit der tabellenübergeordneten Wertefelder sind nun folgende Anwender- SQL-Statements möglich:With the entirety of the table-superordinated value fields, the following user SQL statements are now possible:
Fragestellung: Liefere alle Firmen aus dem Ort Wien, deren Betreuer entweder Müller, Meier oder Steiner ist.Question: Deliver all companies from the city of Vienna, whose supervisors are either Müller, Meier or Steiner.
Beispiel:Example:
SELECT Firmen.* FROM FirmenMitParamtern( Betreuer="Müller,Meier,Steiner", Ort="Wien")SELECT companies. * FROM FirmenMitParamtern (supervisor = "Müller, Meier, Steiner", location = "Wien")
Dieses Statement wird umgewandelt in:This statement is converted into:
SELECT Firmen.*
FROMSELECT companies. * FROM
( SELECT Firmen.*(SELECT companies. *
WHERE Firmen.Betreuer IN („Müller","Meier","Steiner")WHERE companies.Tourist IN ("Müller", "Meier", "Steiner")
AND Firmen.Qrt IN ("Wien")AND Companies.Qrt IN ("Vienna")
))
Fragestellung: Zeige alle Orte und je Ort als Spalte die Anzahl Firmen, deren Betreuer Müller ist und als weitere Spalte die Anzahl Firmen, deren Betreuer Meier ist.Question: Show all places and per city as a column, the number of companies whose supervisor is Müller and as another column, the number of companies whose supervisor Meier.
Beispiel :Example:
SELECT Firmen. Ort,SELECT companies. Place,
,. FirmenMitParametern ( Betreuer="Müller", CountResults ) AS AnzMueller,. FirmenMitParametern (Supervisor = "Müller", CountResults) AS AnzMueller,
FirmenMitParametern ( Betreuer="Meier", CountResults ) AS AnzMeier FROM FirmenCompaniesWithParameters (Supervisor = "Meier", CountResults) AS AnzMeier FROM Companies
GROUP BY FirmenOrtGROUP BY FirmenOrt
In diesem Fall wird erkannt, dass in den tabellenübergeordneten Wertefeldem jeweils eine Aggregatsfunktion verwendet wird, und im angegebenen SQL-Statement ein GROUP BY angewandt wird. Entsprechend wird in der einzigen Hierarchiestufe des angegebenen Statements als Tabelle die aggregierte Menge FirmenOrt herangezogen. Diese wird nun mit sämtlichen im Ergebnis der beiden verwendeten tabellenübergeordneten Wertefelder vorhandenen Tabellen, im konkreten mit der Tabelle Firmen, verglichen. Es wird festgestellt, dass die Tabelle Firmen nicht in der einzigen Hierarchiestufe des angegebenen Statements vorhanden ist und demnach werden automatisch zwei SUB-SELECTs angelegt, welche jeweils eine Verbindung zu der ihnen übergeordneten Hierarchiestufe über das Tabellenfeld Firmen.Ort aufweisen. Wird ein SUB-SELECT automatisch eingefügt, können sämtliche in diesem SUB-SELECT verwendeten Tabellen mittels AS-Parameter den Namen „Sub__" plus den Tabellennamen bekommen. Somit ist eine Unterscheidung zwischen den Tabellen der Hierarchiestufen und den Tabellen der SUB-SELECTs gewährleistet.In this case, it is detected that an aggregate function is used in each of the table-superordinate value fields, and a GROUP BY is used in the specified SQL statement. Accordingly, in the single hierarchical level of the given statement, the aggregated quantity of company location is used as a table. This will now be compared with all the tables in the result of the two tabular value fields used, in concrete terms with the Companies table. It is noted that the company table is not present in the single hierarchy level of the specified statement, and therefore two SUB-SELECTs are automatically created, each of which has a connection to the higher-level hierarchy level via the Company.Ort table field. If a SUB-SELECT is inserted automatically, all tables used in this SUB-SELECT can be given the name "Sub__" plus the table name by means of AS parameters, thus ensuring a distinction between the tables of the hierarchy levels and the tables of the SUB-SELECTs.
Somit wird dieses Statement automatisch umgewandelt in:Thus, this statement is automatically converted into:
SELECT FirmenOrt,
( SELECT Count (Distinct Sub_Firmen.FirmaID) FROM Firmen AS Sub_Firmen WHERE Sub_Firmen.Betreuer IN („Müller") AND (Sub_Firmen.Ort=Firmen.Ort) ) AS AnzMueller,SELECT company location, (SELECT Count (Distinct Sub_Company.CompanyID) FROM Companies AS Sub_Companies WHERE Sub_Companies.Consultant IN ("Miller") AND (Sub_Company.Ort = Company.location)) AS AnzMueller,
( SELECT Count (Distinct Sub_Firmen.FirmaID) FROM Firmen AS SubJFirmen WHERE Sub_Firmen.Betreuer IN („Meier") AND (Sub__Firmen.Ort=Firmen.Ort) ) AS AnzMeier(SELECT Count (Distinct Sub_Company.CompanyID) FROM Companies AS SubJCompanies WHERE Sub_Companies.Accountant IN ("Meier") AND (Sub__Company.Ort = Company.location)) AS AnzMeier
FROM Firmen GROUP BY Firmen.OrtFROM Companies GROUP BY Companies.Location
Die kürzeste Schreibweise für dieses Statement würde mit der Verwendung von tabellenübergeordneten Wertefeldern folgendermaßen lauten:The shortest way to write this statement would be to use table-level value fields as follows:
SELECT Firmen.Ort,SELECT companies.location,
FirmenMitParametern ( Betreuer="Müller", CountResults ) AS AnzMueller, FirmenMitParametern ( Betreuer="Meier", CountResults ) AS AnzMeierFirmenMitParametern (Supervisor = "Müller", CountResults) AS AnzMueller, FirmenMitParametern (Supervisor = "Meier", CountResults) AS AnzMeier
Wie im oberen Bereich der Beschreibung erwähnt, kann die Notwendigkeit des Verarbeitungsbereichs FROM für die Tabelle Firmen und des Verarbeitungsbereichs GROUP BY für das Tabellenfeld Firmen.Ort mittels eines einfachen Algorithmus erkannt und entsprechend automatisch angefügt werden.As mentioned in the upper part of the description, the necessity of the FROM processing area for the company table and the GROUP BY processing area for the Company.Ort table field can be recognized by means of a simple algorithm and automatically added accordingly.
Mittels einer Erweiterung des zugrunde liegenden RTN, welches dem RTN von SQL entspricht, kann die Verwendung der tabellenübergeordneten Wertefelder noch ausgebaut werden.By means of an extension of the underlying RTN, which corresponds to the RTN of SQL, the use of the table-superordinate value fields can be expanded.
Dies geschieht dadurch, dass im RTN von SQL der Produktbildungs- Verarbeitungsbereich, der die in der jeweiligen Hierarchiestufe zu verwendenden Datentabellen enthält und die Bildung eines kartesischen Produktes für dieselben beschreibt, nur als optionaler Entscheidungspfad definiert ist,
und in jenen Fällen, in denen dieser Produktbildungs- Verarbeitungsbereich im Anwender- SQL-Statement nicht angegeben ist, dieser in einem späteren Schritt automatisch erstellt wird und, beispielsweise mittels einer Tabelle der Relationen, sämtliche zur Auflösung des Anwender-SQL-Statements benötigten Datentabellen ermittelt in diesem Verarbeitungsbereich und eingefügt werden,This is because in the RTN of SQL, the product-formation processing area, which contains the data tables to be used in the respective hierarchy level and describes the formation of a Cartesian product for them, is defined as an optional decision path only, and in those cases where this product-building processing area is not specified in the user SQL statement, it is automatically created in a later step and, for example, by means of a table of relations, determines all the data tables needed to resolve the user's SQL statement be inserted in this processing area and
und die relationenbezogenen Operationen, welche zwischen den eingefügten Datentabellen unter der Berücksichtigung der Hierarchiestufe vorhanden sind, automatisch in den Kriterien- Verarbeitungsbereich (WHERE) des Übergangs-SQL-Statement und somit auch in das endgültigen SQL-Statements eingefügt werden.and the relation-related operations that exist between the inserted data tables, taking into account the hierarchy level, are automatically inserted into the criteria processing area (WHERE) of the transitional SQL statement and thus also into the final SQL statement.
Um dies zu zeigen, wird nur ein einfaches Anwender-SQL-Statement erstellt, für welches der Statement- Auflösungsschritt und die der Vervollständigungsschritt nicht gezeigt wird:To show this, only a simple SQL user statement is created for which the statement resolution step and the completion step are not shown:
SELECT Abteilungen.*, Abteilungen.AnzaHKontaktpersonen() WHERE Firmen.PLZ=1010SELECT Departments. *, Departments.Contact Persons () WHERE Companies.PLZ = 1010
Ebenso kann das SQL-RTN erweitert werden, dass jene Entscheidungspositionen im RTN von SQL, an welchen ein Tabellenname unabhängig von den Verarbeitungsbereichen angegeben werden kann, derart erweitert werden, dass anstatt eines Tabellennamens ein tabellenübergeordnetes Wertefeld an diesen Entscheidungspositionen zugelassen wird, wobei auf ein tabellenübergeordnetes Wertefeld nicht zwingend weitere Entscheidungspositionen folgen müssen, und die von dieser RTN-Erweiterung betroffenen Anwender-SQL-Statements im Auflösungs-Schritt zuerst in ein Übergangs-SQL-Statement und nachfolgend in ein endgültiges SQL-Statement umgewandelt werdenSimilarly, the SQL RTN can be extended to extend those decision positions in the RTN of SQL to which a table name can be specified independently of the processing areas, such that instead of a table name, a table-superordinate value field is allowed at those decision locations, with a table-topping Value field does not necessarily have to follow further decision positions, and the user SQL statements concerned by this RTN extension are first transformed in the resolution step into a transitional SQL statement and subsequently into a final SQL statement
Folgendes einfaches Anwender-SQL- Statement zeigt zwei tabellenübergeordnete Wertefelder, welche jeweils an einer Entscheidungsposition im Anwender-SQL-Statement angegeben sind, an der ebenfalls ein Datentabellenname zulässig ist:The following simple user SQL statement shows two table-superordinated value fields, which are specified in each case at a decision position in the user SQL statement on which a data table name is also permitted:
SELECT Firmen.*, UmsatzO FROM FirmenAusWienO
Das SQL-RTN kann auch dadurch erweitert werden, dass jene Entscheidungspositionen imSELECT Companies. *, TurnoverO FROM CompaniesAusWienO The SQL RTN can also be extended by including those decision positions in the
RTN von SQL, an welchen ein Tabellenfeldname unabhängig von den Verarbeitungsbereichen angegeben werden kann, derart erweitert werden, dass anstatt einesRTN of SQL, to which a table field name can be specified independently of the processing areas, are extended in such a way that instead of a
Tabellenfeldnamens ein tabellenübergeordnetes Wertefeld an diesen Entscheidungspositionen zugelassen wird, wobei auf das tabellenübergeordnete Wertefeld nicht zwingend weitereTable field name, a table-superordinate value field is permitted at these decision positions, whereby the table-superordinate value field does not necessarily require more
Entscheidungspositionen folgen müssen, und die von dieser RTN-Erweiterung betroffenenDecision-making positions and those affected by this RTN extension
Anwender-SQL-Statements im Auflösungs-Schritt zuerst in ein Übergangs-SQL-Statement und nachfolgend in ein endgültiges SQL-Statement umgewandelt werden undUser SQL statements in the resolution step are first converted into a transient SQL statement and subsequently into a final SQL statement, and
wobei das tabellenübergeordnete Wertefeld im Statement-Auflösungsschritt in einer, der dieses tabellenübergeordnete Wertefeld enthaltenden, direkt untergeordneten Hierarchiestufe, eingefügt wird.wherein the table-superordinate value field is inserted in the statement resolution step in a directly subordinate hierarchy level containing this table-superordinate value field.
Das Anwender-SQL-Statement zeigt zwei tabellenübergeordnete Wertefelder, welche an Entscheidungspositionen im SQL-RTN eingesetzt sind, an welcher ebenfalls ein Tabellenfeldname zulässig ist.The user SQL statement shows two table-superordinated value fields, which are used at decision positions in the SQL RTN, to which a table field name is also permitted.
SELECT Firmen.Name, Abteilungen.Abteilungsname, Abteilungen.Umsatz() ORDER BY Firmen.Umsatz()SELECT Companies.Name, Departments.Department Name, Departments.Turnover () ORDER BY Companies.Turnover ()
Dieses Anwender-SQL-Statement liefert den Firmennamen, den Abteilungsnamen und den Umsatz je Abteilung, wobei die Ergebnisse nach dem Firmenumsatz sortiert sind.This user SQL statement returns the company name, department name, and revenue per department, with results sorted by company sales.
Weiters kann das SQL-RTN kann auch dadurch erweitert werden, dass jene Entscheidungspositionen im RTN von SQL, an welchen ein Tabellenname unabhängig von den Verarbeitungsbereichen angegeben werden kann, derart erweitert werden, dass auf diese Tabellennamen optional ein Verbindungszeichen, vorzugsweise ein Punkt, gefolgt von einer Tabelle, einem Tabellenfeld, einem tabellenübergeordneten Wertefeld, einer Vergleichsoperation, oder einer Aggregatsfunktion zugelassen wird.Furthermore, the SQL RTN can also be extended by extending those decision positions in the RTN of SQL to which a table name can be specified independently of the processing areas such that these table names optionally have a connection character, preferably a period followed by a table, a table field, a table-superordinate value field, a comparison operation, or an aggregate function.
Nachfolgendes Beispiel zeigt an Anwender-SQL-Statement, in welchem auf eine Tabellen- Entscheidungsposition jeweils einmal eine Aggregatsfunktion, ein Tabellenname mit einer
nachfolgenden Aggregatsfunktion und ein Tabellenname mit einem tabellenübergeordneten Wertefeld folgen.The following example shows a user SQL statement in which an aggregate function, a table name with a following aggregate function and a table name with a table-superordinate value field.
SELECT Firmen.Count, Firrnen.Abteilungen.Count,SELECT Companies.Count, Companies.Apartments.Count,
Firmen.AnzahlKontaktpersonenO FROM Firmen.PLZCompanies.NumberContact personsO FROM Companies.PLZ
Dieses Anwender-SQL-Statement wird im nachfolgenden Statement-Analyseschritt und danach im Vervollständigungsschritt in dieses endgültige SQL-Statement umgewandet:This user SQL statement is converted into this final SQL statement in the following statement analysis step and then in the completion step:
SELECT Firmen.PLZ, Count(Distinct Firmen. FirmalD) AS Count_Firmen, Count (Distinct Abteilungen. AbteilungID) AS Count_Abteilungen, Count (Distinct Kontaktpersonen.KontaktpersonID) AS AnzahlKontaktpersonen FROM Firmen, Abteilungen, KontaktpersonenSELECT Companies.PLZ, Count (Distinct Companies, FirmalD) AS Count_Companies, Count (Distinct Departments. DepartmentID) AS Count_Services, Count (Distinct Contacts.ContactID) AS NumberContact Persons FROM Companies, Departments, Contacts
WHERE (Firmen.FirmaID=Abteilungen.FirmaNr)WHERE (Company.CompanyID = Departments.CompanyNo)
AND (Abteilungen.AbteilungID=Kontaktpersonen.AbteilungNr)AND (Departments.DepartmentID = contact persons.DepartmentNo)
GROUP BY Firmen.PLZGROUP BY Companies.PLZ
Gemäß einer weiteren Variante des erfindungsgemäßen Verfahrens kann das SQL-RTN auch dadurch erweitert werden, dass jene Entscheidungspositionen im RTN von SQL, an welchen ein Tabellenfeldname unabhängig von den Verarbeitungsbereichen angegeben werden kann, derart erweitert werden, dass auf diese Tabellenfeldnamen optional ein Verbindungszeichen, vorzugsweise ein Punkt, gefolgt von einer Tabelle, einem Tabellenfeld, einem tabellenübergeordneten Wertefeld, einer Vergleichsoperation oder einer Aggregatsfunktion zugelassen wird.According to another variant of the method according to the invention, the SQL RTN can also be extended such that those decision positions in the RTN of SQL to which a table field name can be specified independently of the processing areas are extended in such a way that optionally a connection character, preferably A point followed by a table, a table field, a table-top value field, a comparison operation, or an aggregate function is allowed.
Im nachfolgenden Anwender-SQL-Statement folgt der Entscheidungsposition Tabellenfeld „PLZ" jeweils eine Aggregatsfunktion, ein tabellenübergeordnetes Wertefeld und eine Tabelle, aufweiche eine Aggregatsfunktion folgt.In the following user SQL statement, the decision field Table field "ZIP" is followed by an aggregate function, a table-superordinated value field and a table followed by an aggregate function.
SELECT Firmen.PLZ.Count,SELECT Companies.PLZ.Count,
AVG ( Firmen.PLZ.AnzahlKontaktpersonen() ),
AVG (Firmen.PLZ.Abteilungen.Count)AVG (Firmen.PLZ.AnzahlKontaktpersonen ()), AVG (Companies.PLZ.Abteilungen.Count)
Im Statement-Auflösungsschritt und im nachfolgenden Vervollständigungsschritt wird folgendes endgültiges SQL-Statement automatisch erzeugt:In the statement resolution step and in the subsequent completion step, the following final SQL statement is generated automatically:
SELECT Count (Distinct Firmen.PLZ) AS Count_Firmen_PLZ, AVG (Firmen_PLZ_AnzahlKontaktpersonen) ASSELECT Count (Distinct Companies.PLZ) AS Count_Firmen_PLZ, AVG (Firmen_PLZ_AnzahlKontaktpersonen) AS
AVG_Firmen_PLZ_AnzahlKontaktpersonen, AVG (Count_Firmen_PLZ_Abteilungen) ASAVG_Firmen_PLZ_AnzahlKontaktpersonen, AVG (Count_Firmen_PLZ_Abteilungen) AS
AVG_Count_Firmen_PLZ_Abteilungen FROM (AVG_Count_Company_PLZ_departments FROM (
SELECT Firmen.PLZSELECT companies.plz
( SELECT Count (Distinct Kontaktpersonen.KontaktpersonID) FROM Firmen, Abteilungen, Kontaktpersonen(SELECT Count (Distinct Contact Persons.ContactID) FROM Companies, Departments, Contacts
WHERE Firmen.FirmaID=Abteilungen.FirmaNr AND Abteilungen.AbteilungID=Kontaktpersonen.AbteilungNr ) AS Firmen_PLZ_AnzahlKontaktpersonen, ( SELECT Count (Distinct Abteilungen. AbteilungID) FROM Firmen, AbteilungenWHERE Company.CompanyID = Departments.CompanyNo AND Departments.DepartmentID = Contact Persons.DepartmentNo) AS Company_PLZ_NumberContact Persons, (SELECT Count (Distinct Departments. DepartmentID) FROM Companies, Departments
WHERE Firmen.FirmaID=Abteilungen.FirmaNr ) AS Count_Firmen_PLZ_Abteilungen FROM FirmenWHERE Companies.CompanyID = Departments.CompanyNo) AS Count_Company_PLZ_Subscriptions FROM Companies
))
Gemäß einer weiteren Variante des erfindungsgemäßen Verfahrens kann das SQL-RTN auch dadurch erweitert werden, dass jene Entscheidungspositionen, an welchen ein tabellenübergeordnetes Wertefeld unabhängig von den Verarbeitungsbereichen angegeben werden kann, derart erweitert, dass auf diese tabellenübergeordneten Wertefelder optional ein Verbindungszeichen, vorzugsweise ein Punkt, gefolgt von einer Tabelle, einem Tabellenfeld, einem tabellenübergeordneten Wertefeld, einer Vergleichsoperation oder einer Aggregatsfunktion zugelassen wird,According to a further variant of the method according to the invention, the SQL RTN can also be extended by expanding those decision positions at which a table-superordinate value field can be specified independently of the processing areas in such a way that a connection character, preferably a point, is optionally added to these table-superordinate value fields. followed by a table, a table field, a table-superordinate value field, a comparison operation, or an aggregate function,
wobei nachfolgenden Vergleichsoperationen als zusätzliche Parameter für das jeweilige tabellenübergeordnete Wertefeld angenommen werden, und wobei
sämtliche anderen mit dieser Entscheidungsposition in Verbindung stehenden Entscheidungspositionen mit dem Statement- Auflösungsschritt verarbeitet werden.wherein subsequent comparison operations are assumed as additional parameters for the respective table-superordinate value field, and wherein all other decision positions associated with this decision position are processed with the statement resolution step.
Ein Beispiel soll die sich dadurch neu ergebenden Möglichkeiten bei der Formulierung eines Anwender-SQL-Statements zeigen: In diesem Beispiel folgt beide Male eine Vergleichsoperation aus die beiden tabellenübergeordneten Wertefelder. Dem entsprechend werden diese im Statement-Auflösungsschritt als weitere Parameter der tabellenübergeordneten Wertefelder herangezogen und entsprechend aufgelöst.An example will show the new possibilities of formulating a user-defined SQL statement: In this example, a comparison operation follows from the two table-superordinated value fields. Accordingly, these are used in the statement resolution step as further parameters of the table-superordinate value fields and resolved accordingly.
SELECT Firmen.*SELECT companies. *
WHERE FirmenAusWien().AnzMitarbeiter>5WHERE CompaniesAustria (). Employees> 5
AND AnzahlKontaktρersonen().Nachname="Müller">l 0AND NumberContact People (). Last Name = "Miller"> l 0
Folgendes endgültiges SQL-Statement wird automatisch nach dem Auflösungsschritt und dem Vervollständigungsschritt erzeugt:The following final SQL statement is generated automatically after the resolution step and the completion step:
SELECT Firmen.* FROM Firmen WHERE Firmen.PLZ IN (SELECT Companies. * FROM Companies WHERE Companies.PLZ IN (
SELECT Ort_PLZ.PLZ FROM Ort_PLZ WHERE Ort_PLZ.Ort="Wien") AND Firmen.AnzMitarbeiter>5 AND ( SELECT Count (Distinct Kontaktpersonen.KontaktpersonID ) FROM Abteilungen, Kontaktpersonen WHERE Firmen.FirmaID=Abteilungen.FirmaNrSELECT Location_PLZ.PLZ FROM City_PLZ WHERE City_PLZ.Ort = "Vienna") AND Companies.Employees> 5 AND (SELECT Count (Distinct Contact Persons.ContactID) FROM Departments, Contacts WHERE Company.CompanyID = Departments.CompanyNo
AND Abteilungen.AbteilungID=Kontaktpersonen.AbteilungNr AND Kontaktpersonen.Nachname="Müller" ) > 10AND Departments.DepartmentID = Contact persons.DepartmentNo AND contact persons.Surname = "Müller")> 10
Ausgehend von diesem erweiterten RTN können folgende Fragestellung einfach formuliert werden:
Alle Finnen, aus Orten in denen es mehr als 100 Firmen gibt:Based on this extended RTN, the following questions can be easily formulated: All Finns, from places where there are more than 100 companies:
SELECT Firmen.* FROM FirmenSELECT companies. * FROM companies
WHERE Firmen.Ort.AnzahlFirmen()>100WHERE Companies.Location.NumberCompanies ()> 100
Über die Analyse vermittels des erweiterten RTN kann erkannt werden, dass die Anfrage endgültig folgendermaßen automatisch als endgültiges SQL-Statement formuliert werden soll:Through the analysis by means of the extended RTN, it can be seen that the request is finally formulated automatically as a final SQL statement as follows:
SELECT Firmen.* FROM ( SELECT Firmen.Ort FROM Firmen GROUP BY FirmenOrt HAVING Count (Distinct Firmen.FirmalD) > 100)SELECT companies. * FROM (SELECT companies.location FROM companies GROUP BY companieslocation HAVING Count (Distinct companies.companyD)> 100)
AS Firmen_Ort, Firmen WHERE (Firmen.Ort=Firmen_Ort.Ort)AS Firmen_Ort, Companies WHERE (Firmen.Ort = Firmen_Ort.Ort)
Eine gleichwertige, ebenfalls automatische Umwandlungsmöglichkeit für dieses Anwender- SQl-Statement ist das folgende endgültige Anwender-SQL-Statement:An equivalent, also automatic conversion option for this user SQl statement is the following final user SQL statement:
SELECT Firmen.* FROM Firmen WHERE (FirmenOrt INSELECT companies. * FROM companies WHERE (companylocation IN
( SELECT FirmenOrt FROM Firmen GROUP BY FirmenOrt(SELECT FirmenOrt FROM Firmen GROUP BY FirmenOrt
HAVING Count (Distinct Firmen.FirmaID)>100) )HAVING Count (Distinct Companies.CompanyID)> 100))
Die Erzeugung eines derartigen SQL-Statements aus dem angegebenen SQL-Statement in dem weiter oben gezeigten Beispiel kann auf mehrere Arten erfolgen und ist für den
Fachmann ohne weiters möglich, weswegen hier auf einen konkreten, einfachen Algorithmus verzichtet wird.The generation of such an SQL statement from the specified SQL statement in the example shown above can be done in several ways and is for the Expert without further possible, so here is waived a concrete, simple algorithm.
Eine weitere Fragestellung soll das automatische Anfügen eines neuen Verarbeitungsbereiches unter Verwendung des erweiterten SQL-RTNs zeigen:Another question is the automatic addition of a new processing area using the extended SQL RTN:
Alle Firmen, deren Betreuer Müller heißt:All companies whose mentors Müller is called:
Beispiel:Example:
SELECT FirmenMitParametern ( Betreuer="Müller").*SELECT CompaniesWithParameters (Supervisor = "Müller"). *
Es wird mittels eines einfachen Algorithmus erkannt, dass alle Firmen, deren Betreuer „Müller" ist, ausgegeben werden sollen, weshalb automatisch ein WHERE- Verarbeitungsbereich eingefügt wird.It is recognized by means of a simple algorithm that all companies whose maintainer is "Müller" should be output, which is why a WHERE processing area is automatically inserted.
Somit lautet das automatisch umgewandelte Statement wie folgt:Thus, the automatically converted statement is as follows:
SELECT Firmen.* FROM FirmenSELECT companies. * FROM companies
WEHRE Firmen.Betreuer IN („Müller")WEHRE Firmen.Betreuer IN ("Müller")
In der Praxis wird in einer relationalen Datenbank, welche den Codd' sehen Normalformen folgt, das Tabellenfeld Betreuer in der Tabelle Firmen nicht als Text-Feld sondern als Zahlenfeld enthalten sein und eine Relation zu einer eigenen Tabelle, so zum Beispiel der Tabelle Mitarbeiter, enthalten.In practice, in a relational database that follows the normal form of Codd, the Supervisor table field in the Firms table will not be included as a text field but as a numeric field and contain a relation to a separate table, such as the Employees table ,
So wird das Textfeld Betreuer in der Tabelle Firmen beispielsweise in das Zahlenfeld BetreuerNr umgewandelt und es wird eine weitere Tabelle Mitarbeiter (Mitarbeitern), Nachname, Vorname, ...) angelegt, welche folgende Relation zu der Tabelle Firmen enthält:For example, the text field Maintainer in the Company table is converted to the Number field MaintainerNo and another table Employee (employee), Last name, First name, ...) is created, which contains the following relation to the Company table:
Mitarbeiter (Mitarbeiterin) -> Firmen(BetreuerNr)
Dieser Sachverhalt lässt sich, besonders nach dem die Datenstruktur verändert bzw. erweitert wird und somit eine Mehrzahl von bereits erstellten SQL-Statements betroffen ist, vermittels eines weiteren tabellenübergeordneten Wertefeldes einfach darstellen:Employee (employee) -> Companies (supervisor) This situation can be easily represented, especially after the data structure has been changed or expanded and thus a plurality of already created SQL statements is affected, by means of another table-superordinated value field:
Define ConnectionField FirmenBetreutVon ( Betreuer ) WHERE Firmen.BetreuerNr IN ( SELECT MitarbeiterID WHERE Nachname IN (Param: Betreuer )Define ConnectionField CompaniesPrepared by (supervisor) WHERE Companies.AccountingNo IN (SELECT EmployeeID WHERE Lastname IN (Param: Supervisor)
) End Define) End Define
Es ist auch möglich, ein tabellenübergeordnetes Wertefeld Firmen.Betreuer zu erstellen, welches nur einen Entscheidungspfad mit nur einer Entscheidungsposition in seinem inneren, gerichteten Entscheidungsgraphen enthält:It is also possible to create a table superordinate value field Company Manager, which contains only one decision path with only one decision position in its inner, directed decision graph:
Define ConnectionField Firmen.Betreuer() SELECT Mitarbeiter .Nachname WHERE Mitarbeiter.MitarbeiterID =Firmen.BetreuerNrDefine ConnectionField Companies.Trust () SELECT Employees .Family Name WHERE Employees.EmployeesID = Companies.BetreuerNr
End DefineEnd Define
Somit kann folgende Fragestellung analysiert und umgewandelt werden:Thus, the following question can be analyzed and converted:
Alle Kontaktpersonen jener Firmen, deren Betreuer entweder Müller oder Meier sind:All contact persons of those companies whose supervisors are either Müller or Meier:
Beispiel :Example:
SELECT Kontaktpersonen.*SELECT contact persons. *
WHERE Firmen.Betreuer IN („Müller","Meier")WHERE companies.Trigger IN ("Müller", "Meier")
Im Statement-Auflösungsschritt wird dieses Anwender-SQL-Statement umgewandelt in:In the statement resolution step, this user SQL statement is converted into:
SELECT Kontaktpersonen.* WHERE (SELECT contact persons. * WHERE (
SELECT Mitarbeiter.NachnameSELECT employee.lastname
WHERE Mitarbeiter.MitarbeiterID=Firmen.BetreuerNr
) IN („Müller'Y'Meier")WHERE employees.employeesID = companies.careerNo ) IN ("Müller'Y'Meier")
In einem nächsten Vervollständigungsschritt wird dieses automatisch erzeugte SQL- Statement um die relationenbezogenen Operationen erweitern, wie es weiter unten in der Anmeldung gezeigt wird. Somit ergibt sich für die aktuell zugrunde liegende Datenstruktur folgendes endgültiges SQL-Statement:In a next completion step, this automatically generated SQL statement will be augmented by the relational operations, as shown later in the application. This results in the following final SQL statement for the currently underlying data structure:
SELECT Kontaktpersonen.* FROM Firmen, Abteilungen, Kontaktpersonen WHERE (SELECT Contacts. * FROM Companies, Departments, Contacts WHERE (
SELECT Mitarbeiter.Nachname FROM MitarbeiterSELECT employee.lastname FROM employee
WHERE Mitarbeiter.MitarbeiterID=Firmen.BetreuerNr ) IN („Müller'Y'Meier") AND (Firmen.FirmaID=Abteilungen.FirmaNr)WHERE employee.employeeID = company.careerNo) IN ("Müller'Y'Meier") AND (company.companyID = departments.companyNo)
AND (Abteilungen.AbteilungID=Kontaktpersonen.AbteilungNr)AND (Departments.DepartmentID = contact persons.DepartmentNo)
Es kann auch ein tabellenübergeordnetes Wertefeld Mitarbeiter_GetIDOfName() mit dem Parameter „Nachname" erstellt werden, welches als Entscheidungsposition im tabellenübergeordneten Wertefeld FirmenBetreutVon() verwendet wird:You can also create a table-superordinate value field Employee_GetIDOfName () with the parameter "Last name", which is used as a decision item in the table-related value field CompanyBetreutVon ():
Define ConnectionField Mitarbeiter_GetIDOfName (Nachname) SELECT Mitarbeiter.MitarbeiterIDDefine ConnectionField employee_GetIDOfName (last name) SELECT employee.employeeID
WHERE Mitarbeiter.Nachname IN (Param: Nachname ) ) End DefineWHERE employee.lastname IN (param: last name)) End Define
Define ConnectionField FirmenBetreutVon ( Betreuer ) Firmen.BetreuerNr IN ( Mitarbeiter_GetIDOfName (Param:Betreuer ) )Define ConnectionField CompaniesBetreAbout (Supervisor) Companies.AuditorNo IN (Employee_GetIDOfName (Param: Supervisor))
End DefmeEnd Defme
Es kann auch ein tabellenübergeordnetes Wertefeld Firmen.Betreuer erstellt werden, womit keine Veränderung an bereits erstellten SQL-Statements vorgenommen werden muss:
Define ConnectionField Firmen.Betreuer() SELECT Mitarbeiter .Nachname WHERE Mitarbeiter.MitarbeitβrID=Firmen.BetreuerNr End DefineIt is also possible to create a table-superordinate value field Company Supervisor with which no change to already created SQL statements has to be made: Define ConnectionField Companies.Supplier () SELECT Employees .Lastname WHERE Employees.EmployeeID = Companies.ConsultantNo End Define
Sollen nun alle Firmen und deren Betreuer gezeigt werden, kann dies mittels folgender Formulierung abgefragt werden:If all companies and their supervisors are to be shown, this can be queried using the following wording:
Beispiel:Example:
SELECT Firmen.Firmenname, Firmen.BetreuerSELECT companies.company name, companies.responsible
Dieses von einem Anwender angegebene Statement wird nach dem Statement- Auflösungsschritt und der Vervollständigung von fehlenden relationenbezogenen Operationen beispielsweise nach unten gezeigten Verfahren über eine Tabelle der Relationen automatisch in das folgende Statement umgewandelt:This statement, given by a user, is automatically converted into the following statement via a table of relations after the statement resolution step and the completion of missing relationship-related operations, for example, as shown below:
SELECT Firmen.Firrnenname,SELECT companies.
( SELECT Mitarbeiter.Nachname FROM Mitarbeiter(SELECT employee.lastname FROM employee
WHERE Mitarbeiter.MitarbeiterID=Firmen.BetreuerNr) AS Firmen.Betreuer FROM FirmenWHERE employees.employeeID = companies.responsibleNr) AS companies.manages FROM companies
Ist im SELECT- Verarbeitungsbereich ein „*" angegeben, also eine Information, welche besagt, dass alle Tabellenfelder einer bestimmten Tabelle angezeigt werden sollen, wird definiert, dass alle tabellenübergeordneten Wertefelder, welche den Namen dieser Tabelle gefolgt von einem Punkt und einem Tabellenfeldnamen enthalten, ebenfalls in diese *- Position aufgenommen werden:If an "*" is specified in the SELECT processing area, ie information indicating that all table fields of a particular table should be displayed, it is defined that all table-superordinate value fields containing the name of this table followed by a period and a table field name, also be included in this * position:
Um dies zu zeigen, wird ein weiteres tabellenübergeordnetes Wertefeld angelegt:To show this, another table superordinate value field is created:
Define ConnectionField Firmen. AnzahlKontaktpersonen() Count (Distinct Kontaktpersonen.KontaktpersonID)
End DefineDefine ConnectionField companies. NumberContact Persons () Count (Distinct Contacts.ContactID) End Define
Somit wird folgendes, von einem Anwender angegebenes Statement, dessen automatische Umwandlung in einen endgültigen SQL-Code nicht gezeigt wird, in folgendes Statement übergeführt:Thus, the following statement, given by a user whose automatic conversion into a final SQL code is not shown, is translated into the following statement:
Beispiel:Example:
SELECT Firmen.* FROM FirmenSELECT companies. * FROM companies
Wird automatisch übergeführt in und von dieser Basis aus weiter analysiert:Is automatically transferred to and analyzed further from this base:
SELECT Firmen.FirmaID, Firmen.Name, Firmen. Strasse, Firmen.PLZ, Firmen.Land, Firmen.AnzahlMitarbeiter, Firmen.Betreuer, Firmen.AnzahlKontaktpersonen FROM FinnenSELECT companies.companyID, companies.name, companies. Street, Companies.PLZ, Companies.Country, Companies.NumberStaff, Companies.Staff, Companies.NumberContact persons FROM Finns
Ebenso lassen sich alle Kontaktpersonen, deren Firmen von den Mitarbeitern Müller und Meier betreuet werden, wie folgt ermitteln:Likewise, all contact persons, whose companies are supervised by the employees Müller and Meier, can be determined as follows:
Beispiel:Example:
SELECT Kontaktpersonen.*SELECT contact persons. *
WHERE FirmenBetreutVon („Müller,Meier")WHERE FirmenBetreutVon ("Müller, Meier")
Dieses Statement ergibt nach der erfindungsgemäßen Analyse und Umwandlung folgendes endgültiges Statement, welches dem ident oben einem bereits oben gezeigten, endgültigen Statement ist:After the analysis and conversion according to the invention, this statement yields the following final statement, which is identical to a final statement already shown above:
SELECT Firmen.* FROM Firmen, Abteilungen, Kontaktpersonen WHERE Firmen.BetreuerNr DSf (SELECT Companies. * FROM Companies, Departments, Contacts WHERE Companies.AccountantsNo DSf (
SELECT Mitarbeitern)SELECT employees)
FROM MitarbeiterFROM employees
WHERE Nachname IN („Müller'Y'Meier")
)WHERE last name IN ("Müller'Y'Meier") )
AND (Fiπnen.FiπnaID=Abteilungen.FirmaNr) AND (Abteilungen.AbteilungID=Kontaktpersonen.AbteilungNr)AND (Fiπnen.FiπnaID = Departments.CompanyNo) AND (Departments.DepartmentID = Contact Person.DepartmentNo)
Ahnliches kann für das Feld Ort gelten, wenn davon ausgegangen wird, dass das Feld Ort in einer eigenen Tabelle, beispielsweise in der Tabelle Ort_PLZ, steht, in welcher aller PLZ's und die zugehörigen Orte stehen:The same can apply to the field City if it is assumed that the field City is in a separate table, for example in the table City_PLZ, in which all postcodes and the corresponding locations are:
Define ConnectionField Firmen_GetPLZsOfOrt( OfOrt ) SELECT Ort_PLZ.PLZ WHERE OrtJPLZ.Ort IN ( Param:OfOrt ) End DefineDefine ConnectionField Company_GetPLZsOfOrt (OfOrt) SELECT Location_PLZ.PLZ WHERE LocationJPLZ.loc IN (Param: OfOrt) End Define
In diesem Zusammenhang wird auch ein weiteres tabellenübergeordnetes Wertefeld erstellt:In this context, another table-superordinate value field is created:
Define ConnectionField Firmen_GetOrtOfPLZ( OfPLZ ) SELECT Ort_PLZ.Ort WHERE Ort_PLZ .PLZ IN ( ParamOfPLZ ) End DefineDefine ConnectionField Company_GetOrtOfPLZ (OfPLZ) SELECT Location_PLZ.Location WHERE Location_PLZ .PLZ IN (ParamOfPLZ) End Define
Um keine Umformulierung von vorhanden S QL- Statements aufgrund der geänderten Datenstruktur vornehmen zu müssen, kann ein zusätzliches tabellenübergeordnetes Wertefeld Firmen.Ort erstellt werden, welches and seiner einzigen Entscheidungsposition seines inneren, gerichteten Entscheidungsgraphen das tabellenübergeordnete Wertefeld GetOrtOfPLZ() aufruft und als Parameter die PLZ der jeweils aktuellen Firma übergibt:In order not to have to rewrite existing SQL statements due to the changed data structure, an additional table-superordinate value field Firmen.Ort can be created which calls the table-related value field GetOrtOfPLZ () at its single decision position of its inner, directed decision graph and the PLZ as parameter the current company hands over:
Define ConnectionField Firmen. Ort()Define ConnectionField companies. Place()
GetOrtOfPLZ (Firmen.PLZ) End DefineGetOrtOfPLZ (Companies.PLZ) End Define
Somit kann der innere, gerichtete Entscheidungsgraph des tabellenübergeordneten Wertefeldes FirmenMitParametern() folgendermaßen umgeändert werden, ohne bereits
vorhandene SQL-Statements, die dieses tabellenübergeordnete Wertefeld in zumindest einem ihrer Verarbeitungsbereiche verwenden, verändern zu müssen:Thus, the inner, directed decision graph of the table superordinate value field FirmenMitParametern () can be changed as follows, without already existing SQL statements using this table-top value field in at least one of its processing areas need to change:
Defme ConnectionField FirmenMitParametern( Betreuer, Ort, PLZ, CountResults ) IF ParamrBetreuer THEN FirmenBetreutVon (Param:Betreuer)Defme ConnectionField CompaniesWithParameters (Supervisor, City, Postal Code, CountResults) IF ParamrBetreuer THEN FirmenBetreutVon (Param: Supervisor)
IF Param:Ort THEN Firmen.PLZ IN Firmen_GetPLZsOfOrt ( Param:Ort ) IF Param:PLZ THEN Firmen.PLZ IN (ParanrPLZ) IF Param:CountResults THENIF Param: Location THEN Firmen.PLZ IN Firmen_GetPLZsOfOrt (Param: Location) IF Param: Postcode THEN Firmen.PLZ IN (ParanrPLZ) IF Param: CountResults THEN
SELECT Count (Distinct Firmen.FirmalD) ELSESELECT Count (Distinct Companies.FirmalD) ELSE
SELECT Firmen.* END IF End DefmeSELECT companies. * END IF End Defme
Dem zufolge ergibt das folgende SQL-Statement, welches vorstehend in der Beschreibung bereits als Beispiel angegeben wurde, folgendes endgültiges SQL-Statement:Thus, the following SQL statement, which has already been given as an example in the description above, yields the following final SQL statement:
Beispiel : SELECT FirmenOrt,Example: SELECT FirmenOrt,
FirmenMitParametern ( Betreuer="Müller", CountResults ) AS AnzMueller, FirmenMitParametern ( Betreuer="Meier", CountResults ) AS AnzMeierFirmenMitParametern (Supervisor = "Müller", CountResults) AS AnzMueller, FirmenMitParametern (Supervisor = "Meier", CountResults) AS AnzMeier
Dieses Statement wird automatisch aufgrund der vorhandenen tabellenübergeordneten Wertefelder in einem Statement-Auflösungsschritt und nach der Vervollständigung der fehlenden relationenbezogenen Operationen umgewandelt in:This statement is automatically converted into a statement resolution step based on the existing table-superordinate value fields and after completing the missing relationship-related operations:
SELECTSELECT
( SELECT Count (Distinct Firmen.FirmaID) FROM Firmen WHERE Firmen.BetreuerNr IN(SELECT Count (Distinct Company.CompanyID) FROM Companies WHERE Company.TraderNo IN
(SELECT MitarbeiterID FROM Mitarbeiter WHERE Nachname IN („Müller")) AS AnzMueller,(SELECT EmployeeID FROM Employee WHERE Lastname IN ("Miller")) AS AnzMueller,
( SELECT Count(Distinct Firmen.FirmalD) FROM Firmen WHERE Firmen.BetreuerNr IN
(SELECT Mitarbeitern) FROM Mitarbeiter WHERE Nachname IN („Meier")) AS AnzMeier, FROM Firmen(SELECT Count (Distinct Companies.FirmalD) FROM Companies WHERE Companies.TraderNo IN (SELECT employees ) FROM employees WHERE last name IN ("Meier")) AS AnzMeier, FROM companies
GROUP BY ( SELECT OrtJPLZ.Ort FROM Ort_PLZGROUP BY (SELECT city_PLZ.location FROM city_plz
WHERE (Ort_PLZ.PLZ IN ( Firmen.PLZ ) )WHERE (Ort_PLZ.PLZ IN (Firmen.PLZ))
Gleichwertig kann der innere, gerichtete Entscheidungsgraph des tabellenübergeordneten Wertefeldes Firmen. Ort folgende einzige Entscheidungsposition in seinem einzigen Entscheidungspfad aufweisen:Equivalent can be the inner, directed decision graph of the table-superordinate value field Companies. Have the following single decision position in its single decision path:
Define ConnectionField Firmen. Ort()Define ConnectionField companies. Place()
SELECT Ort_PLZ.Ort WHERE (Ort_PLZ.PLZ = Firmen. PLZ)SELECT Ort_PLZ.Orst WHERE (Ort_PLZ.PLZ = Companies Postcode)
End DefineEnd Define
Wie bereits beschrieben, sind tabellenübergeordnete Wertefelder allen in einer Datenstruktur vorhandenen Tabellen übergeordnet. Dies bedeutet, dass sämtliche Tabellen und sämtliche Mengen auf jedes tabellenübergeordnete Wertefeld aus der Gesamtheit der tabellenübergeordneten Wertefelder zugreifen und in SQL-Statements verwenden können.As already described, table-superordinated value fields are superior to all tables present in a data structure. This means that all tables and all sets can access each table-superordinate value field from the set of table-superordinate value fields and use it in SQL statements.
Um dies konkret mit einem einfachen Beispiel zu zeigen, wird folgendes tabellenübergeordnetes Wertefeld erstellt:To illustrate this with a simple example, the following table-superordinate value field is created:
Define ConnectionField AnzahlVeranstaltungen(Zeitraum, Betreuer,AktVeranstaltungStatus) IF Param:Zeitraum THEN Veranstaltungen. V ADatum=Param:Zeitraum IF Param:Betreuer THEN Firmen.Betreuer IN (Param:Betreuer) IF Param:AktVeranstaltungStatus THENDefine ConnectionField Number of events (time period, supervisor, ActEventStatus) IF Param: Period THEN Events. V ADatum = Param: Period IF Param: Supervisor THEN Company Supervisor IN (Param: Supervisor) IF Param: Act EventStatus THEN
Last(ZustatzStatiArten.Bezeichnung)=Param:AktVeranstaltungStatus END IFLast (auxiliary status code) = Param: AktVeranstaltungStatus END IF
Count (Distinct Veranstaltungen.VeranstaltungID) End Define
Somit ist die Angabe des folgenden Statements durch einen Anwender möglich, welches die Frage beantwortet, auf wie vielen unterschiedlichen Veranstaltungen um Jahr 2006 ein jeweiliger Artikel verkauft wurde:Count (Distinct Events. Event ID) End Define Thus the indication of the following statement by a user is possible, which answers the question on how many different events around year 2006 a respective article was sold:
SELECT Artikel.*, AnzahlVeranstaltungen(Zeitraum=2006)SELECT article. *, Number of events (period = 2006)
Wie bereits beschrieben, stellt ein Algorithmus fest, dass in der Hierarchiestufe des Verarbeitungsbereichs, in welchem das tabellenübergeordnete Wertefeld verwendet wird, die einzig die Tabelle Artikel angegeben ist. Das tabellenübergeordnete Wertefeld liefert in seinem Ergebnis eine Verarbeitungsinformation, welche sich auf die Tabelle Veranstaltungen bezieht, zurück. Demnach wird das tabellenübergeordnete Wertefeld also beispielsweise als SUB-SELECT eingefügt:As already described, an algorithm determines that in the hierarchy level of the processing area in which the table-superordinate value field is used, only the article table is specified. The table-superordinated value field returns in its result processing information which relates to the table Events. Thus, the table-superordinate value field is inserted, for example, as a SUB-SELECT:
Somit wird dieses von einem Anwender erstellte Statement in einem Statement- Auflösungsschritt in folgendes Statement umgewandelt in:Thus, this statement created by a user is transformed in a statement resolution step into the following statement in:
SELECT Artikel.*,SELECT Article. *,
( SELECT Count (Distinct Veranstaltungen. VeranstaltungID) WHERE Veranstaltungen. VADatum BETWEEN #01.01.2006# AND #31.12.2006#(SELECT Count (Distinct Events EventID) WHERE Events VADdate BETWEEN # 01.01.2006 # AND # 31.12.2006 #
))
AS AnzahlVeranstaltungenAS number of events
Im Statement-Auflösungsschritt kann erkannt werden, dass der Parameter Zeitraum den Wert 2006 enthält und dass dieser Wert kein Datum sondern ein Jahr darstellt. Entsprechend die Entscheidungsposition Veranstaltungen. VADatum=2006 umgewandelt werden in Veranstatlungen. V ADatum BETWEEN #01.01.2006# AND #31.12.2006# in diesen Wert als Teil des Ergebnisses des Durchlaufes von AnzahlVeranstaltungen liefern.In the statement resolution step, it can be recognized that the parameter period contains the value 2006 and that this value does not represent a date but a year. Accordingly, the decision-making events. VADatum = 2006 will be transformed into events. V ADatum BETWEEN # 01.01.2006 # AND # 31.12.2006 # into this value as part of the result of the run of number events.
Ein einfacher Algorithmus kann erkennen, dass relationenbezogene Operationen zwischen der Tabelle Artikel und der Tabelle Veranstaltungen fehlen. Diese können mithilfe einer Tabelle der Relationen in einem neuen Statement eingefügt werden, womit sich folgendes endgültiges Statement ergibt:
SELECT Artikel.*,A simple algorithm can detect that relational operations are missing between the Articles table and the Events table. These can be inserted into a new statement using a table of relations, resulting in the following final statement: SELECT Article. *,
( SELECT Count (Distinct Veranstaltungen. VeranstaltungID) FROM Rechnungspositionen, Rechnungen, Veranstaltungen WHERE Artikel.ArtikellD^Rechnungspositionen.ArtikelNr AND Rechnungspositionen.RechnungNr=rRechnungen.RechnungID(SELECT Count (Distinct Events. EventID) FROM Invoice Items, Invoices, Events WHERE Items.ArticleD ^ Invoice Items.ArticlesNo AND Invoice Items.CalculationNo = r Invoices.CalculationID
AND Veranstaltungen.RechnungNr^Rechnungen.RechnunglD AND Veranstaltungen. VADatum BETWEENAND events.number ^ invoices.calculation AND events. VADatum BETWEEN
#01.01.2006# AND #31.12.2006# ) AS AnzahlVeranstaltungen FROM Artikel# 01.01.2006 # AND # 31.12.2006 #) AS NumberEvents FROM Article
Ebenso kann auch das folgende Statement einfach von einem Anwender formuliert werden, um folgende Frage zu stellen:Likewise, the following statement can simply be formulated by a user to ask the following question:
SELECT Artikel.*,SELECT Article. *,
AnzahlVeranstaltungen(Zeitraum=2006,Betreuer="Müller") AS Müller2006 AnzahlVeranstaltungen(Zeitraum=2005,Betreuer="Müller") AS Müller2005NumberEvents (period = 2006, supervisor = "Müller") AS Müller2006 NumberEvents (period = 2005, supervisor = "Müller") AS Müller2005
Nach dem Statement- Auflösungsschritt ergibt sich automatisch das folgende Statement:After the statement-resolution step, the following statement automatically follows:
SELECT Artikel.*,SELECT Article. *,
( SELECT Count (Distinct Veranstaltungen. VeranstaltungID) WHERE Veranstaltungen. VADatum BETWEEN #01.01.2006# AND #31.12.2006# AND ( SELECT Mitarbeiter.Nachname WHERE Mitarbeiter.MitarbeiterID =Firmen.BetreuerNr )(SELECT Count (Distinct Events Event ID) WHERE Events VADdate BETWEEN # 01.01.2006 # AND # 31.12.2006 # AND (SELECT Employee.Names WHERE Employee.Employee ID = Company.OrganizerNo)
= „Müller" )= "Müller")
))
AS Müller2006,AS Müller2006,
( SELECT Count (Distinct Veranstaltungen. VeranstaltungID) WHERE Veranstaltungen. VADatum BETWEEN #01.01.2005# AND #31.12.2005#(SELECT Count (Distinct Events Event ID) WHERE Events VADdate BETWEEN # 01.01.2005 # AND # 31.12.2005 #
AND ( SELECT Mitarbeiter.NachnameAND (SELECT employee.lastname
WHERE Mitarbeiter.MitarbeiterID =Firmen.BetreuerNr ) = „Müller" ) )
AS Müller2005WHERE employee.employeeID = company.careerNo) = "miller")) AS Müller2005
Der nun nachfolgende Schritt, in welchem festgestellt wird, dass in diesem automatisch erzeugten Statement die relationenbezogenen Operationen unvollständig sind, vervollständigt dieses Beispiel um die relationenbezogenen Operationen nach dem unten gezeigten Verfahren. Das endgültige Statement wird aufgrund seiner immensen Länge nicht gezeigt. Es wird nur der erste Analyse-Schritt gezeigt, in welchem der Algorithmus erkennt, dass in der ersten Hierarchiestufe die Tabelle Artikel verwendet wird und in der jeweils zweiten und dritten Hierarchiestufe (die beiden SUB-SELECTS Müller 2006 und Müller2005) die Tabellen Veranstaltungen, Mitarbeiter und Firmen vorhanden sind. Die relationalen Verbindungen zwischen diesen Tabellen werden automatisch unter Berücksichtigung der jeweiligen Hierarchiestufen mittels des unten gezeigten Verfahrens eingefugt, womit ein endgültiges, von einer SQL-Engine analysierbares, optimierbares und verarbeitbares SQL- Statement automatisch zur Verfügung gestellt wird.The following step, in which it is determined that the relationship-related operations are incomplete in this automatically generated statement, completes this example by the relation-related operations according to the method shown below. The final statement is not shown due to its immense length. Only the first analysis step is shown, in which the algorithm recognizes that the table Articles is used in the first hierarchy level and the tables Events, Employees in the second and third hierarchy levels (the two SUB-SELECTS Müller 2006 and Müller2005) and companies are present. The relational connections between these tables are automatically inserted taking into account the respective hierarchy levels by means of the method shown below, whereby a final, optimizable and processable SQL statement that can be analyzed by a SQL engine is automatically made available.
Ein Anfrage-SQL-Statement, welches die Datentabelle Kontaktpersonen als tabellenübergeordnetes Wertefeld mit dem Parameter Nachname="Müller" und dem gewünschten Ergebnis die Verarbemmgsfunktion Count liefert ist folgendes:A request SQL statement which supplies the data table contact persons as a table-superordinated value field with the parameter last name = "miller" and the desired result the count function function Count is the following:
SELECT Firmen.Firmenname, Firmen.Kontaktpersonen.Nachname="Müller".CountSELECT companies.company name, companies.contacts.lastname = "miller" .count
Dieses Anwender-SQL-Satement wird mittels des Auflösungsschritts und des Vervollständigungsschrittes in folgendes endgültiges SQL-Statement umgewandelt:This user SQL statement is converted into the following final SQL statement by means of the resolution step and the completion step:
SELECT Firmen.Firmenname, Firmen.Kontaktpersonen.CountSELECT companies.company name, companies.contacts.count
SELECT Firmen.Firmenname, (SELECT Count(*) FROM Kontaktpersonen) FROM FirmenSELECT companies.company name, (SELECT count (*) FROM contact persons) FROM companies
Weitere Beispiele, welche tabellenübergeordnete Wertefelder in komplexen Kombinationen enthalten:Further examples containing table-parent value fields in complex combinations:
Alle Firmen aus Orten, in denen es mehr als 100 Firmen gibt und alle Firmen, in deren PLZ es mehr als 10 Firmen gibt.
Dieses Statement kann vermittels des erweiterten SQL-RTN folgendermaßen einfach angegeben und automatisch aufgelöst und in ein gültiges SQL-Statement nach dem Stand der Technik umgewandelt werden:All companies from places where there are more than 100 companies and all companies where there are more than 10 companies in the postcode. This statement can be easily specified and automatically resolved using advanced SQL RTN as follows, and converted to a valid state-of-the-art SQL statement:
Beispiel:Example:
SELECT Firmen.*SELECT companies. *
WHERE (Firmen.Ort.AnzahlFirmen()>100) OR (Firmen.PLZ.AnzahlFirmen()>10)WHERE (Companies.Ort.NumberCompanies ()> 100) OR (Companies.PLZ.NumberCompanies ()> 10)
Im Statement-Auflösungsschritt wird folgendes Statement ohne relationenbezogene Operationen automatisch generiert:In the statement resolution step, the following statement is automatically generated without relationship-based operations:
SELECT Firmen.* WHERE ( (Firmen.PLZ IN (SELECT companies. * WHERE ((companies.plz IN (
SELECT Ort_PLZ WHERE Ort_PLZ.Ort IN (SELECT Location_PLZ WHERE Location_PLZ.Location IN (
SELECT Sub_Ort_PLZ.Ort WHERE Sub_Firmen.PLZ=Sub_Ort_PLZ.PLZ GROUP BY Sub_Ort_PLZ.Ort HAVING Count(*) > 100 )SELECT Sub_Ort_PLZ.Location WHERE Sub_Firmen.PLZ = Sub_Ort_PLZ.PLZ GROUP BY Sub_Ort_PLZ.Location HAVING Count (*)> 100)
))
OR (Firmen.PLZ IN (OR (Firmen.PLZ IN (
SELECT Sub_Firmen.PLZSELECT Sub_Company.plz
GROUP BY Sub_Firmen.PLZ HAVING Count(*) > 10GROUP BY Sub_Companies.PLZ HAVING Count (*)> 10
))
Dieses Statement wird in einem nachfolgenden Schritt um die fehlenden relationenbezogenen Operationen automatisch zum Beispiels vermittels einer Tabelle der Relationen und nach dem unten gezeigten Verfahren automatisch ergänzt, wodurch sich dieses neue, endgültige SQL- Statement ergibt:This statement is automatically updated in a subsequent step around the missing relation-related operations automatically, for example by means of a table of relations and following the procedure shown below, resulting in this new, definitive SQL statement:
SELECT Firmen.* FROM Firmen WHERE ( (Firmen.PLZ IN (
SELECT Ort_PLZ FROM Ort_PLZ WHERE Ort_PLZ.Ort IN (SELECT Companies. * FROM Companies WHERE ((Companies.PLZ IN ( SELECT City_PLZ FROM City_PLZ WHERE City_PLZ.Location IN (
SELECT Sub_Ort_PLZ.Ort FROM Firmen AS Sub_Firmen, Ort__PLZ AS Sub_Ort_PLZSELECT Sub_Ort_PLZ.Ort FROM Companies AS Sub_Companies, City__PLZ AS Sub_Ort_PLZ
WHERE Sub_Firmen.PLZ=Sub_Ort_PLZ.PLZWHERE Sub_Firmen.PLZ = Sub_Ort_PLZ.PLZ
GROUP BY Sub_Ort_PLZ.OrtGROUP BY Sub_Ort_PLZ.Location
HAVING Count(*) > 100HAVING Count (*)> 100
) ))
OR (Firmen.PLZ IN (OR (Firmen.PLZ IN (
SELECT Sub_Firmen.PLZ FROM Firmen AS SubJFirmen GROUP BY Sub_Firmen.PLZ HAVING Count(*) > 10SELECT Sub_Firmen.PLZ FROM Companies AS SubJFirmen GROUP BY Sub_Companies.PLZ HAVING Count (*)> 10
))
Der Algorithmus, welcher die relationenbezogenen Operationen unter Berücksichtigung der Hierarchiestufen und der Tabelle der Relationen automatisch in einem neuen, endgültigen SQL-Statement einfügt, bekommt durch die Information „Sub_" & Tabellenname dieThe algorithm, which automatically inserts the relationship-related operations in a new, final SQL statement, taking into account the hierarchy levels and the table of relations, is given the information by the information "Sub_" & table name
Information mitgeliefert, dass diese Tabelle, obwohl sie in der übergeordneten Hierarchiestufe bereits verwendet wird, keine Relationen zu der übergeordneten Hierarchiestufe herstellen darf.Information provided that this table, although it is already used in the higher hierarchical level, must not establish relations to the higher hierarchical level.
Eine weitere Anwendungsform der erfindungsgemäßen tabellenübergeordneten Wertefelder mittels des erweiterten SQL-RTN ist, Tabellen, welche beispielsweise mittels eines Punkt auf eine Tabelle oder ein Tabellenfeld folgen, als tabellenübergeordneten Wertefeld zu abstrahieren und dieses entsprechend in einem Statement-Auflösungsschritt umzuwandeln:Another application of the table superordinate value fields according to the invention by means of the extended SQL RTN is to abstract tables, which follow, for example, by means of a point on a table or a table field, as a table-superordinate value field and to convert this accordingly into a statement resolution step:
Um dies anhand von Beispielen zu verdeutlichen, wird ein weiteres tabellenübergeordnetes Wertefeld definiert und somit der Gesamtheit der tabellenübergeordneten Wertefelder hinzugefügt:In order to illustrate this with examples, another table-superordinate value field is defined and thus added to the totality of the table-superordinate value fields:
Define ConnectionField Umsatz(Zeitraum, Verkaeufer, Netto)
IF Param:Zetiraum THENDefine ConnectionField sales (period, seller, net) IF Param: Room THEN
Veranstaltungen. VADatum = Param:Zeitraum END IFEvents. VADatum = Param: Period END IF
IF Param:Verkaeufer THEN Firmen.Betreuer IN (Param: Verkaeufer)IF Param: Salesman THEN Companies. Manager IN (Param: Salesman)
END IF IF ParamNetto THENEND IF IF ParamNetto THEN
SUM (Rechnungspositionen.Betrag) ELSE SUM (Rechnungspositionen.Betrag* Artikel.MwSt)SUM (Invoice items. Amount) ELSE SUM (Invoice items. Amount * Item.MwSt)
END IF End DefineEND IF End Define
Hiermit ist die folgende Fragestellung einfach zu beschreiben: Alle Firmen, deren Umsatz je Kontaktperson im Jahr 2006 mehr als 1000 Euro betragen hat.Hereby, the following question is easy to describe: All companies whose turnover per contact person in the year 2006 amounted to more than 1000 Euro.
Beispiel:Example:
SELECT Firmen.*SELECT companies. *
WHERE ALL Firmen.Kontaktpersonen.Umsatz(Zeitraum=2006) > 1000WHERE ALL Companies.Contact persons.Usage (period = 2006)> 1000
Dieses Statement kann mittels eines einfachen Algorithmus in einem Statement-Auflösungs- Teilschritt, welcher gezeigt wird, um die Übersicht zu wahren und den Focus auf das wesentliche zu richten, umgewandelt werden in:This statement can be transformed by a simple algorithm into a statement-resolution sub-step, which is shown to maintain the overview and focus on the essential:
SELECT Firmen.*SELECT companies. *
WHERE ( SELECT Count(Kontaktpersonen.KontaktρersonΙD) )WHERE (SELECT Count (Contacts.ContactρersonΙD))
( SELECT Count (Kontaktpersonen.KontaktpersonID) WHERE Umsatz(Zeitraum=2006)>l 000(SELECT Count (Contact Persons.ContactID) WHERE Sales (Period = 2006)> 1,000
))
Ausgehend von diesem Statement wird der Statement- Auflösungsschritt weiter angewandet, wodurch sich ein endgültig verarbeitbares SQL-Statement nach dem Stand der Technik ergibt.
Dieser Statement-Auflösungsschritt sowie der nachfolgende Schritt, in welchem die relationenbezogenen Operationen in einem neuen Statement eingefugt werden, wurde bereits vielfach gezeigt und wird daher an dieser Stelle nicht mehr ausgeführt.Based on this statement, the statement resolution step is further applied, resulting in a final processable SQL statement according to the prior art. This statement resolution step as well as the subsequent step, in which the relationship-related operations are inserted in a new statement, has already been shown many times and is therefore no longer executed here.
Äquivalent können auch alle Firmen gezeigt werden, bei welchen zumindest eine Kontaktperson einen Umsatz von mehr als 1000 Euro im Jahr 2006 erzielt wurde:Equally, all companies can be shown, in which at least one contact person achieved a turnover of more than 1000 euros in 2006:
Beispiel: SELECT Firmen.*Example: SELECT companies. *
WHERE ANY Firmen.Kontaktpersonen.Umsatz(Zeitraum=2006) > 1000WHERE ANY Companies.Contact persons.Usage (period = 2006)> 1000
Dieses Statement wird in einem Statement-Teilauflösungsschritt automatisch umgewandelt in: SELECT Firmen.* WHEREThis statement is automatically converted into a statement subresolution step in: SELECT companies. * WHERE
( SELECT Count (Kontaktpersonen.KontaktpersonlD) WHERE Umsatz(Zeitraum=2006)>1000(SELECT Count (contact persons.contact) WHERE turnover (period = 2006)> 1000
) > 1)> 1
Dem gleichen Prinzip folgend kann auch eine Fragestellung, die alle Firmen, in denen zumindest zwei Kontaktpersonen oder alle bis auf zumindest eine Kontaktperson im Jahr 2006 einen Umsatz von mindestens 1000 Euro erreicht haben, zeigen soll, einfach von einem Anwender formuliert werden:Following the same principle, a question that all companies in which at least two contact persons or all but at least one contact person have achieved a turnover of at least 1000 euros in 2006 can easily be formulated by a user:
Beispiel :Example:
SELECT Firmen.*SELECT companies. *
WHERE ANY (>=2) Firmen.Kontaktρersonen.Umsatz(Zeitraum=2006) > 1000WHERE ANY (> = 2) companies.Contact person.set (period = 2006)> 1000
Beispiel: SELECT Firmen.*Example: SELECT companies. *
WHERE ALL (<1) Firmen.Kontaktpersonen.Umsatz(Zeitraum=2006) > 1000
Nachfolgendes Beispiel liefert die Anzahl Kontaktpersonen je Ort, indem die Datentabellen Kontaktpersonen als tabellenübergeordnetes Wertefeld für das aggregierte Tabellenfeld Firmen.Ort abstrahiert wird.WHERE ALL (<1) Companies.Contact persons.Usage (period = 2006)> 1000 The following example shows the number of contact persons per location by abstracting the contact's data tables as a table-topped value field for the aggregated Company.Order table field.
Beispiel:Example:
SELECT Firmen. Ort.Kontaktpersonen.CountSELECT companies. Ort.Kontaktpersonen.Count
Dieses Statement erkennt in einem ersten Schritt die Gruppierung nach dem Tabellenfeld Firmen. Ort gefordert ist. Gleichermaßen wird die Tabelle Kontaktpersonen mit dem Parameter .Count als tabellenübergeordnetes Wertefeld erkannt und entsprechend aufgelöst:This statement recognizes in a first step the grouping according to the table field Companies. Location is required. Likewise, the Contact Persons table is recognized as a table-topped value field with the parameter .Count and resolved accordingly:
SELECT Firmen.Ort,SELECT companies.location,
( SELECT Count(Kontaktpersonen.* ) ) AS KontaktpersonenCount(SELECT Count (contact persons. *)) AS Contact personsCount
Das nun zur Verfügung stehende Statement wird nun um die fehlenden relationenbezogenen Operationen für die jeweilige Datenstruktur vervollständigt und ergibt somit folgendes endgültiges Statement:The now available statement is now completed by the missing relationship-related operations for the respective data structure and thus gives the following final statement:
SELECT Firmen.Ort, ( SELECT Count(Kontaktρersonen.*)SELECT companies.location, (SELECT Count (contact persons. *)
FROM Sub_Firmen, Abteilungen, Kontaktpersonen WHERE (Firmen.Ort=Sub_Firmen.Ort)FROM Sub_Companies, Departments, Contacts WHERE (Company.location = sub_company.location)
AND (Sub_Firmen.FirmaID=Abteilungen.FirmaNr) AND (Abteilungen.AbteilungID=Kontaktpersonen.AbteilungNr) FROM FirmenAND (Sub_Company.CompanyID = Departments.CompanyNo) AND (Departments.DepartmentID = Contact Person.DepartmentNo) FROM Companies
GROUP BY FirmenOrtGROUP BY FirmenOrt
Entsprechend sind auch sämtliche Kombinationen der gezeigten tabellenübergeordneten Wertefelder möglich:Correspondingly, all combinations of the tabular value fields shown are also possible:
SELECT Firmen.*
WHERE (Firmen.Ort.Firmen.Count>100) AND Firmen.Kontaktpersonen.Abteilungname="Marketing".CountSELECT companies. * WHERE (Companies.Ort.Companies.Count> 100) AND Companies.Contact persons.Department name = "Marketing" .Count
Soll der Umsatz von jeden Orten gezeigt werden, in denen je Kontaktpersonen der Firma im Jahr 2006 im Schnitt 1000 Euro Umsatz erzielt wurde, so ist dies folgender maßen zu beschreiben:If the turnover is to be shown from every place in which the contact persons of the company received an average of 1000 Euro turnover in 2006, this is to be described as follows:
Beispiel : SELECT Firmen.Ort, Unsatz()Example: SELECT companies.location, default ()
WHERE AVG (Firmen.OitKontaMpersonen.Umsatz(Zei1xaum=2006) )>1000WHERE AVG (Companies.OitContact Persons. Rate (Zei1xaum = 2006))> 1000
Dieses Statement wird nach der Anwendung des Auflösungsschrittes in nachfolgendes SQL- Statement, welche keine relationenbezogenen Operationen enthält, umgewandet und in einem weiteren Schritt um die fehlenden relationenbezogenen Operationen erweitert. Die Auflösung des tabellenübergeordneten Wertefeldes Firmen. Ort wird nicht in diesem Schritt gezeigt, um den Focus des Beispiels auf das Wesentliche zu richten.This statement will be changed after applying the resolution step in subsequent SQL statement, which contains no relation-related operations, and extended in a further step to the missing relationship-related operations. The resolution of the table-superordinate value field Companies. Place is not shown in this step to focus the example.
SELECT Firmen.Ort, (Sum (Rechnungspositionen.Positionsbetrag) ) AS Umsatz WHERE AVG (SELECT companies.location, (sum (invoice items.position item)) AS sales WHERE AVG (
SELECT SUM (Rechnungspositionen.Positionsbetrag)SELECT SUM (Invoice items.Position amount)
WHERE Veranstaltungen. VADatum BETWEEN #01.01.2006# AND #31.12.2006#WHERE events. VADatum BETWEEN # 01.01.2006 # AND # 31.12.2006 #
GROUP BY Veranstaltungen.KontaktpersonNrGROUP BY Events.Contact personNo
) > 1000 GROUP BY Firmen.Ort)> 1000 GROUP BY companies.location
Es wird erkannt, dass eine Verbindung von der Gruppierung Firmen.Ort zu der Tabelle Kontaktpersonen hergestellt werden soll und von der Tabelle Kontaktpersonen aus die Summe des Tabellenfeldes Rechnungen.Rechnungsposition berechnet werden soll. Durch den dem tabellenübergeordneten Wertefeld Umsatz() mitgegebenen Parameter Zeitraum=2006 wird ebenfalls erkannt, dass ein Kriterium Veranstaltungen.V ADatum BETWEEN #01.01.2006# AND #31.12.2006# einzufügen ist. Die Gruppierung nach dem Feld Veranstaltungeii.KontaktpersonNr wird dadurch automatisch erkannt, dass, beispielsweise anhand einer Tabelle der Relationen, die Verbindung der Tabelle Kontaktpersonen zu der
Tabelle Veranstaltungen über die beiden Schlüsselfelder Kontaktpersonen.KontaktpersonID und Veranstaltungen.KontaktpersonNr zu generieren ist. Weiters erkennt ein einfacher Algorithmus, dass das Ergebnis des automatisch eingefügten SUB-SELECTS SELECT Sum (Rechnungspositionen.PositionsbetraR) ... im in der Hierarchiestufe übergeordneten Statement mittels AVG je Ort berechnet werden soll.It is recognized that a connection is to be made from the Companies.Ort group to the Contact Persons table, and from the Contact Persons table to calculate the sum of the Invoice.Calculate Items table field. The parameter Period = 2006, which was entered in the table superordinate value field Sales (), also recognizes that a criterion Events.V ADatum BETWEEN # 01.01.2006 # AND # 31.12.2006 # must be inserted. The grouping after the field EventEnter.ContactNumber is automatically recognized by the fact that, for example, based on a table of relations, the connection of the table Contact persons to the Table events about the two key fields contact persons.Contact personID and events.Contact person is to generate. Furthermore, a simple algorithm recognizes that the result of the automatically inserted SUB-SELECTS SELECT Sum (invoice positions.PositionBetraR) ... in the hierarchical level statement is to be calculated by means of AVG per location.
Somit ergibt sich nach der vollständigen Auflösung des übergeordneten Wertefeldes Firmen. Ort und der automatischen Vervollständigung des Statements um die fehlenden relationenbezogenen Operationen das folgende endgültige, dem SQL-Standard entsprechende Statement:Thus results after the complete dissolution of the higher value field companies. Location and automatically completing the statement around the missing relationship-related operations, the following final statement that complies with the SQL standard:
SELECTSELECT
( SELECT Ort_PLZ.Ort FROM Ort_PLZ WHERE Firmen.PLZ=Ort_PLZ.PLZ ) AS Ort,(SELECT Location_PLZ.Location FROM City_PLZ WHERE Company.PLZ = City_PLZ.PLZ) AS Location,
( SELECT Sum (Rechnungspositionen.Positionsbetrag) FROM Veranstaltungen, Rechnungen, Rechnungspositionen WHERE Kontaktpersonen.KontaktpersonID=Veranstaltungen.KontaktpersonNr(SELECT Sum (Invoice Items.Position Amount) FROM Events, Invoices, Invoice Items WHERE Contacts.Contact PersonID = Events.Contact PersonNo
AND Veranstaltungen. VeranstaltungID=Rechnungen.VeranstaltungNr AND Rechnungen.RechnungID=Rechnungspositionen.RechnungNrAND events. EventID = Invoice.OperationNo AND Invoices.CalculationID = Invoice Items.CountNo
GROUP BY Veranstaltungen.KontaktpersonNr ) AS AVG_Kontaktperson_Umsatz FROM Firmen, Abteilungen, Kontaktpersonen WHERE Firmen.FirmaID=Abteilungen.FirmaNr AND Abteilungen.AbteilungID=Kontaktpersonen.AbteilungNrGROUP BY Events.Contact PersonNo) AS AVG_Contact Person_Sales FROM Companies, Departments, Contacts WHERE Companies.CompanyID = Departments.CompanyNo AND Departments.DepartmentID = Contact Persons.DepartmentNo
GROUP BYGROUP BY
( SELECT Ort_PLZ.Ort FROM Ort_PLZ WHERE Firmen.PLZ=Ort_PLZ.PLZ ) HAVING AVG ((SELECT city_plz.location FROM city_plz WHERE companies.plz = city_plz.plz) HAVING AVG (
SELECT SUM (Rechnungspositionen.Positionsbetrag) FROM Veranstaltungen, Rechnungen, RechnungspositionenSELECT SUM (invoice items.position item) FROM events, invoices, invoice items
WHERE Kontaktpersonen.KontaktpersonID:=Veranstaltungen.KontaktpersonNr AND Veranstaltungen. VeranstaltungID:=Rechnungen.VeranstaltungNr AND Rechnungen.RechnungID=Rechnungspositionen.RechnungNr AND Veranstaltungen. VADatum BETWEEN #01.01.2006# AND #31.12.2006#
GROUP BY Veranstaltungen.KontaktpersonNr ) > 1000WHERE Contact persons.Contact personID : = Events.Contact personNr AND events. Event ID : = Invoice.OperationNo AND Invoices.AccountID = Invoice Items.CalculationNo AND Events. VADatum BETWEEN # 01.01.2006 # AND # 31.12.2006 # GROUP BY Events.Contact personNo)> 1000
Da im Verarbeitungsbereich WHERE des vorhandenen SQL-Statements eine Verarbeitungsfunktion (AVG) enthalten ist, wird erkannt, dass diese Verarbeitungsfunktion in den HA VING- Verarbeitungsbereich verschoben werden muss.Since there is a processing function (AVG) in the processing area WHERE of the existing SQL statement, it is recognized that this processing function must be moved to the HA VING processing area.
Es sei wiederholt, dass es der Vorteil der tabellenübergeordneten Wertefelder, insbesondere in Kombination mit der automatischen Vervollständigung von relationenbezogenen Operationen, einerseits eine wesentlich kürzere und vor allem einfachere Schreibweise ermöglicht und ebenfalls auch eine bestmögliche Unabhängigkeit von der zugrunde liegenden Datenstruktur ermöglicht. Somit würde dieses, wie sämtliche andere gezeigten Beispiele auch, aufgrund anderer innerer gerichteter Entscheidungsgraphen von tabellenübergeordneten Wertefeldern und/oder aufgrund einer unterschiedlich befüllten Tabelle der Relationen ein anderes, auf die jeweilige Datenstruktur angepasstes, endgültiges SQL-Statement automatisch ergeben.It should be repeated that the advantage of the table-superordinated value fields, in particular in combination with the automatic completion of relation-related operations, on the one hand enables a much shorter and, above all, simpler notation, and also enables the best possible independence from the underlying data structure. Thus, like all other examples shown, this would automatically result in a different final SQL statement adapted to the particular data structure due to other inner-directed decision graphs of table-superordinate value fields and / or due to a differently populated table of relations.
Ein konkretes, aufgrund der insgesamten Länge desselben nicht aufgelöstes und um relationenbezogene Operationen vervollständigtes Beispiel lautet wie folgt:A concrete example, unresolved by the total length of the same and completed by relation-related operations, is as follows:
Liefere folgende Informationen je Ort:Provide the following information per location:
- Durchschnittsumsatz des Verkäufers Müller in diesem Ort- Average sales of the seller Müller in this place
- Durchschnittsumsatz des Verkäufers Müller aller PLZ's in diesem Ort - Durchschnittsumsatz des Verkäufers Müller aller Firmen in diesem Ort- Average sales of the seller Müller of all postcodes in this place - Average sales of the seller Müller of all companies in this place
- Durchschnittsumsatz des Verkäufers Müller aller Abteilungen in diesem Ort- Average sales of the seller Müller of all departments in this place
- Durchschnittsumsatz des Verkäufers Müller aller Kontaktpersonen in diesem Ort- Average sales of the seller Müller of all contact persons in this place
- Durchschnittsumsatz des Verkäufers Müller aller Veranstaltungen in diesem Ort- Average sales of the seller Müller all events in this place
- Anzahl der Veranstaltungen im Jahr 2006 in diesem Ort - Durchschnittliche Anzahl der Veranstaltungen im Jahr 2006 aller PLZ dieses Ortes- Number of events in 2006 in this place - Average number of events in 2006 all postcode of this place
- Durchschnittliche Anzahl der Veranstaltungen im Jahr 2006 aller Firmen dieses Ortes- Average number of events in 2006 of all companies of this place
Beispiel :Example:
SELECT Firmen.Ort,
AVG ( Umsatz(Verkaeufer="Müller") ) AS AVG_Ort Firmen.PLZ.AVG ( Umsatz(Verkaeufer="Müller") ) AS AVG_PLZ Firmen. AVG ( Umsatz(Verkaeufer="Müller") ) AS AVG_Firma AbteilungenΛVG ( Umsatz(Verkaeufer=="Müller") ) AS AVG_Abteilung Kontaktpersonen.AVG (Umsatz(Verkaeufer="Müller") ) AS AVG_KontaktpersonSELECT companies.location, AVG (Turnover (seller = "Müller")) AS AVG_Ort Firmen.PLZ.AVG (Turnover (seller = "Müller")) AS AVG_PLZ Companies. AVG (turnover (seller = "Müller")) AS AVG_company departmentsΛVG (turnover (seller == "Müller")) AS AVG_department contact persons.AVG (turnover (seller = "Müller")) AS AVG_contact person
Veranstaltungen.AVG ( Umsatz(Verkäufer="Müller") ) AS AVG_Veranstaltung AnzahlVeranstaltungen (Zeitraum=2006) AS Ort_AnzVA_2006 AVG (Firmen.PLZ.AnzahlVeranstaltungen (Zeitraum=2006) ) AS PLZ_AnzVA_2006 AVG (Firmen.AnzahlVeranstaltungen (Zeitraum=2006) ) AS Firma_AnzVA_2006Veranstaltungen.AVG (Turnover (Seller = "Müller")) AS AVG_Veranstaltung NumberEvents (period = 2006) AS Ort_AnzVA_2006 AVG (Firmen.PLZ.AnzahlVeranstaltungen (period = 2006)) AS ZIP_AnzVA_2006 AVG (Firmen.AnzahlVeranstaltungen (period = 2006)) AS Firma_AnzVA_2006
Um nochmals die Unabhängigkeit der tabellenübergeordneten Wertefelder von den in einem Anwender-SQL-Statement angegebenen Tabellen zu zeigen, wird ein einfaches Anwender- SQL-Statement erzeugt: Dieses Statement liefert den insgesamten Umsatz je Artikel und den Umsatz j e Artikel im Jahr 2005.To show once again the independence of the table-superordinate value fields from the tables specified in a user SQL statement, a simple user SQL statement is generated: This statement provides the total sales per article and the turnover per article in 2005.
SELECT Artikel.*, Umsatz(), Umsatz(Zeitraum=2005)SELECT Article. *, Sales (), Sales (period = 2005)
Es lassen sich einfach durch die Verkettung mittels Punkt ebenfalls Parameter zu einem tabellenübergeordneten Wertefeld mitgeben, wie das nachfolgende Beispiel verdeutlichen soll:It is also easy to pass parameters to a table-superordinate value field through the concatenation by means of a dot, as the following example illustrates:
Liefere die Anzahl aller Firmen, die im Land Österreich liegen, in den Orten „St. Polten", die Anzahl aller Firmen in den PLZs 1010 bis 1090, die Anzahl aller Firmen mit einem Umsatz von über 1000 Euro im Jahr 2006 und die Anzahl aller Firmen mit mehr als fünf Kontaktpersonen:Deliver the number of companies that are in the country Austria in the places "St. Polten ", the number of companies in the postal codes 1010 to 1090, the number of companies with a turnover of more than 1000 euros in 2006 and the number of companies with more than five contact persons:
SELECT AnzahlFirmen().Ort = „St. Polten" AS AnzFirmen StPoelten,SELECT Number Companies (). Location = "St. Polten "AS companies, StPoelten,
AnzahlFirmen().PLZ BETWEEN 1010 AND 1090 AS AnzFirmen_1010_1090, AnzahlFirmen().Umsatz(Zeitraum=2006)>l 000 AS AnzFirmen_Umsatz2006,Number of Companies (). Postal Code BETWEEN 1010 AND 1090 AS Number of Companies1010_1090, Number of Companies (), Turnover (Period = 2006)> l 000 AS Number of Companies2006,
AnzahlFirmen().Kontaktpersonen.Count>5 AS AnzFirmen_MitKontaktpersonenNumber of Companies (). Contact Persons.Count> 5 AS Companies_Contact Persons
WHERE FirmenXand = „A"
Der automatische erste Teil des Auflösungsschrittes dieses Beispiels ergibt folgendes SQL- Statement, welches in einem weiteren Schritt um die fehlenden relationenbezogenen Operationen erweitert wird:WHERE CompanyXand = "A" The automatic first part of the resolution step of this example yields the following SQL statement, which in a further step is extended by the missing relationship-related operations:
SELECTSELECT
(SELECT Count (Distinct Firmen.FirmalD) WHERE Firmen.Ort="St.Pölten) AND(SELECT Count (Distinct Company.FirmalD) WHERE Company.Place = "St.Pölten) AND
Firmen.Land="A") AS AnFirmen__StPoelten (SELECT Count (Distinct Firmen.FirmalD) WHERE Firmen.PLZ BETWEEN 1010Companies.Countries = "A") AS CompanyOfPosts (SELECT Count (Distinct Companies.FirmalD) WHERE Companies.PLZ BETWEEN 1010
AND 1090 AND Firmen.Land="A") AS AnzFirmen_1010 AND 1090 (SELECT Count (Distinct Firmen.FirmalD) WHEREAND 1090 AND Companies.Land = "A") AS Company_1010 AND 1090 (SELECT Count (Distinct Companies.FirmalD) WHERE
Firmen.Umsatz(Zeitraum=2006)>1000 AND Firmen.Land="A") AS An2Firmen_Umsatz2006 (SELECT Count (Distinct Firmen.FirmalD)Company.Turnover (period = 2006)> 1000 AND Companies.Land = "A") AS An2Company_recast2006 (SELECT Count (Distinct Companies.FirmalD)
WHERE ( SELECT Count(Kontaktpersonen.*) ) > 5 ) AND Firmen.Land="A" ) AS AnzFirmen_MitKontaktρersonenWHERE (SELECT Count (contact persons. *))> 5) AND Companies.Land = "A") AS Company_Contact persons
Um den Focus auf das Wesentliche dieses Beispiels zu richten, wird, wie erwähnt, nur der erste Teil des Auflösungsschrittes gezeigt, die automatische Auflösung weiterer tabellenübergeordneter Wertefelder sowie die Vervollständigung der fehlenden relationenbezogenen Operationen erfolgt nach den gezeigten Verfahren und wird daher nicht im Detail ausgeführt und gezeigt.In order to focus on the gist of this example, as mentioned, only the first part of the resolution step is shown, the automatic resolution of further table superordinate value fields as well as the completion of the missing relation-related operations are performed according to the methods shown and will therefore not be described in detail shown.
Das automatische Anfügen des Kriteriums Firmen.Land="A" in dieses der ersten Hierarchie- Stufe untergeordnete Statement kann mittels eines einfachen Algorithmus erkannt und automatisch durchgeführt werden. Dies geschieht, um die Erzeugung eines gleichwertigen, aber um ein vielfaches komplexen SQL-Statements, welche jeweils eine Verbindung aller SUB-SELECTs zu der obersten Hierarchiestufe, in welche alle Firmen, deren Land den Wert „A" beinhaltet, zu umgehen.The automatic addition of the criterion Company.Land = "A" to this subordinate statement of the first hierarchy level can be recognized by means of a simple algorithm and carried out automatically. This is done by bypassing the generation of an equivalent, but many times complex, SQL statement, each of which links all SUB SELECTs to the top level of the hierarchy into which all companies whose country contains the value "A".
Sollen alle Kontaktpersonen jener Firmen aus Wien ermittelt werden, in denen mehr als 100 Mitarbeiter beschäftigt sind, lässt sich dies einfach zum Beispiel mittels folgender Schreibweise formulieren:
Beispiel:If all contact persons of those companies from Vienna are to be identified in which more than 100 employees are employed, this can be easily formulated, for example, by means of the following notation: Example:
SELECT Kontaktpersonen.*SELECT contact persons. *
WHERE FimienAusWien().AnzMitabeiter >100WHERE FimienAusWien (). AnzMitabeiter> 100
Wird endgültig umgewandelt inWill be finally converted into
SELECT Kontaktpersonen.* FROM Firmen, Abteilungen, Kontaktpersonen WHERE (Firmen.Ort="Wien") AND (Firmen.AnzMitabeiter>100) AND (Firmen.FirmaID=Abteilungen.FirmaNr)SELECT contact persons. * FROM companies, departments, contact persons WHERE (company.location = "Vienna") AND (company.employees> 100) AND (company.companyID = departments.companyNo)
AND (Abteilungen.AbteilungID=Kontaktpersonen.FirmaNr)AND (Departments.DepartmentID = Contact persons.CompanyNo)
Zwei ebenfalls mögliche, gleichwerte Schreibweisen sind:Two equally possible, equivalent spellings are:
SELECT Kontaktpersonen.* FROM FirmenAusWienO WHERE Firmen.AnzahlMitarbeiter>100SELECT contact persons. * FROM CompaniesAusWienO WHERE Companies.Numberemployees> 100
Bzw.Respectively.
SELECT Kontaktpersonen.*SELECT contact persons. *
WHERE FirmenAusWienO AND Firmen. AnzahlMitarbeiter> 100WHERE CompaniesAusWienO AND Companies. Number of employees> 100
Um die Verkettung von zwei aufeinander folgenden tabellenübergeordneten Wertefeldern und deren Auflösung mittels eines einfachen Beispiels zu zeigen, wird ein neues, einfaches tabellenübergeordnetes Wertefeld angelegt:To show the concatenation of two consecutive table-superordinate value fields and their resolution by means of a simple example, a new, simple table-superordinated value field is created:
Define ConnectionField AnzahlKontaktpersonen (Mindestumsatz, Mindestumsatz_Zeitraum) IF Param:Mindestumsatz THENDefine ConnectionField Number of contact persons (minimum turnover, minimum turnover period) IF Param: Minimum turnover THEN
Sum(Rechnungspositionen.Positionsbetrag)>=Param:Mindestumsatz IF Param:Mindestumsatz_Zeitraum THENSum (Invoice items.Position amount)> = Param: Minimum revenue IF Param: Minimum revenue_time THEN
Veranstalümgen.VADatum=Param:Mindesturnsatz_Zeitraum END IF
END IFEvent.VADatum = Param: Minimum_Turn_Time END IF END IF
Count(Distinct Kontaktpersonen.KontaktpersonID) End DefineCount (Distinct Contacts.ContactID) End Define
Im inneren, gerichteten Entscheidungsgraphen dieses tabellenübergeordneten Wertefeldes wird in jedem Fall eine Entscheidungsposition erreicht, welche unter anderem ein Tabellenfeld, das eindeutig einer Tabelle aus der gegebenen Datenstruktur zuordenbar ist, enthält: Count(Distinct Kontaktpersonen.KontaktpersonID)In the inner, directed decision graph of this table-superordinate value field, a decision position is reached in each case, which among other things contains a table field which can be uniquely assigned to a table from the given data structure: Count (Distinct Contact Persons.ContactID)
Somit lassen sich einfach alle Firmen aus Wien zeigen, in denen es in allen Abteilungen mehr als fünf Kontaktpersonen gibt, die im Jahr 2006 einen Mindestumsatz von 1000 Euro gebraucht haben, in dem von einem Anwender folgendes einfaches Statement erstellt wird:Thus, it is easy to show all companies from Vienna, where there are more than five contact persons in all departments, who needed a minimum turnover of 1000 Euro in 2006, in which a user makes the following simple statement:
Beispiel : SELECT Firmen.*Example: SELECT companies. *
WHERE FirmenAusWien(). AnzahlKontaktpersonen(Mindestumsatz=l 000, Mindestumsatz_Zeitraum=2006)>5WHERE company Auslands (). Number of contact persons (minimum turnover = l 000, minimum turnover period = 2006)> 5
Nach dem Auflösungsschritt wird aufgrund des erweiterten RTNs erkannt, dass folgendes SQL-Statement, welches in einem nachfolgenden Schritt um die relationenbezogenen Operationen erweitert wird, generiert werden soll:After the resolution step, due to the extended RTN, it is recognized that the following SQL statement, which is extended in a subsequent step by the relationship-related operations, is to be generated:
SELECT Firmen.* FROM Firmen WHERE Firmen.PLZ IN (SELECT Ort_PLZ.PLZ WHERE Ort_PLZ.Ort="Wien") AND ( SELECT Count (Distinct Kontaktpersonen.KontaktpersonID) WHERE ( SELECT Sum(Rechnungspositionen.Positionsbetrag)SELECT Companies * FROM Companies WHERE Companies.PLZ IN (SELECT city_plz.plz WHERE city_plz.location = "Vienna") AND (SELECT Count (Distinct Contact Persons.Contact PersonID) WHERE (SELECT Sum (Billing Items.Position Amount)
WHERE (Veranstaltungen. VADatum BETWEEN #01.01.2006# AND #31.12.2006#) >= 1000 ) >5WHERE (Events, VADdate BETWEEN # 01.01.2006 # AND # 31.12.2006 #)> = 1000)> 5
Nach der Vervollständigung der relationenbezogenen Operationen folgendes SQL-Statement erstellt, welches von einer SQL-Engine nach dem Stand der Technik analysiert, optimiert und verarbeitet werden kann:
SELECT Firmen.* FROM Firmen WHERE Firmen.PLZ IN (SELECT Ort_PLZ.PLZ FROM Ort_PLZ WHERE Ort_PLZ.Ort="Wien")After completing the relationship-based operations, create the following SQL statement that can be parsed, optimized, and processed by a state-of-the-art SQL engine: SELECT companies. * FROM companies WHERE companies.plz IN (SELECT city_PLZ.PLZ FROM city_PLZ WHERE city_PLZ.location = "Vienna")
AND ( SELECT Count(Kontaktpersonen.KontaktρersonID) FROM Abteilungen, Kontaktpersonen WHERE Firmen.FirmaID=Abteilungen.FirmaNr AND Abteilungen.AbteilungID=Kontaktpersonen.AbteilungNr AND (SELECT Sum(Rechnungspositionen.Positionsbetrag)AND (SELECT Count (Contact persons.ContactρersonID) FROM Departments, Contacts WHERE Company.CompanyID = Departments.CompanyNo AND Departments.DepartmentID = Contact Persons.DepartmentNo AND (SELECT Sum (Invoice Item.Position Amount)
FROM Veranstaltungen, Rechnungen, Rechnungspositionen WHERE Kontaktpersonen.KontaktpersonID= Veranstaltungen,KontaktpersonNr AND Veranstaltungen. VeranstaltungID= RechnungenVeranstaltungNrFROM Events, Invoices, Invoice Items WHERE Contacts.Contact PersonID = Events, Contact Person AND Events. Event ID = Invoice EventNo
AND Rechnungen.RechnungID= Rechnungspositionen.RechnungNr AND Veranstaltungen. V ADatum BETWEEN #01.01.2006# AND #31.12.2006# ) >= 1000AND Invoices.AccountID = Invoice Items.CalculationNo AND Events. V ADatum BETWEEN # 01.01.2006 # AND # 31.12.2006 #)> = 1000
) > 10)> 10
Folgendes Beispiel soll die einfache Schreibweise folgender Fragestellung zeigen:The following example should show the simple notation of the following question:
ALLE Firmen, deren Umsatz in den Jahren 2005, 2005 und 2006 und die Anzahl Veranstaltungen im Jahr 2006 als Spalten aus Orten mit mehr als 100 Firmen, deren Umsatz in Jahr 2006 im Vergleich zum Jahr 2005 um mindestens 20% gestiegen ist:ALL companies whose sales in the years 2005, 2005 and 2006 and the number of events in 2006 as columns from locations with more than 100 companies whose turnover in 2006 increased by at least 20% compared to 2005:
SELECT Firmen.*,SELECT companies. *,
Umsatz (ZeitraunrfOO^, Umsatz (Zeitraum=2005), Umatz (Zeitraum=2006), AnzahlVeranstaltungen(Zeitraum=2006) WHERE Ort.AnzahlFirmen() > 100Turnover (time lOOO, turnover (period = 2005), turnover (period = 2006), number of events (period = 2006) WHERE city.numberCompanies ()> 100
AND Umsatz(Zeitraum-2006)>=Umsatz(Zeitraum=2005)* 1.2
Tabellenübergeordnete Wertefelder können auch mehrere Entscheidungspfade ausgehend von einer Entscheidungsposition erstellen. Dies geschieht beispielsweise entweder mittels einer IF-THEN-ELSE-Verschachtelung oder mittels eines SELECT-CASE an einer Entscheidungsposition:AND revenue (period-2006)> = revenue (period = 2005) * 1.2 Table parent value fields can also create multiple decision paths based on a decision position. This happens, for example, either by means of an IF-THEN-ELSE nesting or by means of a SELECT CASE at a decision position:
Defme ConnectionField Firmen.MitarbeiterIDOfVerkaufsgebiet()Defme ConnectionField Companies.EmployeeIDOfSales Area ()
SELECT GASE TRUE: CASE Firmen.LANDo"A"SELECT GASE TRUE: CASE Firmen.LANDo "A"
SELECT MitarbeiterID WHERE Mitarbeiter.Nachname="Steiner" GASE Firmen.Ort="Salzburg":SELECT employeeID WHERE employee.lastname = "Steiner" GASE Firmen.Ort = "Salzburg":
SELECT MitarbeiterID WHERE Mitarbeiter.Nachname="Meier" GASE Firmen.PLZ BETWEEN 1010 AND 2300: SELECT MitarbeiterID WHERE Mitarbeiter.Nachnarne="Müller"SELECT EmployeeID WHERE Employee.Surname = "Meier" GASE Company.PLZ BETWEEN 1010 AND 2300: SELECT EmployeeID WHERE Employee.RecentName = "Miller"
CASE Firmen.Umsatz(Date.Year-l)>1000:CASE company.revenue (Date.Year-l)> 1000:
SELECT MitarbeiterID WHERE Mitarbeiter.Nachname="Hansen" CASE ELSE:SELECT employeeID WHERE employee.lastname = "Hansen" CASE ELSE:
SELECT MitarbeiterID WHERE Mitarbeiter.Nachname- 'Taurer" END SELECTSELECT employeeID WHERE employee.lastname- 'taurer' END SELECT
END DefmeEND Defme
In diesem inneren, gerichteten Entscheidungsgraphen wird in jedem der fünf definierten Entscheidungspfade jeweils eine Entscheidungsposition erreicht, welche zumindest eine Tabellenfeld, das eindeutig einer Tabelle zuordenbar ist, enthält.In this inner, directed decision graph, a decision position is reached in each of the five defined decision paths, which contains at least one table field that can be uniquely assigned to a table.
Mittels dieses tabellenübergeordneten Wertefeldes lassen sich alle Artikel und deren verkaufe Anzahl je betreuenden Verkäufe des zugeordneten Verkaufsgebietes leicht ermitteln:By means of this table-superordinated value field, all articles and their number of sales per supervised sales of the assigned sales area can be easily determined:
SELECT Artikel.*, Count (Distinct Artikel. ArtikellD), Firmen.Betreuer GROUP BY Firmen.MitarbeiterIDOfVerkaufsgebiet
Eine Umwandlung dieses Statements erfolgt mittels der Schritte des erfinungsgemäßen Verfahrens durch den Auflösungsschritt und die Vervollständigung der relationenbezogenen Operationen und wird nicht mehr gezeigt.SELECT Article. *, Count (Distinct Article .DeliveryDell), Companies.Betreuer GROUP BY Firmen.MitarbeiterIDOfSales area Conversion of this statement by means of the steps of the inventive method by the resolution step and the completion of the relationship-related operations and is no longer shown.
Der Verarbeitungsbefehl DISTINCT folgt in den gezeigten Beispielen oftmals auf das Schlüsselwort COUNT. Dieser Verarbeitungsbefehl kann immer eingefügt werden und die Notwendigkeit desselben kann ein nachfolgender SQL-Optimizer feststellen. Ebenso kann automatisch erkannt werden, dass der Verarbeitungsbefehl DISTINCT in Kombinationen mit dem Verarbeitungsbefehl COUNT nur dann in benötigt wird, wenn in einer Hierarchiestufe die Verarbeitungsfunktion COUNT auf eine Tabelle der definierten Menge angewandet werden soll, welche Tabelle nicht die letzte Ebene in dieser Hierarchiestufe darstellt.The processing command DISTINCT often follows the keyword COUNT in the examples shown. This processing command can always be inserted and the need for it can be determined by a subsequent SQL optimizer. Likewise, it can be automatically recognized that the processing command DISTINCT in combination with the processing command COUNT is only required if in a hierarchy level the processing function COUNT is to be applied to a table of the defined quantity, which table is not the last level in this hierarchy level.
Um dies zu verdeutlichen, wird folgendes, einfaches Beispiel gezeigt:To illustrate this, the following simple example is shown:
SELECT Firmen. Count, Firmen. Abteilungen. CountSELECT companies. Count, companies. Departments. Count
Dieses von einem Anwender erstellte Statement wird automatisch umgewandelt wie folgt:This user-created statement is automatically converted as follows:
SELECT Count (Distinct Firmen.FirmaID), Count ( Abteilungen. AbteilungID ) FROM Firmen, AbteilungenSELECT Count (Distinct Company.CompanyID), Count (Div. DepartmentID) FROM Companies, Departments
WHERE (Firmen.FirmaID=Abteilungen.FirmaNr)WHERE (Company.CompanyID = Departments.CompanyNo)
Es wird erkannt, dass die Verarbeitungsfunktion Count in Kombination mit der Tabelle Firmen sich nicht auf die letzte Ebene der definierten Menge, also des kartesischen Produktes der beiden Tabellen Firmen und Abteilungen, bezieht. Ebenso wird erkannt, dass dieIt is recognized that the processing function Count in combination with the table companies does not refer to the last level of the defined quantity, ie the Cartesian product of the two tables companies and departments. It is also recognized that the
Verarbeitungsfunktion Count in Kombination mit der Tabelle Abteilungen sich auf letzte Ebene der definierten Menge bezieht. Entsprechend wird das Schlüsselwort DISTINCT nur in Kombination mit COUNT Firmen.FirmalD eingefügt.Processing function Count in combination with the table Departments refers to last level of the defined quantity. Accordingly, the keyword DISTINCT is only inserted in combination with COUNT companies.FirmalD.
Es sei angemerkt, dass die beiden Begriffe „relationenbezogen" und „relationenorientiert" in der Beschreibung die idente Bedeutung haben.
Tabellenübergeordnete Wertefelder eignen sich ebenfalls sehr gut für die Verwendung in einer graphischen Oberfläche. Wird eine Tabelle ausgewählt, kann ebenfalls die Gesamtheit aller vorhandenen tabellenübergeordneten Wertefelder zur Auswahl angezeigt werden. Ebenso können jene tabellenübergeordneten Wertefelder, dessen Namen sich aus einem Tabellennamen, einem Punkt und einem Tabellenfeld-bezeichnenden Namen zusammensetzten, als Tabellenfelder einer jeweiligen Tabelle angezeigt werden.It should be noted that the two terms "relationship-based" and "relationship-oriented" have the same meaning in the description. Table superordinate value fields are also very suitable for use in a graphical user interface. If a table is selected, the totality of all existing table-superordinate value fields can also be displayed for selection. Likewise, those table-superordinate value fields whose names are made up of a table name, a dot, and a table-field-naming name can be displayed as table fields of a respective table.
Tabellenübergeordnete Wertefelder eigenen sich unveränderter Weise für die Verwendung von sämtlichen relationalen Datenstrukturen und SQL-Dialekten, so zum Beispiel OLAP, Geo-SQL, T-SQL usw. Genauso kann das erfindungsgemäße Verfahren bei anderen sämtlichen anderen Anfragesprachen wie z.B. OQL verwendet werden.Table superordinate value fields have the same meaning for the use of all relational data structures and SQL dialects, such as OLAP, Geo-SQL, T-SQL, etc. Similarly, the method according to the invention can be applied to all other other request languages such as e.g. OQL be used.
Die Angabe von () auf bei jenen tabellenübergeordneten Wertefeldern, welche keine Parameter enthalten, ist nicht zwingend erforderlich, wird aber an einigen Stellen aus Gründen der Übersicht verwendet.Specifying () on those table-superordinate value fields that do not contain any parameters is not mandatory, but is used in some places for clarity.
Nachfolgend wird ein Verfahren gezeigt, welches der Vervollständigungsschritt anwenden kann, um fehlende relationenbezogene Operationen in den Übergangs-SQL-Statements automatisch zu vervollständigen und somit ein endgültiges SQL-Statement zu erhalten:Below is a procedure that the completion step can use to automatically complete missing relation-related operations in the transient SQL statements, thus obtaining a final SQL statement:
In der vorgenannten Datenstruktur der Datentabellen 1 bis 10 (Tabelle 1 bis 10) läßt sich z.B. die folgende Aufgabe formulieren, aus der ersichtlich ist, welch komplexe Fragestellungen mit dem erfindungsgemäßen Verfahren bewältigt werden können. Im nachfolgenden Beispiel wird auf diese Datenstruktur Bezug genommen.In the aforementioned data structure of the data tables 1 to 10 (Tables 1 to 10), e.g. formulate the following task, from which it can be seen what complex issues can be overcome with the method according to the invention. The following example refers to this data structure.
Beispiel B:Example B:
Alle Firmen und deren diesjähriger Veranstaltungsgesamtumsatz anzeigen, aber nur für jene, mit denen heuer zumindest zehn Kontakte geführt wurden und in Marketingabteilungen heuer zumindest drei Veranstaltungen mit über 50 EURO an Umsatz für Speisen und Getränke gebucht wurden.
Beim erfindungsgemäßen Verfahren werden im wesentlichen die folgenden Schritte ausgeführt.Show all companies and their total annual sales this year, but only for those with at least ten contacts this year and in marketing departments this year at least three events were booked with more than 50 euros in sales for food and drinks. In the method according to the invention essentially the following steps are carried out.
1) Angeben einer abarbeitbaren Datenbankanweisung ohne relationenbezogene Operationen 2) Ermitteln eines Zugriffspfades1) Specifying a workable database statement without relation-based operations 2) Determining an access path
Dies erfolgt im einzelnen wie folgt:This is done in detail as follows:
ad 1) Verarbeitungsfunktionen und Datentabellen und deren Spalten angeben, auf die die Verarbeitungsfunktionen angewandt werden sollen und die Reihenfolge sowie die Hierarchiestufe, mit der die Abarbeitung zu erfolgen hat.ad 1) specify processing functions and data tables and their columns to which the processing functions are to be applied and the order and hierarchy level with which the processing is to be performed.
SELECT VerarbeitungsfunktionSELECT processing function
Firmen Datentabelle, auf die Verarbeitungsfunktion angewandt werden soll Alle Spalten (.*)... Spalten, auf die Verarbeitungsfunktion angewandt werden sollCompany Data table to apply to the processing function All columns (. *) ... columns to which the processing function is to be applied
Alle Spalten der Tabelle „Firmen" angebenSpecify all columns of the Companies table
Für jede selektierte Firma die Summe aller Positionsbeträge aus der zugehörigen Spalte der Tabelle „Rechnungspositionen" bestimmen unter der Einschränkung des Veranstaltungsjahres (heuer).For each selected company, determine the sum of all item amounts from the associated column of the table "Invoice items" under the restriction of the event year (this year).
Erfindungsgemäßes Erstellen der Datenbankanweisung führt daher zu:Creating the database statement according to the invention therefore leads to:
SELECT Firmen.*, (SELECT SUM (Rechnungspositionen.Positionsbetrag)SELECT companies. *, (SELECT SUM (invoice items.position item)
WHERE (Veranstaltungen. VADatum=date.year) ) WHERE (SELECT COUNT(Kontakte.*)WHERE (Events, VADatum = date.year)) WHERE (SELECT COUNT (Contacts. *)
WHERE (Kontakte.Kontaktdatum=date.year) )> = 10 AND (SELECT COUNT(Veranstaltungen.*)WHERE (Contacts.Contact Date = date.year))> = 10 AND (SELECT COUNT (events. *)
WHERE (Abteilungen.Abteilungsname= „Marketing") AND (SELECT SUM (Rechnungspositionen.Positionsbetrag)WHERE (Departments.DepartmentName = "Marketing") AND (SELECT SUM (Invoice Items.Position Amount)
WHERE (Zusatzrechnungspositionennamen.Positionsname IN ("Speisen", "Getränke"))
) >50WHERE (Additional bill position name.Position name IN ("Dine", "Drinks")) )> 50
AND (Veranstaltungen. VADatum = date.year ) ) >=3AND (Events, VADatum = date.year))> = 3
[„Date.year" ersetzt dabei BETWEEN 01.01. aktuelles Jahr AND 31.12.aktuelles Jahr]["Date.year" replaces BETWEEN 01.01. Current year AND 31.12.New Year]
In dieser Anfrage sind nur die Tabellen ohne Relationen enthalten, auf welche Verarbeitungsfunktionen angewandt werden sollen. Damit liegt Unabhängigkeit von jedweder Datenstruktur vor und es ergibt sich zugleich eine Verkürzung der Schreibweise und somit eine Erhöhung der Übersichtlichkeit. So fallen z.B. sonst übliche kartesische Produktbildungen, welche durch Relationen eingeschränkt sind, weg, weil im Statement alle Informationen vorhanden sind, die in Kombination mit der Tabelle der Relationen für die Ermittlung eines Zugriffspfades der jeweiligen Datenstruktur verwertet werden können, sodaß zum einen Unabhängigkeit von der konkreten Datenstruktur gegeben ist und zum anderen die Eingabe der Anfrage für den Anwender verkürzt und sich nur auf das Wesentliche beschränkt, was wiederum die Übersichtlichkeit erhöht.This request contains only the tables without relations to which processing functions are to be applied. This provides independence from any data structure and at the same time results in a shortening of the spelling and thus an increase in clarity. For example, otherwise usual Cartesian product formations, which are restricted by relations, away, because in the statement all information is present, which can be used in combination with the table of relations for the determination of an access path of the respective data structure, so given on the one hand independence of the concrete data structure and on the other hand the input of the request for the user is shortened and limited only to the essentials, which in turn increases the clarity.
ad 2) Aufgrund der Fragestellung ergibt sich in der Anfrage (Statement) bedingt durch die auszuführenden Unterabfragen (SUBSELECT) eine natürliche Reihenfolge der verwendeten Datentabellen sowie Hierarchiestufen, aus denen unter Zuhilfenahme der Tabelle der Relationen (Tabelle 11) Teilzugriffspfade für die Generierung eines SQL-Statements für die jeweilige Datenstruktur ermittelt werden.ad 2) Based on the question, the query results in a natural order of the data tables used as well as hierarchy levels, which, using the table of relations (Table 11), result in sub-access paths for the generation of an SQL query. Statements are determined for the respective data structure.
Die oben genannten Reihenfolge und die Hierarchiestufen der verwendeten Datentabellen werden vorzugsweise in Form eines geordneten Baumes 7 (Fig.1 ) dargestellt, der eine Wurzel 10 und Knoten 11, 12, 13 und 14 enthält, wobei der Knoten 14 ein Unterknoten zum Knoten 13 ist.The above-mentioned order and the hierarchical levels of the data tables used are preferably represented in the form of an ordered tree 7 (FIG. 1) containing a root 10 and nodes 11, 12, 13 and 14, the node 14 being a subnode to the node 13 ,
Die Wurzel 10 des geordneten Baumes 7 enthält als Informationsfeld 21 alle Namen der Datentabellen nur der übergeordneten Anfrage z.B. in Form einer Liste oder eines Arrays, und zwar praktischerweise in der im Statement angegebenen Reihenfolge, optional ohne doppelte Datentabellen-Namen. Für die Wurzel 10 beinhaltet das Informationsfeld 21 die Datentabelle
FIRMEN (Tabelle 1). Der Wurzel 10 untergeordnet sind Unterabfragen (SUBSELECT) und deren untergeordnete Unterabfragen (SUBSELECT im SUBSELECT)3 die als Knoten 11, 12, 13, 14 in die Baumstruktur eingetragen sind. Die Informationsfelder 22, 23, 24, 25 der Knoten 11, 12, 13, 14 enthalten die den Unterabfragen zugeordneten Namen der Datentabellen, die im jeweiligen SUBSELECT angegeben wurden, ebenfalls z.B. in Form einer Liste oder eines Arrays. Für den Knoten 13 sind dies die Datentabellen VERANSTALTUNGEN (Tabelle 5), ABTEILUNGEN (Tabelle 2) und VERANSTALTUNGEN (Tabelle 5) im Informationsfeld 24. Das SUBSELECT des Knotens 13 enthält gemäß der Fragestellung ein weiteres SUBSELECT durch den Knoten 14, der seinerseits in seinem Informationsfeld die Datentabellen RECHNUNGSPOSITIONEN (Tabelle 9) undThe root 10 of the ordered tree 7 contains as information field 21 all names of the data tables only of the higher-level request, for example in the form of a list or an array, conveniently in the order given in the statement, optionally without duplicate data table names. For the root 10, the information field 21 includes the data table COMPANIES (Table 1). Subordinate queries (SUBSELECT) and their subordinate subqueries (SUBSELECT in SUBSELECT) 3 are subordinate to the root 10 and are entered as nodes 11, 12, 13, 14 in the tree structure. The information fields 22, 23, 24, 25 of the nodes 11, 12, 13, 14 contain the sub-queries assigned names of the data tables that were specified in the respective SUBSELECT, also in the form of a list or an array. For node 13, these are the data tables EVENTS (Table 5), DEPARTMENTS (Table 2) and EVENTS (Table 5) in information field 24. The SUBSELECT of node 13 contains, according to the question, another SUBSELECT by node 14, which in its turn Information field the data tables INVOICE POSITIONS (Table 9) and
ZUSATZRECHNUNGSPOSITIONENNAMEN (Tabelle 10) beinhaltet.ADDITIONAL INVOICE POSITION NAME (Table 10).
Dieser Baum 7 wird in einem Preorder-Durchlauf durchlaufen: Knoten 10, Knoten 11, Knoten 12, Knoten 13 und Knoten 14.This tree 7 is traversed in a preorder pass: node 10, node 11, node 12, node 13 and node 14.
Als Hierarchiestufen lassen sich die nachfolgend angegebenen darstellen.As hierarchical levels, the following can be represented.
Stufe 1 FirmenLevel 1 companies
Wurzel 10, Übergeordnete AbfrageRoot 10, parent query
Stufe 1.1 Rechnungspositionen, VeranstaltungenLevel 1.1 Invoice items, events
Knoten 11, Unteranfrage im SELECT-Teil der HauptanfrageNode 11 subquery in the SELECT part of the main request
Stufe 1.2 Kontakte, Kontakte Knoten 12, Unteranfrage im WHERE-Teil der HauptanfrageLevel 1.2 contacts, contacts node 12, sub request in the WHERE part of the main request
Stufe 1.3 Veranstaltungen, Abteilungen, VeranstaltungenStage 1.3 Events, Departments, Events
Knoten 13, Unteranfrage AND-Teil der HauptanfrageNode 13, sub request AND part of the main request
Stufe 1.3.1 Rechnungspositionen, ZusatzRechnungspositionsnamenLevel 1.3.1 Invoice items, additional bill item names
Knoten 14, Unteranfrage in der Unteranfrage ANDNode 14, subquery in subquery AND
Nunmehr erfolgt die Zugriffspfadermittlung, die eine Zugriffsreihenfolge auf die Datenbank konkret vorgibt, indem über die Tabelle der Relationen zwischen jeweils zwei aufeinanderfolgenden, ausgewählten Datentabellen ein Teilzugriffspfad auf Basis der
zwischen den aufeinanderfolgenden Datentabellen vorhandenen Relationen berechnet wird, und aus allen errechneten Teilzugriffspfaden der Zugriffspfad zusammengesetzt wird.Now the access path determination, which specifies an access order to the database concretely, by using the table of relations between each two consecutive selected data tables, a partial access path based on the is calculated between the successive data tables existing relations, and composed of all calculated partial access paths of the access path.
Dabei zu berücksichtigen ist, daß durch den Wegfall jeglicher Produktbeschreibungen im Statement (FROM-Teil) die angegebene Datentabellen-Reihenfolge mit Verarbeitungsfunktionen ein doppeltes oder mehrfaches Durchlaufen von Teilzugriffspfaden ergeben kann, woraus bei der kartesischen Produktbildung gleiche Datentabellen fälschlicherweise mehrfach einbezogen würden, was ein falsches Anfrageergebnis zur Folge hätte.It should be noted that the omission of any product descriptions in the statement (FROM part), the specified data table order with processing functions may result in a double or multiple traversal of Teilzugriffspfaden, resulting in the Cartesian product formation same data tables were wrongly included multiple times, which is a false Request result would result.
Anhand des mit der oben angegebenen Tabelle der Relationen (Tabelle 11) ermittelten Zugriffspfades können nun relationenorientierte Operationen in die erfindungsgemäß (Beispiel B) angegebene Datenbankanweisung eingesetzt werden, wodurch folgendes SQL- Statement herauskommt, (die eingesetzten Operationen sind kursiv gesetzt) welches von jedem den SQL-Standard unterstützenden Datenbanksystem verarbeitet werden kann. Eine mögliche Form der Berechnung wird anschließend erläutert.Based on the access paths determined with the table of relations given above (Table 11), it is now possible to use relationship-oriented operations in the database statement specified in accordance with the invention (Example B), whereby the following SQL statement emerges (the operations used are in italics) which of each one SQL standard supporting database system can be processed. A possible form of calculation will be explained below.
SELECT Firmen.*,SELECT companies. *,
(SELECT SUM (Rechnungspositionen.Positionsbetrag) FROM Abteilungen, Kontaktpersonen, Veranstaltungen, Rechnungen, Rechnungspositionen(SELECT SUM (Invoice Items. Item Amount) FROM Departments, Contacts, Events, Invoices, Invoice Items
WHERE (Firmen.FirtnaID=Abteilungen.FirmaNr) AND (Abteilungen.AbteilungID=Kontaktpersonen.AbteilungNr) AND (Kontaktpersonen.KontaktpersonID=Veranstaltungen.KontaktpersonNr) AND (Veranstaltungen. VeranstaltungID=Rechnungen. VeranstaltungNr) AND (Rechnungen.RechmιngID=Rechnungspositionen.RechnungNr)WHERE (Company.FamilyID = Departments.CompanyNo) AND (Departments.DepartmentID = Contact Persons.DepartmentNo) AND (Contact Persons.Contact PersonID = Events.Contact PersonNo) AND (Events.OrderID = Invoices.OrganizerNo) AND (Invoices.RechmingID = Invoice Items.Note)
AND (Veranstaltungen. VADaturn=Date.Year)AND (Events, VADaturn = Date.Year)
))
FROMFirmenfrom companies
WHERE (SELECT Count(Kontakte.*) FROM Abteilungen, Kontaktpersonen, KontakteWHERE (SELECT Count (Contacts. *) FROM Departments, Contacts, Contacts
WHERE (Firmen.FirmaID=Abteilungen.FirnιaNr) AND (Abteilungen.AbteilungID=Kontaktpersonen.AbteilungNr) AND (Kontaktpersonen.KontaktpersonID=Kontakte.KontaktpersonNr) AND (Kontakte.Kontaktdatum = Date. Year) ) >= 10WHERE (Company.CompanyID = Departments.FirnιaNr) AND (Departments.DepartmentID = Contact Persons.DepartmentNo) AND (Contact Persons.Contact PersonID = Contacts.Contact PersonNo) AND (Contacts.Contact Date = Date. Year))> = 10
AND (SELECT Count(Veranstatungen.*)
FROM Abteilungen, Kontaktpersonen, Veranstaltungen WHERE (Firmen.FirmaID=Abteilungen.FirmaNr) AND (Abteilungen. AbteilungID=Kontaktpersonen.AbteilungNr) AND (Kontaktpersonen.KontaktpersonID=Veranstaltungen.KontaktpersonNr) 5 AND (Abteilungen.Abteilungsname="Marketing")AND (SELECT Count (events. *) FROM Departments, Contacts, Events WHERE (Company.CompanyID = Departments.CompanyNo) AND (Departments.CoverID = Contact Persons.DepartmentNo) AND (Contact Persons.Contact PersonID = Events.Contact PersonNo) 5 AND (Departments.Participant Name = "Marketing")
AND (SELECT Sum(Rechnungspositionen.Positionsbetrag)AND (SELECT Sum (Invoice items.Position amount)
FROM Rechnungen, Rechnungspositionen, ZusatzRechnungspostionenNamen WHERE (Veranstaltungen. VeranstaltungID=Rechnungen. VeranstaltungNr) AND (Rechnungen.RechnungID=Rechnungspositionen.RechnungNr)FROM Invoices, Invoice Items, Additional Invoicing ItemsNames WHERE (Events, EventID = Invoices, EventNo) AND (Invoices.RequestID = Invoice Items.No)
10 AND(Rechnungspositionen.PositionNr=ZusatzRechnungspostionenNamen.PositionID)10 AND (Invoice items.PositionNo = Additional Invoicing ItemsName.PositionID)
AND (ZusatzRechnungspostionenNamen.PositionsnameAND (Additional Billing Items Name.Position Name
IN („Speisen'7'Getränke") ) ) > 50)IN ("food'7'drinks"))> 50)
AND (Veranstaltungen. VADatunτ=date.year) 15 ) >= 3AND (Events, VADatunτ = date.year) 15)> = 3
Aus der Länge des auf diese Weise gewonnenen Statements im Vergleich zu dem in Schritt 1) erstellten ist klar zu ersehen, welche Vorteile hinsichtlich Kürze und Übersichtlichkeit aber insbesondere Unabhängigkeit von der Datenstruktur erzielt werden können.It can be clearly seen from the length of the statement obtained in this way in comparison with that produced in step 1) which advantages can be achieved in terms of brevity and clarity, but in particular independence from the data structure.
2020
Wird das Statement als Anfrage gespeichert, so kann die erfindungsgemäße Schreibweise und die generierte Schreibweise übernommen werden und eine Neuberechnung fallt weg. Eine solche wird nur bei Änderungen der Datenstruktur oder an derselben bzw. am Statement selbst durchgeführt. Dadurch fallt die sehr geringe Zeitspanne für die Umwandlung in einIf the statement is stored as a request, the notation according to the invention and the generated notation can be adopted and a recalculation is omitted. This is only done when the data structure changes or at the same or the statement itself. As a result, the very short period of time for the conversion falls into place
£5 SQL-Statement weg. Weitere Optimierungen liegen im Bereich des Fachwissens.£ 5 SQL statement gone. Further optimizations are in the area of specialist knowledge.
Eine andere Möglichkeit wäre, daß der ermittelte Zugriffspfad in der Datenbankanweisung separiert angegeben wird, der schrittweise auf die Datentabellen verweist, und zum Zugriff auf die Datenbank diesen Verweisen auf die Datentabellen schrittweise gefolgt wird. So 30 ergibt sich z.B.Another possibility would be for the determined access path to be separated in the database statement, which refers to the data tables step by step, and to access the database step by step following these references to the data tables. So 30 results e.g.
WAY FirmenWAY companies
-> Abteilungen WHERE (Firmen.FirmaID=Abteilungen.FirmaNr) -> Kontaktpersonen WHERE (Abteilungen.AbteilungID≡Kontaktpersonen.AbteilungNr) 35 -> Veranstaltungen-> Departments WHERE (Company.CompanyID = Departments.CompanyNo) -> Contact persons WHERE (Departments.AssessmentID≡Contact persons.PartitionNo) 35 -> Events
WHERE (Kontaktpersonen.KontaktpersonID=Veranstaltungen.KontaktpersonNr)WHERE (Contact persons.Contact personID = Events.Contact personNo)
-> Rechnungen WHERE (Veranstaltungen. VeranstaltungID=Rechnungen. VeranstaltungNr)
-> Rechnungspositionen-> Invoices WHERE (events, event ID = invoices, event no.) -> Invoice items
WHERE (Rechnungen.RechnungID=Rechnungspositionen.RechnungNr) -> ZusatzRechnungspostionenNamenWHERE (Invoice.RequestID = Invoice Items.No) -> Additional Invoicing ItemsNames
WHERE (Rechnungspositionen.PositioιiNr=ZusatzRechnungspostionenNamen.PositionID) Kontaktpersonen -> KontakteWHERE (Invoice items.PositioιiNr = Additional Invoicing Items Name.PositionID) Contact persons -> Contacts
WHERE (Kontaktpersonen.KontaktpersonID=Kontakte.KontaktpersonNr) SELECT Firmen.*,WHERE (Contact Persons.Contact PersonID = Contacts.Contact Number) SELECT Companies. *,
(SELECT SUM (Rechnungspositionen.Positionsbetrag) WHERE (Veranstaltungen. VADatum=date.year) ) WHERE (SELECT COUNT(Kontakte. *)(SELECT SUM (Invoice items.Position amount) WHERE (Events, VADatum = date.year)) WHERE (SELECT COUNT (Contacts. *)
WHERE (Kontakte.Kontaktdatum=date.year) )> = 10 AND (SELECT COUNT(Veranstaltungen.*)WHERE (Contacts.Contact Date = date.year))> = 10 AND (SELECT COUNT (events. *)
WHERE (Abteilungen.Abteilungsname= „Marketing") AND (SELECT SUM (Rechnungspositionen.Positionsbetrag)WHERE (Departments.DepartmentName = "Marketing") AND (SELECT SUM (Invoice Items.Position Amount)
WHERE (Zusatzrechnungspositionennamen.Positionsname IN ("Speisen", "Getränke")) ) >50WHERE (Additional bill position name.Position name IN ("Dine", "Drinks")))> 50
AND (Veranstaltungen. VADatum = date.year ) ) >=3AND (Events, VADatum = date.year))> = 3
Dadurch fallt die Eingliederung in das Statement weg, der Zugriffspfad verweist schrittweise auf die Datentabellen. Diesen Verweisen wird zum Zugriff auf die Datenbank schrittweise gefolgt.As a result, the inclusion in the statement falls away, the access path refers step by step to the data tables. These references are followed step by step to access the database.
Ein möglicher Algorithmus zur Ermittlung des Zugriffspfades unter Zuhilfenahme des geordneten Baumes, wie er in Fig.l angegeben ist, wird - um das Verständnis zu erleichtern und nicht von Tabellennamen usw. abzulenken - nachfolgend anhand einer einfachen Datenstruktur gezeigt. Dabei ist hervorzuheben, daß dieser angegebene Algorithmus nur einer von vielen ist, die für die Berechnung angewandt werden können.One possible algorithm for determining the access path with the aid of the ordered tree, as indicated in FIG. 1, is shown below on the basis of a simple data structure in order to facilitate understanding and not to distract from table names etc. It should be noted that this specified algorithm is only one of many that can be used for the calculation.
Generell werden bei der Ermittlung des Gesamtzugriffspfades doppelt angegebene Teilpfade gestrichen.In general, when specifying the total access path, twice specified subpaths are deleted.
Z.B. Datentabellen A, B, C, D, E, F, G, H
Inforaiationsfeld einer Wurzel des geordneten Baumes beinhaltet z.B. : A, C, F, B. Als Teilpfade ergeben sich somitFor example, data tables A, B, C, D, E, F, G, H Inforaiationsfeld a root of the ordered tree includes, for example: A, C, F, B. Sub-paths thus arise
Teilpfad AC: A B C Teilpfad CF: C D E F Teilpfad FB: F E D C BSubpath AC: A B C Subpath CF: C D E F Subpath FB: F E D C B
Unbereinigter Gesamtpfad daher: A B C D E F E D C B Wie ersichtlich ist E D C B doppelt angegeben und daher zu streichen Richtiger Gesamtpfad somit: A B C D E FAs a result, E D C B is indicated twice and should therefore be deleted. Correct overall path thus: A B C D E F
Unter der Annahme einer konkret vorliegenden Baumdarstellung, wie sie in Fig.2 gezeigt ist, wird nunmehr eine von vielen Möglichkeiten angegeben, wie die Zugriffspfadberechnung gemäß erfindungsgemäßem Verfahren und Übersetzung in ein SQL-Statement durch Anwendung folgender Schritte durchgeführt werden kann.Assuming a concrete present tree representation, as shown in Figure 2, now one of many possibilities is given, as the access path calculation according to the inventive method and translation into an SQL statement can be performed by applying the following steps.
Es liegen Datentabellen A, B, C, D3 E, in einer Datenstruktur vor.There are data tables A, B, C, D 3 E in a data structure.
Aus der der Darstellung in Fig.2 zugrunde liegenden Anfrage, die der besseren Übersichtlichkeit wegen nicht angegeben ist, ergibt sich folgende Baumstruktur.From the representation on the basis of the representation in Figure 2, which is not given for the sake of clarity, the following tree structure results.
Wurzel (Knoten) 101 mit Informationsfeld 201, welches C5A5D enthält Knoten 102 mit Informationsfeld 202,welches G5E enthält Knoten 103 mit Informationsfeld 203,welches F,I,G enthält Knoten 104 mit Informationsfeld 204, welches K3H3K5B enthält Knoten 105 mit Informationsfeld 205, welches G5D enthältRoot (node) 101 with information field 201, which contains C 5 A 5 D node 102 with information field 202, which contains G 5 E node 103 with information field 203, which contains F, I, G node 104 with information field 204, which K 3 H 3 K 5 B contains node 105 with information field 205, which contains G 5 D.
Die der gewählten Datenstruktur zugehörige Tabelle der Relationen verbindet dabei zur einfacheren Darstellung vereinfacht jeweils alphabetisch aufeinanderfolgende Datentabellen durch jeweils ein gemeinsames Relationenfeld, somit A<->B5 B <-> C5 C<->D,The table of relations belonging to the selected data structure simplifies the representation by connecting alphabetically successive data tables in each case by a common relation field, thus A <-> B 5 B <-> C 5 C <-> D,
Folgende Relationenfelder werden, wie aus Tabelle 12 (Tabelle der Relationen) hervorgeht, angenommen.
Tabelle A Spalten a, zlThe following relation fields are assumed, as shown in Table 12 (table of relations). Table A Columns a, zl
Tabelle B Spalten b, alTable B columns b, al
Tabelle C Spalten c, blTable C columns c, bl
Tabelle D Spalten d, clTable D columns d, cl
Der für eine bestimmte Anfrage erstellte geordnete Baum wird in einer sogenannten Preorder- Reihenfolge durchlaufen, indem ausgehend von einem ersten Knoten, der Wurzel 101 des geordneten Baumes 107 sämtliche weitere Knoten 102, 103, 104, 105 entsprechend der Hierarchiestufen durchlaufen werden.The ordered tree created for a particular query is traversed in a so-called preorder order by traversing all other nodes 102, 103, 104, 105 corresponding to the hierarchy levels, starting from a first node, the root 101 of the ordered tree 107.
Stufe 1 C1 A1 DStage 1 C 1 A 1 D
Wurzel (Knoten) 101Root (node) 101
Stufe 1.1 E1G Knoten 102Stage 1.1 E 1 G node 102
Stufe 1.2 F1I1G Knoten 103Stage 1.2 F 1 I 1 G node 103
Stufe 1.2.1 K,H,K,B Knoten 104Stage 1.2.1 K, H, K, B node 104
Stufe 1.3 G1D
Wie erwähnt, ist in Fig.2 eine Baumdarstellung einer nicht naher angegebenen Anfrage abgebildet. Die Wurzel 101 (oberster Knoten) enthält im Informationsfeld 201 eine Liste oder einen Array od.dgl. aller in der Hierarchiestufe 1 der übergeordneten Anfrage enthaltenen Datentabellen-Namen, wobei in der nicht angegebenen Anfrage - wie oben beschrieben - nur die Datentabellen genannt wurden, auf die Verarbeitungsfunktionen angewandt werden. Die Reihenfolge der angegebenen Datentabellen ist dabei C, A, D.Stage 1.3 G 1 D As mentioned, FIG. 2 shows a tree representation of a request that is not specified in more detail. The root 101 (top node) contains a list or array or the like in the information field 201. all of the data table names contained in the hierarchical level 1 of the higher-level request, wherein in the query not specified-as described above-only the data tables to which processing functions are applied are given. The order of the given data tables is C, A, D.
In der darauffolgenden Hierarchiestufe 1.1 ist für jede Unteranfrage der übergeordneten Anfrage jeweils ein Knoten 102, 103, 105 angelegt worden, der als Informationsfeld 202, 203, 205 die in dieser Unteranfrage verwendeten Datentabellen-Namen als Liste, Array od. dgl. beinhaltet. Die Reihenfolge ist für 102 z.B. G5E, für 103 z.B. F5I5G u.s.w.In the subsequent hierarchy level 1.1, a node 102, 103, 105 has been created for each subquery of the superordinate request, which contains as information field 202, 203, 205 the data table names used in this subquery as list, array or the like. The order is for 102 eg G 5 E, for 103 eg F 5 I 5 G etc
Die Hierarchiestufe 1.2.1 stellt die Unteranfrage zur Unteranfrage 1.2 (Knoten 103) dar, die wiederum als Informationsfeld 204 die dafür verwendeten Datentabellen-Namen K5 H5 K, B enthält.The hierarchy level 1.2.1 represents the subquery to subquery 1.2 (node 103), which in turn contains as information field 204 the data table names K 5 H 5 K, B used therefor.
Innerhalb eines Knotens, wobei in der Wurzel 101 begonnen wird, ist jeweils die Liste der Datentabellen z.B. im Informationsfeld 201 die Datentabellen C, A, D zu durchlaufen und es werden für jeweils zwei in der Liste aufeinanderfolgende Datentabellen die Teilzugriffspfade berechnet, wobei, wie bereits vorstehend beschrieben, mehrfache Durchläufe eliminiert werden, um unnötige Produktbildungen, welche ein falsches Produkt zur Folge haben, zu vermeiden.Within a node starting in root 101, the list of data tables is e.g. In the information field 201, the data tables C, A, D are traversed, and for each two consecutive data tables in the list, the partial access paths are calculated, as already described above, multiple passes are eliminated to unnecessary product formations, which result in a false product , to avoid.
Dabei ist zu beachten: Ein Knoten, der direkt unter einem anderen Knoten liegt, heißt (direkter) Nachfolger dieses Knotens. Umgekehrt heißt dieser andere Knoten direkter Vorgänger.It should be noted that a node that lies directly under another node is called (direct) successor of this node. Conversely, this other node is called direct predecessor.
Wurde die Liste des Informationsfeldes eines Knotens komplett durchlaufen, wird der in der Preorder-Reihenfolge nächste Knoten gesucht. Zwischen der ersten Datentabelle der Liste des Informationsfeldes dieses nächsten Knotens und der letzten Datentabelle der Liste des Informationsfeldes seines direkten Vorgängers wird der Teilzugriffspfad ermittelt, danach
wird die Liste dieses nächsten Knotens bis zur letzten Datentabelle, wie vorstehend beschrieben durchlaufen. Z.B.If the list of the information field of a node has been completed, the next node in the preorder sequence is searched for. Between the first data table of the list of the information field of this next node and the last data table of the list of the information field of its direct predecessor, the sub-access path is determined, then the list of this next node is traversed to the last data table as described above. For example,
Knoten 104: Durchlauf der Liste der Datentabellen im Informationsfeld 204: K, H, K, BNode 104: Passing the List of Data Tables in Information Field 204: K, H, K, B
Preorder-mäßig nächster Knoten ist der Knoten 105, dessen direkter Vorgänger aber ist Knoten 101, daher wird die Verbindung zwischen G (Knoten 105) und D (Knoten 101) gesucht und der Teilzugriffspfad errechnet. Danach erfolgt der Durchlauf der Datentabellen G, D im Informationsfeld 205 im Knoten 105 des Baumes 107.Preorderwise, the next node is node 105, but its direct predecessor is node 101, therefore the connection between G (node 105) and D (node 101) is searched for and the sub-access path computed. Thereafter, the passage of the data tables G, D in the information field 205 in the node 105 of the tree 107th
Nach oder während des Durchlaufs eines jeden Knotens werden wie bereits erwähnt doppelte Teilzugriffspfade entfernt, dabei werden alle doppelten oder mehrfachen Datentabellen- Namen und Relationsangaben für den jeweiligen Knoten oder einer seiner Vorgänger bis einschließlich Wurzel verworfen.After or during each node's run, as previously mentioned, duplicate sub-paths are removed, discarding any duplicate or multiple data table names and relations for the particular node or any of its predecessors, up to and including the root.
Für die Berechnung jedes einzelnen Teilzugriffspfades wird z.B. wie folgt vorgegangen.For the calculation of each individual sub-access path, e.g. proceed as follows.
Zunächst wird die Tabelle der Relationen (Tabelle 12) in z.B. einen Graphen eingelesen, wobei die Kanten des Graphen jeweils auch die Relationen-Bedingungen enthalten, um unter Zuhilfenahme der Graphentheorie Verbindungen zwischen jeweils zwei Datentabellen über die Relationen zu ermitteln.First, the table of relations (Table 12) in e.g. read in a graph, wherein the edges of the graph also each contain the relations conditions to determine using the graph theory connections between two data tables on the relations.
Für Stufe 1 ergibt sich daher im ersten Schritt C -> A als Pfad zwischen C und A als Ergebnis der z.B. kürzesten Weg-Berechnung folgende Liste:For stage 1, therefore, in the first step, C → A results as a path between C and A as a result of e.g. shortest route calculation following list:
Tabellen Relationen-BedingungenTables relations conditions
C B bl b B A al aC B bl b B a al a
Darauffolgend A -> D ist der Pfad A, B5 C, DSubsequently, A -> D is the path A, B 5 C, D
Tabellen Relationen-Bedingungen
A B a alTables relations conditions AB a al
B C b blB C b bl
C D C clC D C cl
Damit ist die Liste des Informationsfeldes 201 des ersten Knoten 101 durchlaufen, jetzt erfolgt die Bereinigung wertgleicher Zeilen, das Ergebnis wird in einen String umgewandelt und in das SQL-Statement an richtiger Stelle eingefügt. (NACH DEM SELECT und VOR DEM WHERE)This completes the list of the information field 201 of the first node 101, now the adjustment of lines of equal value occurs, the result is converted into a string and inserted into the SQL statement in the correct place. (AFTER SELECT and BEFORE WHERE)
Für Stufe 1 ergibt sich folgender String: FROM A5 B5 C5 D WHERE (A.a = B.al) AND (B.b = CbI) AND (Cc = D.cl)The following string results for level 1: FROM A 5 B 5 C 5 D WHERE (Aa = B.al) AND (Bb = CbI) AND (Cc = D.cl)
Damit ist man an das Ende der Liste des aktuellen Knotens, hier die Wurzel, angelangt. Als nächster Schritt wird festgestellt, ob es Vorgängerknoten gibt. Im Fall der Wurzel trifft dies definitionsgemäß nicht zu.This one is at the end of the list of the current node, here the root, arrived. The next step is to determine if there are any previous nodes. In the case of the root this is by definition not true.
Zusammenfassend werden daher folgende Schritte ausgeführt: Informationsfeld 201 von Knoten 101In summary, therefore, the following steps are performed: Information field 201 of node 101
C -> AC -> A
A -> DA -> D
Ergibt: FROM A, B, C, D WHERE (A.a = B.al) AND (B.b = CbI) AJVD (Cc = D.cl) Nächster Knoten: 102, Vorgänger-Knoten 101 erstes Datentabelle aktueller Knoten und letzte Datentabelle Vorgänger-KnotenReturns: FROM A, B, C, D WHERE (Aa = B.al) AND (Bb = CbI) AJVD (Cc = D.cl) Next Node: 102, Predecessor Node 101 First Data Table Current Node and Last Data Table Predecessor node
D -> GD -> G
Durchlaufen der ListeGoing through the list
G -> E Ergibt: FROM E, F, G WHERE (D.d = E.dl) AND (E.e = F.el) AND (F.f = G.fl)G -> E yields: FROM E, F, G WHERE (D.d = E.dl) AND (E.e = F.el) AND (F.f = G.fl)
Nächster Knoten: 103, Vorgänger-Knoten 101 erstes Datentabelle aktueller Knoten und letzte Datentabelle Vorgänger-KnotenNext node: 103, predecessor node 101 first data table current node and last data table predecessor node
D -> F Durchlaufen der ListeD -> F Scroll through the list
F -> IF -> I
I -> GI -> G
Ergibt: FROM E, F, G, H, I WHERE (D.d=E.dl) AND (E.tHF.el) AND (F.f=G.fl) A]VfD (G.g=H.gl) AND (H.h=I.hl) Nächster Knoten: 104, Vorgänger-Knoten 103 erstes Datentabelle aktueller Knoten und letzte Datentabelle Vorgänger-KnotenGives: FROM E, F, G, H, I WHERE (Dd = E.dl) AND (E.tHF.el) AND (Ff = G.fl) A] VfD (Gg = H.gl) AND (Hh = I.hl) Next node: 104, predecessor node 103 first data table current node and last data table predecessor node
G -> KG -> K
Durchlaufen der ListeGoing through the list
K -> H H -> KK -> H H -> K
K -> BK -> B
Ergibt: FROM J5 K WHERE (Li = J.il) AND (J.j = K.jl)
Nächster Knoten: 105, Vorgänger-Knoten 101 erstes Datentabelle aktueller Knoten und letzte Datentabelle Vorgänger-KnotenResults: FROM J 5 K WHERE (Li = J.il) AND (Jj = K.jl) Next node: 105, predecessor node 101 first data table current node and last data table predecessor node
D -> GD -> G
Durchlaufen der ListeGoing through the list
G -> DG -> D
Ergibt: FROM E, F, GReturns: FROM E, F, G
WHERE (D.d = E.dl) AND (E.e = F.el) AND (F.f = G.fl)
WHERE (D.d = E.dl) AND (E.e = F.el) AND (F.f = G.fl)
Claims
1. Verfahren zur Steuerung eines relationalen Datenbanksystems durch Ausführung einer Datenbankanfrage in einer relationalen Datenbank, welche als zugeordnete Datenstruktur eine Vielzahl durch Relationen miteinander verbundene Datentabellen, sowie eine Tabelle der Relationen enthält, unter Verwendung einer Datenbanksprache,A method of controlling a relational database system by executing a database query in a relational database containing as an associated data structure a plurality of data tables related by relations, and a table of relations, using a database language,
dadurch gekennzeichnet, daß es die folgenden Schritte umfasst:characterized in that it comprises the following steps:
Erstellen zumindest eines tabellenübergeordneten Wertefeldes, gegebenenfalls optionale Parameter enthaltend, in einem Voreinstellungsschritt, wobei das oder die erstellten tabellenübergeordneten Wertefelder zu einer Gesamtheit von tabellenübergeordneten Wertefeldern zusammengefasst werden, und wobei jedes der erstellten tabellenübergeordneten Wertefelder einen inneren, gerichteten Entscheidungsgraphen aufweist, der unabhängig von den inneren, gerichteten Entscheidungsgraphen der anderen erstellten tabellenübergeordneten Wertefelder der Gesamtheit der tabellenübergeordneten Wertefelder definiert ist und jeweils zumindest einen Entscheidungspfad aufweist,Creating at least one table-superordinate value field, optionally containing optional parameters, in a presetting step, wherein the table parent data fields are combined to a set of table-superordinate value fields, and wherein each of the created table-superordinate value fields has an inner, directed decision graph which is independent of the inner ones , directed decision graphs of the other created table-superordinated value fields of the entirety of the table-superordinate value fields is defined and in each case has at least one decision path,
wobei für jedes tabellenübergeordnete Wertefeld die erforderlichen Entscheidungspfade und deren jeweilige Entscheidungspositionen durch die vorbestimmbare Auswertung der dem jeweiligen tabellenübergeordneten Wertefeld zugehörigen optionalen Parameter und/oder von vorgegebenen Funktionen bestimmt werden,wherein for each table-superordinated value field the required decision paths and their respective decision positions are determined by the predeterminable evaluation of the respective table-superordinate value field associated optional parameters and / or predetermined functions,
und wobei in jedem Entscheidungspfad immer zumindest eine der Entscheidungspositionen erreichbar ist, welche mittels eines zugehörigen Kennzeichens festlegt, dass diese zumindest ein Tabellenfeld enthält, das eindeutig einer der Datentabellen, gegebenenfalls mittels ergänzender Angabe eines Datentabellennamens, der konkret zugrunde liegenden Datenstruktur zuordenbar ist,and wherein in each decision path at least one of the decision positions can always be reached, which specifies by means of an associated flag that it contains at least one table field which is unambiguously assignable to one of the data tables, possibly by means of supplementary specification of a data table name, to the specific underlying data structure,
Erstellen eines Anwender-SQL-Statements durch einen Anwender in einem Formulierungsschritt, in welchem zumindest eines der tabellenübergeordneten Wertefelder aus der Gesamtheit der tabellenübergeordneten Wertefelder von dem Anwender ausgewählt und gegebenenfalls mit Parametern, in zumindest einem der Verarbeitungsbereiche in zumindest einer der Hierarchiestufen, aber unabhängig von den im Anwender-SQL-Statement verwendeten Datentabellen, bei der Formulierung des Anwender-SQL-Statements eingesetzt wird, und in welchem gegebenenfalls relationenbezogene Operationen nicht enthalten sindCreation of a user SQL statement by a user in a formulation step in which at least one of the table-superordinate value fields is selected from the totality of the table-superordinate value fields by the user and optionally with parameters in at least one of the processing areas in at least one of the hierarchical levels, but independent of the data tables used in the user SQL statement, is used in the formulation of the user SQL statement, and in which, where appropriate, relationship-based operations are not included
- Ausführen eines nachfolgenden, automatischen Statement-Auflösungsschritts, in dem ein neues Übergangs-SQL-Statement dadurch erstellt wird, dass sämtliche im Anwender- SQL-Statement eingesetzten tabellenübergeordneten Wertefelder gegebenenfalls unter Berücksichtigung der mitgegebenen Parameter aufgerufen und durchlaufen werden und das Ergebnis dieser Durchläufe anstelle des jeweils verwendeten tabellenübergeordneten Wertefeld in das ursprünglich angegebene SQL-Statement eingesetzt wird,- Execute a subsequent, automatic statement resolution step in which a new transitional SQL statement is created by calling up and running through all the table-superordinate value fields used in the user SQL statement, taking into account the parameters provided, and using the result of these runs the used table-superordinate value field is inserted into the originally specified SQL statement,
wobei die inneren, gerichteten Entscheidungsgraphen der im angegebenen Anwender-SQL- Statement enthaltenen tabellenübergeordneten Wertefelder erst bei Ausführung des Statement-Auflösungsschritt in Abhängigkeit von den Verarbeitungsbereichen, in denen sie jeweils verwendet werden, für die Verarbeitung herangezogen werden,wherein the inner, directed decision graphs of the table-superordinated value fields contained in the specified user SQL statement are used for processing only when the statement resolution step is executed, depending on the processing areas in which they are used,
wobei bei Aufruf der tabellenübergeordneten Wertefelder dem sich jeweils über die Auswertung der mitgegebenen Parameter aus dem Anwender-SQL-Statement und/oder der Funktionen ergebenden Entscheidungspfad des inneren, gerichteten Entscheidungsgraphen desselben bis zum Ende gefolgt wird,wherein, when calling the table-superordinate value fields, the decision path of the inner, directed decision graph of the same, which results from the evaluation of the given parameters from the user SQL statement and / or the functions, is followed until the end;
und als Ergebnis eines Aufrufes und Durchlaufens der tabellenübergeordneten Wertefelder die Werte all jener erreichten Entscheidungspositionen zurückgeliefert werden, welche mittels des jeweils zugehörigen Kennzeichens festlegen, dass diese zumindest ein Tabellenfeld, das eindeutig einer der Datentabellen der konkret zugrunde liegenden Datenstruktur zuordenbar ist, enthalten, sowie alle Ergebnisse jener erreichten Entscheidungspositionen, an denen ein tabellenübergeordnetes Wertefeld mit mitgegebenen Parametern durchlaufen wird,and as a result of invoking and traversing the table-superordinate value fields the values of all those reached decision positions are returned, which by means of the respective associated flag specify that they contain at least one table field unambiguously assignable to one of the data tables of the specific underlying data structure and all Results of decision positions reached where a table-superordinate value field with specified parameters is passed through,
und somit ein Übergangs-SQL-Statement zur Verfügung steht, welches gegebenenfalls unvollständige relationenbezogene Operationen enthältand thus a transient SQL statement is available, which may contain incomplete relationship-based operations
Automatisches Vervollständigen des Übergangs-SQL-Statements durch Hinzufügen gegebenenfalls fehlender und/oder unvollständiger relationenbezogener Operationen in einem Vervollständigungsschritt, wodurch ein endgültiges SQL-Statement erzeugt wird, das von jeder, den SQL-Standard unterstützenden Engine analysiert, optimiert und verarbeitet werden kann.Automatically completing the transient SQL statement by adding any missing and / or incomplete relationship-related operations in a completion step, thereby generating a final SQL statement written by Any SQL standard supporting engine can be parsed, optimized, and processed.
2. Verfahren nach Anspruch 1, dadurch gekennzeichnet, dass bei Durchlaufen der inneren, gerichteten Entscheidungsgraphen der tabellenübergeordneten Wertefelder im Auflösungsschritt Entscheidungspositionen entlang der Entscheidungspfade erreicht werden, wobei jede Entscheidungsposition in Abhängigkeit von dem zugehörigen Kennzeichen entweder2. Method according to claim 1, characterized in that, when passing through the inner, directed decision graphs of the table-superordinated value fields in the resolution step, decision positions along the decision paths are reached, each decision position depending on the associated identifier either
- vermittels einer vorbestimmbaren Auswertung der zugehörigen Parameter und/oder von Funktionen jeweils von einander unabhängige Entscheidungspfade mit jeweils zumindest einer Entscheidungsposition festlegt, wobei kein Ergebnis zurückgeliefert wird, oder- Defines by means of a pre-definable evaluation of the associated parameters and / or functions each of independent decision paths each having at least one decision position, wherein no result is returned, or
- zumindest ein Tabellenfeld enthält, das eindeutig einer der Datentabellen, gegebenenfalls mittels ergänzender Angabe eines Datentabellennamens, der konkret zugrunde liegenden Datenstruktur zuordenbar ist, und diese Entscheidungsposition als Ergebnis die gesamte, an dieser Stelle angegebene Zeichenfolge enthält,at least one table field contains, which unambiguously one of the data tables, if necessary by means of supplementary specification of a data table name, the concrete underlying data structure can be assigned, and this decision position contains as a result the entire, specified at this point string,
- oder das Aufrufen und Durchlaufen eines tabellenübergeordneten Wertefeldes mit konkreten Parametern aus der Gesamtheit der tabellenübergeordneten Wertefelder vorschreibt und diese Entscheidungsposition somit das Ergebnis des Durchlaufes des tabellenübergeordneten Wertefeldes enthält.- Or calling and traversing a table-superordinate value field with concrete parameters from the totality of the table-superordinate value fields prescribes and this decision position thus contains the result of the passage of the table-superordinated value field.
3. Verfahren nach Anspruch 1 oder 2, dadurch gekennzeichnet, dass jene Entscheidungspositionen in den Entscheidungspfaden der tabellenübergeordneten Wertefelder, welche mittels zugehörigen Kennzeichen zumindest ein Tabellenfeld enthalten, das eindeutig einer der Datentabellen der konkret zugrunde liegenden Datenstruktur zuordenbar ist, ferner eine Zeichenfolge enthalten, welche zumindest teilweise dem SQL- RTN entspricht, sodass dem SQL-RTN an beliebiger Stelle einfach oder mehrfach zumindest über Teilstrecken gefolgt wird.Method according to claim 1 or 2, characterized in that those decision positions in the decision paths of the table-superordinated value fields, which contain by means of associated identifiers at least one table field which is uniquely assignable to one of the data tables of the concretely underlying data structure, further comprise a character string which at least partially corresponds to the SQL RTN, so that the SQL RTN at any point simply or repeatedly followed at least over sections.
4. Verfahren nach Anspruch 1, 2 oder 3, dadurch gekennzeichnet, dass als einer der Parameter für ein tabellenübergeordnetes Wertefeld sowohl bei Verwendung in einem Anwender-SQL-Statement als auch bei Einsetzen in eine der Entscheidungspositionen der Entscheidungspfade eines der tabellenübergeordneten Wertefelder zumindest entweder eine Zahl, eine Variable, ein Text, eine Funktion, eine Tabelle, ein Tabellenfeld und/oder eines der tabellenübergeordneten Wertefelder aus der Gesamtheit der tabellenübergeordneten Wertefelder als Parametertypen oder eine Auflistung zulässiger Parametertypen übergeben wird.4. The method of claim 1, 2 or 3, characterized in that as one of the parameters for a table-superordinate value field both when used in a User SQL statement as well as when inserting in one of the decision positions of the decision paths of one of the table-parent value fields at least either a number, a variable, a text, a function, a table, a table field and / or one of the table parent value fields from the entirety of the table superordinate Value fields as parameter types or a list of permissible parameter types.
5. Verfahren nach einem der vorhergehenden Ansprüche, dadurch gekennzeichnet, dass in einem Hierarchiestufen-Analyse-Schritt als Teil des Statement-Auflösungsschrittes für jedes im Anwender-Statement angegebene tabellenübergeordnetes Wertefeld folgende Schritte ausgeführt werden:5. The method according to any one of the preceding claims, characterized in that in a hierarchy level analysis step as part of the statement resolution step for each specified in the user statement table superordinate value field, the following steps are performed:
Feststellen der Hierarchiestufe und deren gegebenenfalls übergeordnete Hierarchiestufen, in welcher das jeweilige tabellenübergeordnete Wertefeld im Anwender-SQL-Statement verwendet wirdDetermining the hierarchy level and its hierarchical levels, if any, in which the respective table-superordinate value field is used in the user SQL statement
- Auswählen jener im Anwender-SQL-Statement verwendeten Datentabellen, welche sich in der festgestellten und in der ihr übergeordneten Hierarchiestufe befinden und Speichern derselben als Analyse-Hierarchiestufen-Tabellenmenge- Selecting those data tables used in the user SQL statement, which are located in the ascertained and in the hierarchical hierarchy level and storing them as an analysis hierarchy table set
- Auswählen aller Datentabellen aus dem Ergebnis, welches bei Aufrufen und Durchlaufen des jeweiligen tabellenübergeordneten Wertefeldes mit den laut- Selecting all data tables from the result, which when calling and passing through the respective table superordinate value field with the loud
Anwender-SQL-Statement gegebenenfalls mitgegebenen Parametern geliefert wird und Speichern derselben als Analyse-Ergebnis-TabellenmengeUser SQL statement is supplied with any given parameters and storing them as an analysis result table set
- Feststellen, ob in der Analyse-Ergebnis-Tabellenmenge zumindest eine Datentabelle vorhanden ist, welche nicht in der Analyse-Hierarchiestufen-Tabellenmenge vorkommt und, sofern dies der Fall ist:Determine whether there is at least one data table in the analysis result table set that does not appear in the analysis hierarchy table set and, if so:
- Einfügen des Ergebnisses des Aufrufens und Durchlaufens des tabellenübergeordneten Wertefeldes in eine der festgestellten Hierarchiestufe untergeordneten Hierarchiestufe im Übergangs-SQL-Statement.- Inserting the result of calling and passing the table-superordinate value field into one of the subordinate hierarchy levels found in the transitional SQL statement.
6. Verfahren nach Anspruch 5, dadurch gekennzeichnet, dass in jenen Hierarchiestufen, in welchen nach zumindest einem Tabellenfeldwert gruppiert wird, nur jene Tabellenfelder als Datentabellen ausgewählt werden, auf welche die Gruppierung angewandt wird. 6. The method according to claim 5, characterized in that in those hierarchy levels in which is grouped according to at least one table field value, only those table fields are selected as data tables to which the grouping is applied.
7. Verfahren nach einem der Ansprüche 1 bis 6, dadurch gekennzeichnet, dass im RTN von SQL der Produktbildungs- Verarbeitungsbereich, der die in der jeweiligen Hierarchiestufe zu verwendenden Datentabellen enthält und die Bildung eines kartesischen Produktes für dieselben beschreibt, nur als optionaler Entscheidungspfad definiert ist,7. The method according to any one of claims 1 to 6, characterized in that in the RTN of SQL, the product image processing area, which contains the data tables to be used in the respective hierarchy level and describes the formation of a Cartesian product for them, is defined only as an optional decision path .
und in jenen Fällen, in denen dieser Produktbildungs- Verarbeitungsbereich im Anwender- SQL-Statement nicht angegeben ist, dieser in einem späteren Schritt automatisch erstellt wird und, beispielsweise mittels einer Tabelle der Relationen, sämtliche zur Auflösung des Anwender-SQL-Statements benötigten Datentabellen ermittelt in diesem Verarbeitungsbereich und eingefügt werden,and in those cases where this product-building processing area is not specified in the user SQL statement, it is automatically created in a later step and, for example, by means of a table of relations, determines all the data tables needed to resolve the user's SQL statement be inserted in this processing area and
und die relationenbezogenen Operationen, welche zwischen den eingefügten Datentabellen unter der Berücksichtigung der Hierarchiestufe vorhanden sind, automatisch in den Kriterien- Verarbeitungsbereich (WHERE) des Übergangs-SQL-Statement und somit auch in das endgültigen SQL-Statements eingefügt werden.and the relation-related operations that exist between the inserted data tables, taking into account the hierarchy level, are automatically inserted into the criteria processing area (WHERE) of the transitional SQL statement and thus also into the final SQL statement.
8. Verfahren nach einem der vorhergehenden Ansprüche, dadurch gekennzeichnet, dass jene Entscheidungspositionen im RTN von SQL, an welchen ein Tabellenname unabhängig von den Verarbeitungsbereichen angegeben werden kann, derart erweitert werden, dass anstatt eines Tabellennamens ein tabellenübergeordnetes Wertefeld an diesen Entscheidungspositionen zugelassen wird, wobei auf ein tabellenübergeordnetes Wertefeld nicht zwingend weitere Entscheidungspositionen folgen müssen, und die von dieser RTN- Erweiterung betroffenen Anwender-SQL-Statements im Auflösungs-Schritt zuerst in ein Übergangs-SQL-Statement und nachfolgend in ein endgültiges SQL-Statement umgewandelt werdenMethod according to one of the preceding claims, characterized in that those decision positions in the RTN of SQL to which a table name can be specified independently of the processing areas are extended in such a way that, instead of a table name, a table-superordinate value field is permitted at these decision positions a table-superordinate value field does not necessarily have to follow further decision positions, and the user SQL statements concerned by this RTN extension are first converted in the resolution step into a transitional SQL statement and subsequently into a final SQL statement
9. Verfahren nach einem der Ansprüche 1 bis 8, dadurch gekennzeichnet, dass jene Entscheidungspositionen im RTN von SQL, an welchen ein Tabellenfeldname unabhängig von den Verarbeitungsbereichen angegeben werden kann, derart erweitert werden, dass anstatt eines Tabellenfeldnamens ein tabellenübergeordnetes Wertefeld an diesen Entscheidungspositionen zugelassen wird, wobei auf das tabellenübergeordnete Wertefeld nicht zwingend weitere Entscheidungspositionen folgen müssen, und die von dieser RTN- Erweiterung betroffenen Anwender-SQL-Statements im Auflösungs-Schritt zuerst in ein Übergangs-SQL-Statement und nachfolgend in ein endgültiges SQL-Statement umgewandelt werden und9. Method according to one of claims 1 to 8, characterized in that those decision positions in the RTN of SQL to which a table field name can be specified independently of the processing areas are extended such that, instead of a table field name, a table-superordinated value field is permitted at these decision positions , where the table-superordinate value field does not necessarily have to be followed by further decision positions, and the user SQL statements affected by this RTN extension first in the resolution step Transitional SQL statement and subsequently converted into a final SQL statement and
wobei das tabellenübergeordnete Wertefeld im Statement-Auflösungsschritt in einer, der dieses tabellenübergeordnete Wertefeld enthaltenden, direkt untergeordneten Hierarchiestufe, eingefügt wird.wherein the table-superordinate value field is inserted in the statement resolution step in a directly subordinate hierarchy level containing this table-superordinate value field.
10. Verfahren nach einem der Ansprüche 1 bis 9, dadurch gekennzeichnet, dass jene Entscheidungspositionen im RTN von SQL, an welchen ein Tabellenname unabhängig von den Verarbeitungsbereichen angegeben werden kann, derart erweitert werden, dass auf diese Tabellennamen optional ein Verbindungszeichen, vorzugsweise ein Punkt, gefolgt von einer Tabelle, einem Tabellenfeld, einem tabellenübergeordneten Wertefeld, einer Vergleichsoperation, oder einer Aggregatsfunktion zugelassen wird.10. The method according to any one of claims 1 to 9, characterized in that those decision positions in the RTN of SQL, to which a table name can be specified independently of the processing areas are extended such that these table names optionally a connection character, preferably a point, followed by a table, a table field, a table-superordinate value field, a comparison operation, or an aggregate function.
11. Verfahren nach einem der Ansprüche 1 bis 10, dadurch gekennzeichnet, dass jene Entscheidungspositionen im RTN von SQL, an welchen ein Tabellenfeldname unabhängig von den Verarbeitungsbereichen angegeben werden kann, derart erweitert werden, dass auf diese Tabellenfeldnamen optional ein Verbindungszeichen, vorzugsweise ein Punkt, gefolgt von einer Tabelle, einem Tabellenfeld, einem tabellenübergeordneten Wertefeld, einer Vergleichsoperation oder einer Aggregatsfunktion zugelassen wird.11. Method according to one of claims 1 to 10, characterized in that those decision positions in the RTN of SQL to which a table field name can be specified independently of the processing areas are extended such that these table field names optionally have a connection character, preferably a point, followed by a table, a table field, a table-superordinate value field, a comparison operation, or an aggregate function.
12. Verfahren nach einem der Ansprüche 1 bis 11, dadurch gekennzeichnet, dass jene Entscheidungspositionen, an welchen ein tabellenübergeordnetes Wertefeld unabhängig von den Verarbeitungsbereichen angegeben werden kann, derart erweitert, dass auf diese tabellenübergeordneten Wertefelder optional ein Verbindungszeichen, vorzugsweise ein Punkt, gefolgt von einer Tabelle, einem Tabellenfeld, einem tabellenübergeordneten Wertefeld, einer Vergleichsoperation oder einer Aggregatsfunktion zugelassen wird,12. The method according to any one of claims 1 to 11, characterized in that those decision positions at which a table-topical value field can be specified independently of the processing areas, extended such that these table-superordinate value fields optionally a connection character, preferably a point followed by a Table, a table field, a table-superordinate value field, a comparison operation, or an aggregate function,
wobei nachfolgenden Vergleichsoperationen als zusätzliche Parameter für das jeweilige tabellenübergeordnete Wertefeld angenommen werden, und wobeiwherein subsequent comparison operations are assumed as additional parameters for the respective table-superordinate value field, and wherein
sämtliche anderen mit dieser Entscheidungsposition in Verbindung stehenden Entscheidungspositionen mit dem Statement- Auflösungsschritt verarbeitet werden. all other decision positions associated with this decision position are processed with the statement resolution step.
13. Verfahren nach einem der Ansprüche 1 bis 12, dadurch gekennzeichnet, dass das Übergangs-SQL-Statement in Form einer Datenbankanweisung ohne relationenbezogene Operationen vorliegt, in der nur jene Verarbeitungsfunktionen, nur jene Datentabellen und deren Spalten aus der Vielzahl der über die Relationen miteinander verbundenen Datentabellen enthalten sind, auf die entsprechend der Fragestellung des Anwenders Verarbeitungsfunktionen angewandt werden, und in der die Reihenfolge sowie die Hierarchiestufe, mit der die Abarbeitung zu erfolgen hat, angegeben sind,13. The method according to any one of claims 1 to 12, characterized in that the transitional SQL statement is in the form of a database statement without relation-based operations, in which only those processing functions, only those data tables and their columns of the plurality of the relations with each other associated data tables are included, are applied to the user's question processing functions, and in which the order and the hierarchy level, with which the execution is to be made, are specified,
und in einem Relationen-Vervollständigungsschritt, welcher auf das Übergangs-SQL- Statement angewandt wird und welcher dem Auflösungsschritt folgt, ein Zugriffspfad ermittelt wird, der eine Zugriffsreihenfolge auf die Datenbank konkret vorgibt, indem über dieand in a relation completion step which is applied to the transitional SQL statement and which follows the resolution step, an access path is determined which concretely specifies an access order to the database by using the
Tabelle der Relationen zwischen jeweils zwei aufeinander folgenden, ausgewähltenTable of relations between each two consecutive, selected
Datentabellen ein Teilzugriffspfad auf Basis der zwischen den aufeinander folgendenData tables a sub-access path based on the between the successive
Datentabellen vorhandenen Relationen berechnet wird, und aus allen errechneten Teilzugriffspfaden der Zugriffspfad zusammengesetzt wird.Data tables existing relations is calculated, and composed of all calculated partial access paths, the access path.
14. Verfahren nach Anspruch 13, dadurch gekennzeichnet, dass zur Ermittlung der Teilzugriffspfade die Tabelle der Relationen in einen auf der Graphentheorie basierenden Graphen eingelesen und unter Zuhilfenahme des gebildeten Graphen die Teilzugriffspfade berechnet werden.14. The method according to claim 13, characterized in that read to determine the partial access paths, the table of relations in a based on graph theory graphs and the partial access paths are calculated with the aid of the graph formed.
15. Relationales Datenbanksystem, welches ein Computersystem mit einer relationalen Datenbank, eine Datenverarbeitungseinheit und einen Speicher umfaßt, wobei die Datenverarbeitungseinheit nach dem Verfahren nach einem der Ansprüche 1 bis 14 arbeitet.A relational database system comprising a computer system having a relational database, a data processing unit and a memory, the data processing unit operating according to the method of any one of claims 1 to 14.
16. Datenträger mit einer mit in einer Datenbanksprache angegebenen Datenbankanweisung zur Steuerung und zum Einlesen in ein relationales Datenbanksystem nach Anspruch 15, dadurch gekennzeichnet, dass die auf dem Datenträger vorliegende Datenbankanweisung erstellt ist, indem folgende Schritte ausgeführt wurden:16. A data carrier having a database instruction specified in a database language for control and reading into a relational database system according to claim 15, characterized in that the data base instruction present on the data carrier has been created by carrying out the following steps:
Erstellen zumindest eines tabellenübergeordneten Wertefeldes, gegebenenfalls optionale Parameter enthaltend, in einem Voreinstellungsschritt, wobei das oder die erstellten tabellenübergeordneten Wertefelder zu einer Gesamtheit von tabellenübergeordneten Wertefeldern zusammengefasst werden, und wobei jedes der erstellten tabellenübergeordneten Wertefelder einen inneren, gerichteten Entscheidungsgraphen aufweist, der unabhängig von den inneren, gerichteten Entscheidungsgraphen der anderen erstellten tabellenübergeordneten Wertefelder der Gesamtheit der tabellenübergeordneten Wertefelder definiert ist und jeweils zumindest einen Entscheidungspfad aufweist,Creating at least one table-superordinate value field, optionally containing optional parameters, in a presetting step, wherein the table (s) created are merged into a set of table-superordinate value fields, and wherein each of the created table-superordinate value fields has an inner, directed decision graph, which is defined independently of the inner, directed decision graphs of the other created table-superimposed value fields of the entirety of the table-superordinate value fields and in each case has at least one decision path,
wobei für jedes tabellenübergeordnete Wertefeld die erforderlichen Entscheidungspfade und deren jeweilige Entscheidungspositionen durch die vorbestimmbare Auswertung der dem jeweiligen tabellenübergeordneten Wertefeld zugehörigen optionalen Parameter und/oder von vorgegebenen Funktionen bestimmt werden,wherein for each table-superordinated value field the required decision paths and their respective decision positions are determined by the predeterminable evaluation of the respective table-superordinate value field associated optional parameters and / or predetermined functions,
und wobei in jedem Entscheidungspfad immer zumindest eine der Entscheidungspositionen erreichbar ist, welche mittels eines zugehörigen Kennzeichens festlegt, dass diese zumindest ein Tabellenfeld enthält, das eindeutig einer der Datentabellen, gegebenenfalls mittels ergänzender Angabe eines Datentabellennamens, der konkret zugrunde liegenden Datenstruktur zuordenbar ist,and wherein in each decision path at least one of the decision positions can always be reached, which specifies by means of an associated flag that it contains at least one table field which is unambiguously assignable to one of the data tables, possibly by means of supplementary specification of a data table name, to the specific underlying data structure,
Erstellen eines Anwender-SQL-Statements durch einen Anwender in einem Formulierungsschritt, in welchem zumindest eines der tabellenübergeordneten Wertefelder aus der Gesamtheit der tabellenübergeordneten Wertefelder von dem Anwender ausgewählt und gegebenenfalls mit Parametern, in zumindest einem der Verarbeitungsbereiche in zumindest einer der Hierarchiestufen, aber unabhängig von den im Anwender-SQL-Statement verwendeten Datentabellen, bei der Formulierung des Anwender-SQL-Statements eingesetzt wird, und in welchem gegebenenfalls relationenbezogene Operationen nicht enthalten sindCreating a user SQL statement by a user in a formulating step in which at least one of the table-superordinate value fields is selected from the set of table-superordinate value fields by the user and optionally with parameters, in at least one of the processing areas in at least one of the hierarchy levels, but independent of the data tables used in the user SQL statement, used in the formulation of the user SQL statement, and in which, where appropriate, relationship-based operations are not included
- Ausführen eines nachfolgenden, automatischen Statement-Auflösungsschritts, in dem ein neues Übergangs-SQL-Statement dadurch erstellt wird, dass sämtliche im Anwender- SQL-Statement eingesetzten tabellenübergeordneten Wertefelder gegebenenfalls unter Berücksichtigung der mitgegebenen Parameter aufgerufen und durchlaufen werden und das Ergebnis dieser Durchläufe anstelle des jeweils verwendeten tabellenübergeordneten Wertefeld in das ursprünglich angegebene SQL-Statement eingesetzt wird,- Execute a subsequent, automatic statement resolution step in which a new transitional SQL statement is created by calling up and running through all the table-superordinate value fields used in the user SQL statement, taking into account the parameters provided, and using the result of these runs the used table-superordinate value field is inserted into the originally specified SQL statement,
wobei die inneren, gerichteten Entscheidungsgraphen der im angegebenen Anwender-SQL- Statement enthaltenen tabellenübergeordneten Wertefelder erst bei Ausführung des Statement-Auflösungsschritt in Abhängigkeit von den Verarbeitungsbereichen, in denen sie jeweils verwendet werden, für die Verarbeitung herangezogen werden,whereby the inner, directed decision graphs of the table-superimposed value fields contained in the specified user SQL statement do not appear until the execution of the Statement resolution step, depending on the processing areas in which they are used, are used for the processing,
wobei bei Aufruf der tabellenübergeordneten Wertefelder dem sich jeweils über die Auswertung der mitgegebenen Parameter aus dem Anwender-SQL-Statement und/oder der Funktionen ergebenden Entscheidungspfad des inneren, gerichteten Entscheidungsgraphen desselben bis zum Ende gefolgt wird,wherein, when calling the table-superordinate value fields, the decision path of the inner, directed decision graph of the same, which results from the evaluation of the given parameters from the user SQL statement and / or the functions, is followed until the end;
und als Ergebnis eines Aufrufes und Durchlaufens der tabellenübergeordneten Wertefelder die Werte all jener erreichten Entscheidungspositionen zurückgeliefert werden, welche mittels des jeweils zugehörigen Kennzeichens festlegen, dass diese zumindest ein Tabellenfeld, das eindeutig einer der Datentabellen der konkret zugrunde liegenden Datenstruktur zuordenbar ist, enthalten, sowie alle Ergebnisse jener erreichten Entscheidungspositionen, an denen ein tabellenübergeordnetes Wertefeld mit mitgegebenen Parametern durchlaufen wird,and as a result of invoking and traversing the table-superordinate value fields the values of all those reached decision positions are returned, which by means of the respective associated flag specify that they contain at least one table field unambiguously assignable to one of the data tables of the specific underlying data structure and all Results of decision positions reached where a table-superordinate value field with specified parameters is passed through,
und somit ein Übergangs-SQL-Statement zur Verfügung steht, welches gegebenenfalls unvollständige relationenbezogene Operationen enthält,and thus a transient SQL statement is available, which may contain incomplete relationship-based operations,
Automatisches Vervollständigen des Übergangs-SQL-Statements durch Hinzufügen gegebenenfalls fehlender und/oder unvollständiger relationenbezogener Operationen in einemAutomatically completing the transient SQL statement by adding any missing and / or incomplete relationship-related operations in one
Vervollständigungsschritt, wodurch ein endgültiges SQL-Statement erzeugt wird, das von jeder, den SQL-Standard unterstützenden Engine analysiert, optimiert und verarbeitet werden kann.Completion step, which creates a final SQL statement that can be parsed and processed by any SQL standard support engine.
17. Computeφrogramm, das Instruktionen aufweist, die zur Durchführung des Verfahrens nach einem der Ansprüche 1 bis 15 eingerichtet ist.A compute program having instructions adapted to perform the method of any one of claims 1 to 15.
18. Computerprogrammprodukt, welches ein computerlesbares Medium mit Computerprogramm-Code-Mitteln aufweist, bei dem jeweils nach dem Laden des Computerprogramms ein Computer durch das Programm zur Durchführung des Verfahren nach einem der Ansprüche 1 bis 15 veranlasst wird.18. Computer program product which has a computer-readable medium with computer program code means in which, after the loading of the computer program, a computer is caused by the program for carrying out the method according to one of claims 1 to 15.
19. Computerprogrammprodukt, welches ein Computerprogramm auf einem elektronischen Trägersignal aufweist, bei dem jeweils nach Laden des Computerprogramms ein Computer durch das Programm zur Durchführung des Verfahrens nach einem der Ansprüche 1 bis 15 veranlasst wird. 19. Computer program product, which has a computer program on an electronic carrier signal, in each case after loading the computer program a computer is caused by the program for carrying out the method according to one of claims 1 to 15.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/AT2007/000195 WO2008131465A1 (en) | 2007-04-27 | 2007-04-27 | Method for controlling a relational database system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/AT2007/000195 WO2008131465A1 (en) | 2007-04-27 | 2007-04-27 | Method for controlling a relational database system |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2008131465A1 true WO2008131465A1 (en) | 2008-11-06 |
Family
ID=38121941
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/AT2007/000195 WO2008131465A1 (en) | 2007-04-27 | 2007-04-27 | Method for controlling a relational database system |
Country Status (1)
Country | Link |
---|---|
WO (1) | WO2008131465A1 (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110222128A (en) * | 2019-06-12 | 2019-09-10 | 浪潮软件集团有限公司 | A kind of method and device generating data initialization sql |
CN114397967A (en) * | 2022-01-07 | 2022-04-26 | 山东浪潮科学研究院有限公司 | Automatic association method for auxiliary input keywords of database |
CN114397966A (en) * | 2022-01-06 | 2022-04-26 | 山东浪潮科学研究院有限公司 | Keyword error correction prompting method and device for database |
CN114548794A (en) * | 2022-02-25 | 2022-05-27 | 首约科技(北京)有限公司 | Method for improving table processing speed based on dynamic tone |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO1995006292A1 (en) * | 1993-08-25 | 1995-03-02 | Asymetrix Corporation | Method and apparatus for the modeling and query of database structures using natural language-like constructs |
US5987455A (en) * | 1997-06-30 | 1999-11-16 | International Business Machines Corporation | Intelligent compilation of procedural functions for query processing systems |
WO2000063798A1 (en) * | 1999-04-16 | 2000-10-26 | Targit A/S | A method and an apparatus for the processing of queries to a database |
US20040073539A1 (en) * | 2002-10-10 | 2004-04-15 | International Business Machines Corporation | Query abstraction high level parameters for reuse and trend analysis |
EP1585036A2 (en) * | 2004-04-08 | 2005-10-12 | International Business Machines Corporation | Management of parameterized database queries |
-
2007
- 2007-04-27 WO PCT/AT2007/000195 patent/WO2008131465A1/en active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO1995006292A1 (en) * | 1993-08-25 | 1995-03-02 | Asymetrix Corporation | Method and apparatus for the modeling and query of database structures using natural language-like constructs |
US5987455A (en) * | 1997-06-30 | 1999-11-16 | International Business Machines Corporation | Intelligent compilation of procedural functions for query processing systems |
WO2000063798A1 (en) * | 1999-04-16 | 2000-10-26 | Targit A/S | A method and an apparatus for the processing of queries to a database |
US20040073539A1 (en) * | 2002-10-10 | 2004-04-15 | International Business Machines Corporation | Query abstraction high level parameters for reuse and trend analysis |
EP1585036A2 (en) * | 2004-04-08 | 2005-10-12 | International Business Machines Corporation | Management of parameterized database queries |
Non-Patent Citations (4)
Title |
---|
JARKE M ED - KERSCHBERG L UNIVERSITY OF SOUTH CAROLINA: "EXTERNAL SEMANTIC QUERY SIMPLIFICATION: A GRAPH-THEORETIC APPROACH AND ITS IMPLEMENTATION IN PROLOG", EXPERT DATABASE SYSTEMS. KIAWAH ISLAND, SOUTH CAROLINA, OCT. 24 - 27, 1984, PROCEEDINGS OF THE INTERNATIONAL WORKSHOP ON EXPERT DATABASE SYSTEMS, MENLO PARK, CA., BENJAMIN/CUMMINGS, US, vol. WORKSHOP 1, October 1984 (1984-10-01), pages 675 - 692, XP000745618 * |
MITSCHANG B ET AL: "SQL/XNF-Processing composite objects as abstractions over relational data", PROCEEDINGS OF THE INTERNATIONAL CONFERENCE ON DATA ENGINEERING. VIENNA, APR. 19 - 23, 1993, LOS ALAMITOS, IEEE COMP. SOC. PRESS, US, vol. CONF. 9, 19 April 1993 (1993-04-19), pages 272 - 282, XP010095515, ISBN: 0-8186-3570-3 * |
STONEBRAKER M ET AL: "EXTENDING A DATABASE SYSTEM WITH PROCEDURES", ACM TRANSACTIONS ON DATABASE SYSTEMS, ACM, NEW YORK, NY, US, vol. 12, no. 3, September 1987 (1987-09-01), pages 350 - 376, XP000718766, ISSN: 0362-5915 * |
YANNAKOUDAKIS E J ET AL: "A DOMAIN-ORIENTED APPROACH TO IMPROVE THE USER-FRIENDLINESS OF SQL", COMPUTER STANDARDS AND INTERFACES, ELSEVIER SEQUOIA. LAUSANNE, CH, vol. 9, no. 2, January 1989 (1989-01-01), pages 127 - 141, XP000083601, ISSN: 0920-5489 * |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110222128A (en) * | 2019-06-12 | 2019-09-10 | 浪潮软件集团有限公司 | A kind of method and device generating data initialization sql |
CN110222128B (en) * | 2019-06-12 | 2022-10-14 | 浪潮软件集团有限公司 | Method and device for generating data preset sql |
CN114397966A (en) * | 2022-01-06 | 2022-04-26 | 山东浪潮科学研究院有限公司 | Keyword error correction prompting method and device for database |
CN114397967A (en) * | 2022-01-07 | 2022-04-26 | 山东浪潮科学研究院有限公司 | Automatic association method for auxiliary input keywords of database |
CN114548794A (en) * | 2022-02-25 | 2022-05-27 | 首约科技(北京)有限公司 | Method for improving table processing speed based on dynamic tone |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
DE69602364T2 (en) | COMPUTER SYSTEM TO CREATE SEMANTIC OBJECT MODELS FROM EXISTING RELATIONAL DATABASE SYSTEMS | |
DE3855706T2 (en) | Automated invoice of materials | |
DE69424586T2 (en) | Process and system for formulating interactive queries | |
DE69418474T2 (en) | SEMANTIC OBJECT MODELING SYSTEM AND METHOD FOR PRODUCING RELATIONAL DATABASE SCHEMES | |
DE10028688B4 (en) | Method, system, and program for a join operation in a multi-column table and double-valued satellite tables | |
DE69509118T2 (en) | IMPLEMENTATION-INDEPENDENT EXTENDABLE QUERY ARCHITECTURE FOR SYSTEMS FOR INFORMATION RECOVERY | |
DE60002876T2 (en) | PRESENTATION, ADMINISTRATION AND SYNTHESIS OF TECHNICAL CONTENT | |
DE69408337T2 (en) | CONTROL SYSTEM OF A RELATIONAL DATABASE ACCORDING TO AN OBJECT-ORIENTED LOGIC, WHICH REDUCES ACCESSES TO THE DATABASE, AND PROCEDURE | |
DE60004385T2 (en) | METHODS AND SYSTEMS TO MAKE OLAP HIERARCHIES COMBINABLE | |
DE60208778T2 (en) | DATA STRUCTURE FOR INFORMATION SYSTEMS | |
DE69904588T2 (en) | DATABASE ACCESS TOOLS | |
DE3688529T2 (en) | Procedure for refreshing multi-column tables in a relational database with minimum information. | |
EP0910829B1 (en) | Database system | |
DE69232542T2 (en) | Definition change language for a database computer system | |
DE68929132T2 (en) | Database management system and method therefor | |
DE69514123T2 (en) | DATABASE SEARCH SYSTEM | |
WO1997015015A2 (en) | Information system and process for storing data therein | |
DE10103574A1 (en) | Method for executing a statement in a computer to manipulate data in a data store linked to the computer receives the statement with aggregated ratings while searching in a database administration system. | |
DE60300984T2 (en) | Method and computer system for optimizing a Boolean expression for request processing | |
DE10056763B4 (en) | Generate constraint queries using tensor representations | |
EP2021951B1 (en) | Method for controlling a relational database system | |
DE102004043788A1 (en) | Personal computing device executes program based on individual programming code to provide predefined code and to define direct relation between input and output of data by user and attribute of classes in input model | |
DE102012100113A1 (en) | Method, software and computer system for handling accumulated data | |
WO2008131465A1 (en) | Method for controlling a relational database system | |
DE69517887T2 (en) | Method and system for establishing connections in a database system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 07718411 Country of ref document: EP Kind code of ref document: A1 |
|
DPE2 | Request for preliminary examination filed before expiration of 19th month from priority date (pct application filed from 20040101) | ||
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 07718411 Country of ref document: EP Kind code of ref document: A1 |