QBE/OBE: A Language for Office and Business Automation

10
OBE's two-dimensional programming brings new flexibility to nonprogramming computer users. They can quickly learn to compose, edit, format, and distribute letters, reports, and graphs. QBE/OBE: A Language for Office and Business Automation Moshe M. Zloof IBM Thomas J. Watson Research Center The past decade has brought rapid evolution in the computer field. Computers have become cheaper and more available, interactive computing is in use in many businesses, and, perhaps, home computing will become commonplace in the near future. As a result of these de- velopments, a new breed of users is emerging: the nonpro- grammer professional. These users, although profes- sionals in their fields, have neither the desire nor the motivation to formally learn a conventional program- ming language. Typically, professional programmers have provided in- teractive applications for these users in the form of so- called "friendly user interfaces." In most cases, these in- terfaces are based on menu selection options for setting the parameters of prewritten programs. The drawback of such an approach is that it gives so little flexibility to the user. If a user wishes to modify a function or add a new one, he must consult the programmers who maintain the application; the turnaround time for such a request can be weeks or months. Also, the formats of most objects and their attributes are preprogrammed and have little poten- tial for change-users are free only to fill in blank spaces. These users need a powerful tool with which to describe their applications directly to the computer, i.e., an easy- to-use, high-level language that requires a minimum of training, yet is powerful enough to cover facilities for set- ting up and maintaining an entire application. This article is centered on office and business applica- tions. We suggest that the two-dimensional programming approach of the Query-by-Example'4 and SBA78 lan- guages is suitable for nonprogrammers who wish to inter- actively automate their applications. Since the emphasis is on office functions (especially electronic mail), we call the extended version of the Query-by-Example language the Office Procedures by Example, or OBE, language. Works about QBE, OBE, and other relational languages are listed in the references.9-14 QBE is an IBM product released in 1978, in widespread use in areas such as distribution, finance, government, manufacturing, processing, and utilities. It is also used in many IBM locations. At the T. J. Watson Research Center alone, QBE has about 100 applications and over 200 users. OBE, on the other hand, is a research project. An OBE subset running at the Watson Center can compose messages, map data from tables into the body of the messages, send messages to other users, and specify trig- ger conditions. These capabilities will be discussed later in the article. The Query-by-Example data-base management language In the Query-by-Example language we introduced the technology of two-dimensional programming. This unique and novel method of data-base creation and retrieval allows the end user to express, with very few entries, the equivalent of a lengthy conventional-language program. It also gives the user the perception of manually manipu- lating the data base. Consequently, users with no knowl- edge of any formal programming language can, in a mat- ter of several hours of training, formulate QBE programs to retrieve, modify, define, and control the data base. Psychological testing of QBE users has shown it to be a very friendly language."3 Since QBE was released as a product in 1978, we have had many favorable reactions from customers. End users at customer sites learn how to use it in about a day. It is ap- plied to a wide variety of tasks, including accounts 0018-9162/81/0500-0013$00.75 © 1981 IEEE May 1981

Transcript of QBE/OBE: A Language for Office and Business Automation

Page 1: QBE/OBE: A Language for Office and Business Automation

OBE's two-dimensionalprogramming brings new flexibility tononprogramming computer users. They can quickly learn to compose,

edit, format, and distribute letters, reports, and graphs.

QBE/OBE:A Language for

Office and BusinessAutomation

Moshe M. ZloofIBM Thomas J. Watson Research Center

The past decade has brought rapid evolution in thecomputer field. Computers have become cheaper andmore available, interactive computing is in use in manybusinesses, and, perhaps, home computing will becomecommonplace in the near future. As a result of these de-velopments, a new breed of users is emerging: the nonpro-grammer professional. These users, although profes-sionals in their fields, have neither the desire nor themotivation to formally learn a conventional program-ming language.

Typically, professional programmers have provided in-teractive applications for these users in the form of so-called "friendly user interfaces." In most cases, these in-terfaces are based on menu selection options for settingthe parameters of prewritten programs. The drawback ofsuch an approach is that it gives so little flexibility to theuser. If a user wishes to modify a function or add a newone, he must consult the programmers who maintain theapplication; the turnaround time for such a request can beweeks or months. Also, the formats of most objects andtheir attributes are preprogrammed and have little poten-tial for change-users are free only to fill in blank spaces.

These users need a powerful tool with which to describetheir applications directly to the computer, i.e., an easy-to-use, high-level language that requires a minimum oftraining, yet is powerful enough to cover facilities for set-ting up and maintaining an entire application.

This article is centered on office and business applica-tions. We suggest that the two-dimensional programmingapproach of the Query-by-Example'4 and SBA78 lan-guages is suitable for nonprogrammers who wish to inter-actively automate their applications. Since the emphasis ison office functions (especially electronic mail), we call theextended version of the Query-by-Example language theOffice Procedures by Example, or OBE, language.

Works about QBE, OBE, and other relational languagesare listed in the references.9-14QBE is an IBM product released in 1978, in widespread

use in areas such as distribution, finance, government,manufacturing, processing, and utilities. It is also used inmany IBM locations. At the T. J. Watson ResearchCenter alone, QBE has about 100 applications and over200 users.OBE, on the other hand, is a research project. An OBE

subset running at the Watson Center can composemessages, map data from tables into the body of themessages, send messages to other users, and specify trig-ger conditions. These capabilities will be discussed later inthe article.

The Query-by-Exampledata-base management language

In the Query-by-Example language we introduced thetechnology oftwo-dimensional programming. This uniqueand novel method of data-base creation and retrievalallows the end user to express, with very few entries, theequivalent of a lengthy conventional-language program.It also gives the user the perception of manually manipu-lating the data base. Consequently, users with no knowl-edge of any formal programming language can, in a mat-ter of several hours of training, formulate QBE programsto retrieve, modify, define, and control the data base.Psychological testing of QBE users has shown it to be avery friendly language."3

Since QBE was released as a product in 1978, we havehad many favorable reactions from customers. End usersat customer sites learn how to use it in about a day. It is ap-plied to a wide variety of tasks, including accounts

0018-9162/81/0500-0013$00.75 © 1981 IEEEMay 1981

Page 2: QBE/OBE: A Language for Office and Business Automation

payable, vehicle maintenance security, sales and inven-tory analysis, and car pooling.

Examples of QBE operations. Some examples of QBEoperations are shown below and in the appendix. The ex-ample data base is a simplified version of a travel expenseaccount application. It has two tables: TRAVEL, withthe headings NAME, AMOUNT, DATE, and F/D; andEMP, with the headings NAME, LOC, MGR, andDEPT. The TRAVEL table lists employees' names,amounts of travel expenses, and the date of each expense;an F or D in the right-hand column shows whether the tripwas foreign or domestic. The EMP table lists the employ-ees' names, locations, managers, and departments.

Retrieval: simple table selection. Let us start with a sim-ple query to retrieve information from a single table. (Weassume that the data base has been defined and that thedata has been entered.) The task: List the names of all em-ployees who have madmoney spent on each twith a blank table skel

The user then keys thiname field (in this castype in the column hethem automatically.headings, the user novby making the entries

Cross-referencing betweenfields. Suppose a user needsthe names of employees, the amounts of expenses, andthe dates of trips, but only for those employees managedby Lee. This query involves a scan of both the TRAVELand the EMP tables. For this task, two skeletons aredisplayed on the screen and the name fields of both tablesare filled in. The final formulation of this query is asfollows:

TRAVEL NAME AMOUNT DATE

P.N P. P.

EMP NAME MGR

N LEE

le foreign trips and the amount of Redundant columns are erased with a special-functiontrip. Initially, the user is presented key. The example element N in both tables causes theeton displayed on the screen: listings in the NAME fields of the tables to match. That is,

only employees working for Lee will be selected from theEMP table and listed on the TRAVEL table.

______________________ Since the user can scroll the screen up, down, left, andright, program objects need not be displayed simultane-ously on the screen. This allows for programs with manytables, each of which can have up to 100 columns.

e appropriate name into the table Cross-referencing can also occur within a column.,e, TRAVEL). He may now either Consider this task, for example: List the names andeadings or let the system generate amounts for employees who spent more than Lewis on aHaving established the column trip he took on 5/5/79. The formulation is as follows (thev "programs" within the skeleton order of the rows is immaterial):P., P., and F:

TRAVEL NAME AMOUNT DATE F/D

P. P.

TRAVEL NAME AMOUNT DATE

LEWIS AM 5/5/79P. >AM 5/5/79F

The P.'s stand for either print or display and indicatethat the desired outputs are names and amounts. We callthe entry F a constant element; it determines the records(tuples) selection criteria. This query instructs the systemto display the names and amounts from each record suchthat the corresponding F/D column is F. The formulationof this query mimics the way one would manually scan theTRAVEL table to retrieve the desired data.

The example element concept. A fundamental conceptin QBE is the example element variable. Exampleelements are underlined so they can be distinguishedfrom constant elements; X , L M, and 65 are some possi-ble example elements.The example element concept is easy to understand and

covers a wide variety of data-base operations, includingcross-referencing between fields, formulating conditionson field values, moving data from one object to another,deriving new fields, searching out text, and delegatingauthority to groups of users. Examples of these opera-tions follow.

Conditions on field values. The task: List the travelrecords (names and amounts) for trips costing between$500 and $1000. This can be accomplished by specifying acondition expression that includes example elements; acondition box can be displayed upon request:

TRAVEL NAME AMOUNT

P. P.X

CONDITIONS

500<X <1000

Arithmetic condition expressions such as X + Y > 2000,where X and Y are example elements drawn from data-base tables, or logical condition expressions such as(X = (50 or 60)) are also admissible in a condition box.

Data exchange between tables. To collect informationfrom various tables and place it in a new, user-created

COMPUTER

Table Name Fi Id

14

Page 3: QBE/OBE: A Language for Office and Business Automation

table as an output report, a user must map an example ele-ment from the base tables to a new skeleton. Consider thistask, for example: Construct an output table containingthe names, amounts of expenses, and managers of em-ployees who took domestic trips.

TRAVEL NAME AMOUNT F/D

N A IDEMP NAME MGR

M N MR M

EMP I I NAME I AMOUNT I MGRP.N P.A P.MR

The third table is an output table the user creates by map-ping data from the base table. The headings of this tableneed not correspond to the headings of the original tables.

The OBE language

The language for Office Procedures by Example-OBE-is a superset and natural extension of the Query-by-Example data-base management language. It repre-sents an attempt to combine subsets ofsuch computer do-mains as word processing (including edit and format),data processing, electronic mail, report writing, graphics,security features, and application developments within asingle interface (Figure 1).The approach ofOBE is the same as that ofQBE: direct

programming within two-dimensional pictures of busi-ness objects. The user of QBE requires very little addi-tional training to be able to use OBE.

Objects and their operations. While the fundamentaldata object in QBE is the table, in OBE the objects aremore general and include letters, forms, reports, charts,graphs, and audio documents. These objects are repre-sented on the screen, which the user can scroll in all direc-tions; thus, many objects can be processed simultaneous-ly even though they are not all shown on the screen atonce.The main innovation of OBE is that the end users

themselves create (define) the objects on the two-dimensional display in much the same way they createthese objects manually on paper. This contrasts with con-ventional systems, in which objects are usually predefinedby the application programmers. Furthermore, since theQBE data-base management system is its base compo-nent, users can easily extract data from the data base andmap it into the body of the objects. Objects can also beedited and sent through a communication subsystem toother nodes by specifying the recipient users' IDs. Thedistribution list can be either static (i.e., predefined, suchas a list of all managers) or dynamic (such as a list of allemployees who did not submit expense accounts in theprevious month). The distribution list is found auto-matically by issuing a query to the data base at the time ofthe distribution.Another fundamental feature of OBE is that the users

can express various trigger conditions. When activated,these result in an action or several actions. For example,one could compose a message to be sent to managers onlyif they exceed their budgets. This would require the sys-tem to evaluate the data base frequently, to check for ex-ceeded budgets. If an exceeded budget is discovered, atrigger is activated and a message sent.The data base is a key OBE component. It participates

in all stages of the system: creation, editing, distribution,and trigger checking (see Figure 2).

OBE examples. The versatility of OBE is illustrated inthe examples that follow.

Letter and report composition. In composing letters orreports, data must often be mapped from the data base to

Figure 1. The relationship of varied functions to OBE. Figure 2. System configuration.

May 1981 15

Page 4: QBE/OBE: A Language for Office and Business Automation

the body of these objects. For example, suppose thatmanager Lee wishes to send a letter to each of hisemployees to inform them of his impending vacation. Thenames and locations of Lee's employees must be ex-

tracted from the EMP table and moved to the body of theletter. This is achieved in OBE by mapping appropriateexample elements in much the same way that data is

Figure 3. Letter composition program. The mapping spec-ification is achieved implicitly by linking the exampleelements N and L . Since the letter has just been written,the N andL at its upper left indicate that those datafields must be mapped from the EMP table to the body ofthe letter. (The completed version of this program isshown below in Figure 6).

Figire 4. Report composition program. The name andlocation of each employee is mapped into the report viathe example elements N and L ; trips are mapped via theexample elements AM and DA.

mapped from one table to another. The composition ofthe letter is as shown in Figure 3.At this point a letter has been composed for each em-

ployee. The body of the text might include other exampleelements, which could move more data from the database. In addition, the editor and the formatter used incomposing the letter could process these exampleelements before formatting takes place. (The mechanismby which the letters are sent will be shown later, when thecommunication subsystem is described.)The same concept is used in creating various types of

reports. For example, every employee could be sent areport listing the dates and amounts spent on his domesticbusiness travel, as shown in Figure 4.A form or a report can be stored in the system the same

way a table is stored-by assigning a unique name to itand saving it in the system. Since a saved form or reportcan be queried the same way a data-base table is queried,one can regard the form as a different view of the database. For example, one can issue the following query,which will display only Henry's expenses dated after6/6/80.

TO: HENRYLOC:

AMOUNT DATE

P. >6/6/80

Composition ofgraphs. Example element mapping canalso be used to generate graphs. Consider a table that liststhe earnings of various companies by calendar year on in-

Figure 5. Here each company name is mapped to aseparate report. The x-y coordinates are called YEAR andEARNINGS, respectively, and their values are mapped viathe example elements YR and E. The system adjuststhe scale of the coordinates to take full advantage ofavailable space.

COMPUTER

EMP NAME LOC MGR

N L LEE

NAME: NLOC: LSubject: Vacation plans

This is to inform you that I'llbe going on vacation from 5/5/79 toand including 5/15/79. David Joneswill be acting manager in my absence,and all questions should be directed to him.

Earl Lee

TRAVEL NAME AMOUNT DATE F/DN AM

JAD

EMP NAME LOC

N.

TO: NLOC: L

The following is a listing of thearnounts and dates of your domestic trips:

AMOUNT DATE

AM DA

COMPANY NAME EARNINGS YR

G.N E YR

COMP.NAME: N

EARNINGSE Y

I- I I IIII YRYEAR

16

Page 5: QBE/OBE: A Language for Office and Business Automation

dividual reports under the headings of COMPANY,NAME, EARNINGS, and YR.The formulation for a report for each company that

contains its year-by-year earnings is shown in Figure 5.

Communication subsystem. Distribution of the above-described objects to various nodes of the system (such asnearby or remote offices or departments) requires a com-munication subsystem. For each node ofthe system, thereis a local data base with the ability to access centrallyshared data bases. Objects can be sent in the OBElanguage by an S. command followed by the object name,the keyword TO, and the destination ID. For example,the formulation below sends object A (a letter, a report,or a graph) to the ID Henry.

When an example element is used as an ID, it defines agroup of receivers determined by a query expression. Thatis, it defines a dynamic distribution list. For example,Lee's letter concerning his vacation could be sent to all hisemployees by the expression shown in Figure 6.

Receiving objects. To keep track of received objects,the system maintains a log called MAIL, which containsthe following headings:

MAIL FROM TO OBJECT DATE CLASS. T~~~~~~~~~~~~

When a send operation is executed, the system automati-cally enters a record in the MAIL table that indicates towhom and from whom the object was sent, as well as theobject name, classification, etc. If an example element isused as a sender ID, more than one record is entered.The MAIL table is accessible to all users, but various

authority statements restrict the access to particularsubsets of it. For example, one can issue an authoritystatement restricting a user to reading only his own mail.

Triggers. A feature of fundamental importance to of-fice and business automation is the ability of the system toact automatically when specified conditions are met. Thisallows the user to automate many routine business pro-cedures and devote his time to more advanced tasks. Thefollowing is a list of actions one may want to automate.

* Deferred messages: e.g., a prestored message or areport to be sent at a predetermined date or frequency.

* Objects to be automatically sent if a condition is metin the data base: e.g., prestored messages that areautomatically sent to managers who exceed theirtravel budgets.

* Follow-up procedures: e.g., an alert message auto-matically sent to a user if a piece of outside corre-spondence is not answered within two weeks.

* Acknowledgments.* Update of the data base: e.g., automatic raises in the

budgets of individual managers by an amount in-dexed to raises in the overall program budget.

* Creation of logs: e.g., insertion of the name and ad-dress on every outgoing letter into a predefined maillog table.

* Inventory replenishment: automatic sending of areorder message to the order department when thequantity of a stock item descends below a certainlevel.

Most of the above procedures can be automated withtrigger expressions.

Trigger expressions. A trigger expression is defined as alabeled QBE expression that activates either an action oranother trigger expression when certain conditions aremet. A trigger expression is evaluated either upon mod-ification of the data base or on the basis of time (i.e., atspecified times and dates or at specified intervals).The syntax of a trigger expression consists of the iden-

tifier TR followed by a trigger name (trigger names areunique within a single user ID). TRl and TRABC are ex-

Figure 6. Object distribution program. The example ele-ment N is used as a destination address. This causeseach of Lee's employees to receive a letter personally ad-dressed with his name and location.

May 1981

A

S. ATO HENRY

EMP NAME LOC MGR

N L LEE

A

NAME: NLOC: L

Subject: Vacation plans

This is to inform you that I'll begoing on vacation from 5/5/79 to andincluding 5/15/79. David Jones willbe acting manager in my absence, andall questions should be directed to him.

Earl Lee

S. A TON

17

Page 6: QBE/OBE: A Language for Office and Business Automation

Figure 7. Possible sequences of a trigger activation.

Figure 8. Trigger program. The quantity of pens in stock Isevaluated daily; If found to be less than 500, TRI activatesand causes the object ORDER to be sent to Henry, the IDresponsible for Issuing purchase orders.

Figure 9. Weekly expense report program. A program called REPORT(the choice of the word is arbitrary) produces a hard-copy listing of themanagers' names and their expenses to date. (The AO. function sortsthe list into alphabetical order by manager names, and the commandPRINTER produces the hard copy.) The second statement, at the bot-tom of the figure, executes this program weekly.

amples of valid trigger identifiers. Triggers can havevarious parameters to indicate the frequency with whichcorresponding QBE expressions are to be evaluated.

There are two types of parameters. Modification trig-gers are evaluated upon a change in the data base. For ex-ample, TRI(D.) means "evaluate trigger expression Iupon deletions," and TR2(I.,U.) means "evaluate triggerexpression 2 upon insertions or updates." Time triggersare evaluated at a specified time and date or at a specifiedtime frequency. For example, TR5(4.00,5/5/79) means"evaluate trigger expression 5 on 5/5/79 at 4 p.m.," andTR6(DAILY) means "evaluate trigger expression 6daily." Four keywords can be used to specify frequency:HOURLY, DAILY, WEEKLY, and MONTHLY. If a

trigger expression has no parameters (e.g., TR7 standingalone), it is evaluated when the stored program containingthis trigger expression is executed.A trigger is said to be activated if its corresponding

QBE expression is satisfied. As mentioned above, when atrigger is activated it causes either an action or the evalua-tion of another trigger expression. That is, a trigger can bea parameter of another trigger (see Figure 7). The leavesof the tree in Figure 7 must always represent actionsbecause activation of a trigger without subsequent effectis meaningless.

Actions. The following actions can take place upon theactivation of triggers:

r DISPLAYINSERT /UPDATE DATA OBJECTSDELETESEND JEXECUTE PROGRAM OBJECTS

The syntax to carry out these operations is:

P

(I )

U ts (TRI AND/OR TR2.

SEND\EXECUTE

Thus, I(TRI). will insert records in the correspondingtable only if trigger I is activated; SEND(TR5 or TR6).Awill send the object A only if either trigger 5 or trigger 6 isactivated; and EXECUTE(TR8).ABC will execute theprogram ABC only if trigger 8 is activated.

Examples of trigger programs. Consider an INVEN-TORY table that lists items and their quantities (Figure 8).Suppose Lee wants to formulate a trigger program toautomatically instruct the order department to purchasepens when the number of pens in stock drops to below500. Further, he wants to evaluate this condition daily.The formulation of such a program is shown in Figure 8.

Application development

The OBE features and facilities described in the pre-vious section will be used here to show that one can write

COMPUTER

INVENTORY ITEM QUANTITY

PEN < 500

S(TRI).ORDER TO HENRY

REPORT]BUDGET MGR BUDGETAMT EXPENSESTODATE

P.AO. P.

COMMANDS

PRINTER

EXECUTE (WEEKLY). REPORT

TRI(DAILY) I

.... . . .... ).-

Page 7: QBE/OBE: A Language for Office and Business Automation

an entire application to automate various business and of-fice procedures. Although the following application issimple, it demonstrates the generality of the language.

An example application. The application deals with themanagement of travel expense budgets and accounts. Letus assume that in a certain organization the budget fortravel is allocated by managers. Information about thisbudget is maintained in a table called BUDGET, whichhas the following column headings: BUDGET, MGRNAME, BUDGET AMOUNT, and EXPENSES TODATE. Let us further assume that a record of any tripmade by employees is entered in a table called TRAVEL 1,

under these headings: TRAVELl, E NAME, MGR,AMOUNT, and DATE. (ENAME stands for the name ofthe employee.)

This data base can be used to write the following high-level programs:

* a program to issue weekly reports of each manage-

ment group's expenses to date, stored alphabeticallyby manager name (Figure 9);

* a program for updating the EXPENSES TO DATEcolumn of the BUDGET table on a daily basis(Figure 10); and

* a trigger program to check the data base on a weeklybasis and send messages only to managers who ex-

ceed their budgets. These messages inform themanagers of their expenses to date (Figure 1).

These three programs illustrate the expressive power ofOBE. Of course, more complex programs, involvingmany more tables, conditions, triggers, and messages,

can be written.

In summary, the QBE/OBE language is well suited tooffice automation because the communication subsystemand the triggers make it possible for the user to distributeand receive electronic mail, subject to conditionsspecified by the user and stored in the data base.

Perhaps of even greater importance to the language'ssuitability to the office environment are those attributesthat impact the system's relationship with the user. Al-though it is a programming language, its two-dimensionalnature gives the user a sense of manually manipulatingobjects. Further, QBE/OBE gives the user considerablefreedom in composing programs because the order inwhich specifications are entered is immaterial. Finally,the most important attribute of QBE/OBE is that it re-

quires the user to master only a few relatively simple con-

cepts. This not only means that the system can be up and run-

ning quickly, but that users can set up their own applicationswithout too much dependence on DP personnel.

Appendix-more QBE examples

This appendix contains more examples of Query-by-Example, to provide an overview of its main facilities.There are, however, many more features (such as table

May 1981

definition and snapshot definition) that are not il-lustrated. For further information on QBE, see referencesone through seven.

Figure 10. Program for daily update of expenses. BU (budget update)sums, for each manager, the amounts spent by his employees and up-dates EXPENSES TO DATE field accordingly. The second statement-EXECUTE (DAILY). BU-executes this program on a daily basis.

Figure 11. Message-sending program. The trigger TRI attached to theBUDGET table checks daily for over-budget expenses (specified bythe condition E > B). If that condition occurs for one or moremanagers, the trigger activates and sends the object MESSAGE(again, the name MESSAGE is arbitrary). Note that the body of themessage contains example elements that allow each manager toreceive a unique message that reports the amount by which he has ex-ceeded his budget.

19

EXECUTE (DAILY). BU

BUDGET MGR BUDGETAMT EXPENSESTODATE

TRI (DAILY) M B E

CONDITIONS

E >B

MESSAGEDear M:

This is to inform you that you have exceeded your budgetamount of B by (E - B ). Please see me regarding this matter.

COMMANDS

S(TRI). MESSAGE TO M

Page 8: QBE/OBE: A Language for Office and Business Automation

Text search. In QBE, an entry to a field may be a longstring of text, such as comments or article content. Some-times it is desirable to search that text for specific words.This can be done by underlining parts of the string,rendering it partially constant and partially variable. Sup-pose, for example, we had a COMMENT column in theTRAVEL table and wish to scan it for the word TEXAS.To do this, we formulate the following table:

TRAVEL NAME AMOUNT COMMENTS

P. P. X TEXAS Y

This table means: List names and amounts for recordswith the word TEXAS in the COMMENTS column.

Built-in functions and groupings. There are five built-in functions in QBE: CNT., SUM., AVG., MAX., andMIN. These functions operate on sets of values specifiedby the ALL. operator. Thus, to total the expenses of aparticular employee, say, Smith, we formulate the follow-ing table:

TRAVEL NAME AMOUNT

SMITH P.SUM.ALL.

The operator G. groups records by field values. This isillustrated in the next table, which totals expenses for eachemployee:

TRAVEL NAME AMOUNT

P.G. P.SUM.ALL.

EMP NAME MGR

N SMITHN U.LEWIS

Control. Control ofthe data base is defined as the abili-ty to protect (secure) the data base from unauthorizeddisclosure, alteration, or destruction, as well as the abilityto ensure the integrity of the data base from the insertionof incorrect data.

Security precautions in QBE are very elaborate andcover a wide range of options. The creator of a table can,for example, give read, insert, delete, and update optionsfor either an entire table or a subset of a table that is de-fined by any query expression. In addition, he candelegate authority to a group of users defined by yetanother query expression.

Security statements. So business professionals can for-mulate this wide range of security statements without theaid of a programmer, we introduce very little new syntax.Instead, we retain (as much as possible) the syntax andconcepts used for other operations.A security statement is comprised of two parts. The

first consists of an authority keyword applied to the rowof a table that includes the delegated authority level (read,insert, delete, update, or any combination), followed bythe ID of the user to whom the authority is delegated. ThisID can be either a constant element representing one useror an example element representing a group of users. Ex-amples of authority keywords are: AUTH(P.)HENRY,which delegates read authority to the user ID Henry; andAUTH(P.,I.)X , which delegates read and insert authori-ty to a group determined by the example element X.The second part of a security statement is a QBE ex-

pression that determines which subset of the table theusers may access.

Here the G. operator partitions the table by identicalname values, and the SUM.ALL. sums the amounts foreach name.

Modification. Data-base modifications are performedin the same style as data retrievals, but the operators I.,D., and U. correspond to insertions, deletions, or up-dates. The user can employ any admissible query expres-sion to select the records to be inserted, deleted, or up-dated. For example, the following inserts a new record in-to the TRAVEL table:*

TRAVEL NAME AMOUNT DATE F/D

I. HENRY 560.50 6/8/79 D

Suppose manager Smith is replaced by manager Lewis.The following table updates the MGR column of all ofSmith's former employees:

*I. is used here as shorthand for prefixing every entry with 1.

EMP NAME LOC MGR. DEPT

AUTH(P.)HENRY N L M B

The above expression delegates authority to Henry toread only (specified by the P.) records of department B.The omission of an example element from a field preventsthe user from reading information from this field. For ex-ample, if we omit the L under the LOC heading, Henrywill not be given the employees' locations.

TRAVEL NAME AMOUNT DATE F/D

AUTH(P.,I.)JONES N A D F

NAME MGR

N JONES

COMPUTER20

Page 9: QBE/OBE: A Language for Office and Business Automation

The statement above delegates to Jones the authority toread and insert (but not update or delete) records of hisemployees only. The point here is that any QBE expres-sion can be used to select records, provided that the prop-er authority has been delegated.

To delegate authority to a group of users, we use an ex-ample element as an ID and define the group by linkingthis example element to other fields. For example, togeneralize the last formulation we can use an example ele-ment instead of Jones:

TRAVEL NAME AMOUNT DATE F/D

AUTH(P.I.)X N D F |

EMP NAME MGRN X

Here the ID is the example element X , which is linked tothe MGR field of the EMP table. This means that everymanager will be able to read and insert records of onlythose employees under his supervision.An authorized user can insert, delete, retrieve, or up-

date any authority statement simply by prefixing it withI., D., P., or U., respectively.

Integrity constraints. Various integrity constraintsagainst the tables can be formulated to ensure the integri-ty of the data base. Like security statements, integrityconstraints are specified by a constraint keyword appliedto a QBE expression in a skeleton table. With this key-word and the standard QBE expressions, the user cancover a wide variety of integrity constraints, including

* static constraints,* transitional constraints,* constraints enforced only upon the occurrence of a

certain storage operation (e.g., upon deletions),* constraints enforced only upon certain condition(s)

(e.g., only employees from department A can haveoffices on the second floor),

* constraints against single elements, and* constraints against a set of elements.

Integrity constraints keywords start with the wordCONSTR followed (if necessary) by the operation re-quired for the constraint to be enforced. ThusCONSTR(I.) ensures the validity of the data base onlyupon insertion, and CONSTR(I.,U.) ensures the validityof the data base only upon insertion or update. The for-mulations below are examples of constraint expressions.

TRAVEL NAME AMOUNT DATE F/D

CONSTh(I.,U.)

CONDITIONS

X =(FORD)Y >9/30/79

Y X

May 1981

I

l~~ IE COMPUTERt ~SCIENCE

-PRESSiF,~~~~~~~~~~~

PRINCIPLES OF FIRMWARE ENGINEERINGIN MICROPROGRAM CONTROL

Michael AndrewsThis comprehensive new book describes algorithmicdesign procedures for digital machines, with emphasis oncontrol at the microprogram level. Actual microcon-trollers are discussed in detail. $22.95, ISBN0-914894-63-3.

INTRODUCTION TO COMPUTERORGANIZATION

Ivan TomekThis book presents a thorough treatment of computerhardware, including logic design and computer organi-zation. A computer hardware simulation programwritten in Pascal and a student workbook are available.$21.95, ISBN 0-914894-08-0. Workbook, $7.50, ISBN0-914894-70-6.

INTRODUCTION TO COMPUTER DESIGNAND IMPLEMENTATIONS.I. Ahmad and K.T. Fung

A comprehensive new book which includes all essentialaspects of computer hardware design and implemen-tation. Ideal for classroom use as well as for self-study byprogramming and computer engineers. $19.95, ISBN0-914894-11-0.

COMPUTER SYSTEMS ARCHITECTUREJean-Loup Baer

A comprehensive treatment of computer architecturefrom the introductory level through advanced researchconcepts. The book begins with a historical survey andculminates with a consideration of probable futuretrends. $24.95, ISBN 0-914894-15-3.

COMPUTER LOGIC,TESTING, AND VERIFICATION

J. Paul RothRevolving around the cubical algebra, this text presentsa unified treatment of computer logic minimizationtechniques, testing of logic circuits, and verification ofboth hardware and software. $24.95, ISBNO-914894-62-5.

RELIABILITY AND MAINTAINABILITYOF ELECTRONIC SYSTEMS

Edited by J. E. Arsenault and J. A. RobertsThe broadest and most thorough treatment of realiabilityand maintainability available in a single volume, thisbook brings together theory and techniques provenuseful in practice. $31.95, ISBN 0-914894-24-2.

Complimentary examination copies available to faculty members.All prices are subject to change without notice. Postage andhandling charge of $1.25 per book on all orders. Residents ofMaryland add 5% sales tax.

COMPUTER SCIENCE PRESS, INC.DEPT. C 11 Taft Court

Rockville, Maryland 20850 (301) 251-9050

Reader Service Number 5

j\y.

r

I

Page 10: QBE/OBE: A Language for Office and Business Automation

The above constraint ensures that the F/D will consistof either F or D entries and that the DATE is later than9/30/79.

EMP NAME MGR

CONSTR ALL.Z G.M

CONDITIONS

CNT.ALL.Z c10|

This constraint ensures that a manager cannot havemore than 10 employees.

References

1. M. M. Zloof, "Query-by-Example: A Data Base Lan-guage," IBM Systems J., Vol. 16, No. 4, 1977, pp.324-343.

2. M. M. Zloof, "Query-by-Example," AFIPS Conf. Proc.,1975 NCC, pp. 431-438.

3. M. M. Zloof, "Query-by-Example: The Invocation andDefinition of Tables and Forms," Proc. Int'l Conf. VeryLarge Data Bases, Sept. 1975, pp. 1-24.

4. M. M. Zloof, "Query-by-Example: Operations on theTransitive Closure," IBM Research Report RC 5526, IBMThomas J. Watson Research Center, Yorktown Heights,N.Y., 1975.

5. M. M. Zloof, "Security and Integrity Within the Query-by-Example Data Base Management Language," IBMResearch Report RC 6982, IBM Thomas J. WatsonResearch Center, Yorktown Heights, N.Y., 1978.

6. The QBE Terminal User's Guide, SH20-2078, IBMMarketing.

7. M. M. Zloof and S. P. deJong, "The System for BusinessAutomation (SQA): Programming Language," Comm.ACM, Vol. 20, No. 6, 1977, pp. 385-396.

8. S. P. deJong and M. M. Zloof, "Communication Withinthe System for Business Automation (SBA)," IBMResearch Report RC 6788, IBM Thomas J. WatsonResearch Center, Yorktown Heights, N.Y., 1976.

9. D. Tsichritzis, "OFS: An Integrated Form ManagementSystem," Proc. VLDB Conf., 1980, pp. 161-166.*

10. H. L. Morgan, "The Future of Office of the Future,"Office Automation Conf. Digest, AFIPS Press, Roslyn,Va., 1980.

11. M. Hammer et al., "Laboratory for Computer ScienceProgress Report: Office Automation Group," MITLaboratory for Computer Science, Cambridge, Mass.,1979.

12. C. Ellis and G. Nutt, "Computer Science and OfficeInformation Systems," Report SSL-79-6, Xerox Palo AltoResearch Center, Palo Alto, Calif., June 1979.

13. J. C. Thomas and J. D. Gould, "A Psychological Study ofQuery-by-Example," AFIPS Conf. Proc., 1975 NCC, pp.439-445.

14. Chamberlin et al., "SQL2: A Unified Approach to DataDefinition Manipulation and Control," IBM J. Researchand Development, Vol. 20, No. 6, 1976.

15. E. F. Codd, "A Data Base Sublanguage Founded on theRelational Calculus," Proc. ACMSIGFIDET Workshop,1971.

16. M. R. Stonebraker, "Getting Started in INGRES-ATutorial," Report ERLM 518, Computer Science Dept.,University of California, Berkeley, Calif., 1975.

*These proceedings available from the Order Desk, IEEE ComputerSociety, 10662 Los Vaqueros Circle, Los Alamitos, CA 90720.

Moshe M. Zloof is a member of the com-puter science research staff at IBM'sThomas J. Watson Research Center. He iscurrently the manager of the Office Auto-mation Project, in which OBE is beingdeveloped. Prior to this, he held the posi-tion of technical assistant to the director ofcomputer sciences at the Watson Center.He joined IBM in 1972 to work in biomed-ical applications; in late 1973, he joined a

project on small business machines. Since then, he has conceivedand developed the Query-by-Example programming language.Before coming to the US for advanced study, he owned andoperated a public works construction company in Tel Aviv,Israel.

Zloof attended the Technion Institute of Technology inHaifa, Israel, where he received the BS degree in mechanicalengineering in 1959. He holds a PhD in bioengineering, grantedfrom the University of California, Berkeley, in 1972.

COMPUTER

DAN MEAGHERKNOWS IT ALL.He knows where the best openings are in

New England and around the U.S. He knows thedecision makers who can provide quick feed-back on your resume and he knows how to pre-sent your resume so that it will get the attentionit deserves. He knows a good offer from a badone and he'll work hard to get you the best offerhe can.

Dan is a Professional Counselor with E.P.Reardon Associates, one of New England's mostprestigous professional placement firms. Hespecializes in placing Engineering and ScientificSoftware Professionals in the following areas:

Operating Systems NetworkingComputer Architecture DiagnosticsInteractive Graphics SimulationLanguage Development ModelingPeripherals Compiler DevelopmentCAD/CAM Data CommunicationsData Base Construction and Maintenance

To find out how Dan can help you, call himtoday at (617) 329-2660 or send him your resumeat the address below.

r- t^afO#4sO _88 Washington Street, P.O. Box 228, Dedham, Mass. 02026

Clients are EOE.