The following page is an edited snapshot of a LEAP session. It attempts to give you a brief introduction to what LEAP is like. There is, however, no substitute to the real thing.
Comments are in bold.
Your attention is drawn to some of the new features and differences in LEAP 1.2 by highlighting items in RED.
Taken from LEAP version 1.2, running on a Solaris 5.5.1 Ultra-1 (300Mhz Ultra sparc CPU).
Script started on Thu May 28 21:49:22 1998
Invoke LEAP with a simple command:
cs3% leap
LEAP 1.2 - An extensible and free RDBMS
Copyright (C) 1997, 1998 Richard Leyton.
LEAP comes with ABSOLUTELY NO WARRANTY; for details type "warranty".
This is free software, and you are welcome to redistribute it
under certain conditions; type "copying" for details.
[NON-FATAL] #2 - Error opening file [./configs/vars].
Message: No variables set!
Message: Directory specified [./] not valid. Trying [../]
Message: Variables are now set.
Message: LEAP is starting...
Message: Opening [tempdb] database...
Message: Creating hash table for [zzbdqc].
Message: Opening [master] database...
Message: Opening [user] database...
Message: Startup sequence initiated.
Message: Sourcing startup.src in master
[user] :-) Message: Sourcing open.src in user
[user] :-)
[user] :-)
Display the status of the various settings... New settings are highlighed
[user] :-) status
program :LEAP
version :1.2
last :zzawmc
currentdb :user
trace :off
debug :off
timing :off
case :off
quiet :off
temporary :on
timelog :on
long :off
padding :off
width :auto
tempdb :on
productjoin :off
Change databases... (Note 1.2 isn't as verbose as earlier releases)
[user] :-) use date
Message: Updating Hash Tables:
leapattributes leaprel leapscripts leaptypes relship
Message: Disposing relations
Message: Opening [date] database...
Message: Creating hash table for [zzdgot].
[date] :-) > This is the Date database. Examples are taken from
[date] :-) > 'An introduction to database systems' by C.J.Date
[date] :-)
List available relations (This is actually querying the leaprel relation)
[date] :-) list
NAME
-------------------------------------------------------------------------------
leaprel
leapattributes
leaptypes
relship
leapscripts
zzdgot
zzwumw
a
b
dend
dor1
dor2
dor3
p
s
sp
Message: Relation zztsyu returned.
List the sourc programs...
[date] :-) sources
Source files:
-------------
open
datd1
datd2
dati1
datu1
closure
project
rename
product
select
njoin
ex661
tjoin
a_div
te_div
ex662
b_div
c_div
Inspect the source programs
[date] :-) l datd1
Source File: datd1
------------------
# This example is taken from DAT90.
# Note that DIFFERENCE and MINUS are the same.
datd1=(a) difference (b)
print datd1
[date] :-) l datd2
Source File: datd2
------------------
# This example is taken from DAT90.
# Note that DIFFERENCE and MINUS are the same.
datd2=(b) minus (a)
print datd2
Print one or two of the relations in the programs so you can work out the result yourself, if you like!
[date] :-) print a
s sname status city
-------------------------------------------------------------------------------
S1 SMITH 20 LONDON
S4 CLARK 20 LONDON
Message: Relation a returned.
[date] :-) print b
s sname status city
-------------------------------------------------------------------------------
S1 SMITH 20 LONDON
S2 JONES 10 PARIS
Message: Relation b returned.
Execute the scripts...
[date] :-) @ datu1
[date] :-)
[date] :-)
[date] :-) datu=(a) union (b)
Message: Relation datu returned.
[date] :-) print datu
s sname status city
-------------------------------------------------------------------------------
S1 SMITH 20 LONDON
S4 CLARK 20 LONDON
S2 JONES 10 PARIS
Message: Relation datu returned.
[date] :-)
[date] :-) @ datd1
[date] :-)
[date] :-)
[date] :-) datd1=(a) difference (b)
Message: Relation datd1 returned.
[date] :-) print datd1
s sname status city
-------------------------------------------------------------------------------
S4 CLARK 20 LONDON
Message: Relation datd1 returned.
[date] :-)
[date] :-) list
NAME
-------------------------------------------------------------------------------
leaprel
leapattributes
leaptypes
relship
leapscripts
zzdgot
zzwumw
a
b
dend
dor1
dor2
dor3
p
s
sp
datu
datd1
Message: Relation zzsdxw returned.
Note the reduction in the number of 'temporary' relations (zzxxxx), they're all now stored in tempdb if the tempdb setting is on.
Change databases to the stanczyk database...
[date] :-) use stanczyk
Message: Updating Hash Tables:
a b datd1* datu* dend dor1 dor2 dor3 leapattributes leaprel leapscripts leaptypes p relship s sp
Message: Disposing relations
Message: Opening [stanczyk] database...
Message: Creating hash table for [zzkoqt].
[stanczyk] :-) > This is the Stanczyk database. Examples are taken from
[stanczyk] :-) > 'Theory and Practice of relational databases'.
[stanczyk] :-) > This database has a number of useful examples that
[stanczyk] :-) > clearly demonstrate the relational algebra.
[stanczyk] :-)
List the relations and source in this db.
[stanczyk] :-) list
NAME
-------------------------------------------------------------------------------
leaprel
leapattributes
leaptypes
relship
leapscripts
zzkoqt
zzmczq
auction
book
delivery
ex_auth
ex_book
ex_publi
example
goods
index
lc
names
q
r
s
stock
subject
Message: Relation zzojmo returned.
[stanczyk] :-) sources
Source files:
-------------
open
disp_ex
ex4_1_a
ex4_1_b
ex41a
ex41b
ex42
ex43
ex45
q4_3_3
q4_3_4
q4_3_5
q431
q432
q433
divide
ex44
Do a few examples..
[stanczyk] :-) l ex41a
Source File: ex41a
------------------
# This example is taken from STA90, and is given in the infix form
# Example 4.1 (a)
r1=project (book) (author)
print r1
[stanczyk] :-) @ ex41a
[stanczyk] :-)
[stanczyk] :-)
[stanczyk] :-) r1=project (book) (author)
Message: Relation r1 returned.
[stanczyk] :-) print r1
author
-------------------------------------------------------------------------------
JOYCE
GREENE
ORWELL
LEM
GOLDING
KING
HEMINGWAY
Message: Relation r1 returned.
[stanczyk] :-)
Here's a more complex expression...
[stanczyk] :-) l ex4_1_a
Source File: ex4_1_a
--------------------
# This example is taken from STA90
# Exercise 4.1 (a) Page 81 & 159
project (select (ex_book) (pname='PITMAN')) (title)
[stanczyk] :-) print ex_book
title aname pname
-------------------------------------------------------------------------------
THEORY AND PRACTICE STANCZYK PITMAN
SQL STANCZYK PITMAN
PROGRAMMING IN B PASCAL PALMER SYBEX
DATABASE SYSTEM CONCEPTS KORTH MCGRAW
FRENCH PROGRAMMING SMITH MIT PRESS
A GUIDE TO DB2 JONES MIT PRESS
Message: Relation ex_book returned.
[stanczyk] :-) @ ex4_1_a
[stanczyk] :-)
[stanczyk] :-)
[stanczyk] :-) project (select (ex_book) (pname='PITMAN')) (title)
Message: Relation zzcakc returned.
Without an assignment of the result, a random name is assigned. But the @last variable holds the last relation returned...
[stanczyk] :-)
[stanczyk] :-) print @last
title
-------------------------------------------------------------------------------
THEORY AND PRACTICE
SQL
Message: Relation zzcakc returned.
Here's an even more complex expression with several levels of nesting.
[stanczyk] :-) l ex4_1_b
Source File: ex4_1_b
--------------------
# This example is taken from STA90.
# Exercise 4.1 (b) Pages 81 & 159
project(join (project( select (ex_book) (pname='MIT PRESS'))(aname) ) (ex_auth) (aname=ex_auth.aname)) (specialism)
[stanczyk] :-) print ex_book
title aname pname
-------------------------------------------------------------------------------
THEORY AND PRACTICE STANCZYK PITMAN
SQL STANCZYK PITMAN
PROGRAMMING IN B PASCAL PALMER SYBEX
DATABASE SYSTEM CONCEPTS KORTH MCGRAW
FRENCH PROGRAMMING SMITH MIT PRESS
A GUIDE TO DB2 JONES MIT PRESS
Message: Relation ex_book returned.
[stanczyk] :-) print ex_auth
aname address specialism
-------------------------------------------------------------------------------
SMITH OXFORD FRENCH
JONES BIRMINGHAM LAW
STANCZYK OXFORD DATABASES
PALMER USA PROGRAMMING
KORTH USA DATABASES
Message: Relation ex_auth returned.
[stanczyk] :-) @ ex4_1_b
[stanczyk] :-)
[stanczyk] :-)
[stanczyk] :-) project(join (project( select (ex_book) (pname='MIT PRESS'))(aname) ) (ex_auth) (aname=ex_auth.aname)) (specialism)
Message: Relation zzttdb returned.
[stanczyk] :-)
[stanczyk] :-) print @last
specialism
-------------------------------------------------------------------------------
FRENCH
LAW
Message: Relation zzttdb returned.
[stanczyk] :-) status
program :LEAP
version :1.2
last :zzttdb
currentdb :stanczyk
trace :off
debug :off
timing :off
case :off
quiet :off
temporary :on
timelog :on
long :off
padding :off
width :auto
tempdb :on
productjoin :off
How long are the expressions taking to execute??
[stanczyk] :-) set timing on
Logical Reads: 0
Physical Reads: 0
Writes: 0
Time: 0.00000000000
Total Logical Reads: 0
Total Physical Reads: 0
Total Writes: 0
[stanczyk] :-) set trace on
Logical Reads: 0
Physical Reads: 0
Writes: 0
Time: 0.00000000000
Message: Finished processing.
Message: Completed parse tree execution.
Total Logical Reads: 0
Total Physical Reads: 0
Total Writes: 0
Let's have a look at the last expression again...
[stanczyk] :-) @ ex4_1_b
First a parse tree is built for the original expression... yawn..
Message: Parser: (Branch node) Operation: @
Message: Parse Tree build completed.
Message: Parse Tree
Message: ==========
ROOT NODE
Message: Depth: 0
Message: Expression: @ ex4_1_b
Message: Result:
Message: End Parse Tree
Message: ==============
Message: Parse tree built successfully.
Message: Optimisation Stage: Not yet implemented
Message: Processing parse tree...
Message: Operation (0): @ ex4_1_b
Message: Setting source file to ../database/stanczyk/source/ex4_1_b.src.
Logical Reads: 0
Physical Reads: 0
Writes: 0
Time: 0.00000000000
Message: Finished processing.
Message: Completed parse tree execution.
Total Logical Reads: 0
Total Physical Reads: 0
Total Writes: 0
[stanczyk] :-) # This example is taken from STA90.
[stanczyk] :-) # Exercise 4.1 (b) Pages 81 & 159
This is where it start's getting interesting...
[stanczyk] :-) project(join (project( select (ex_book) (pname='MIT PRESS'))(aname) ) (ex_auth) (aname=ex_auth.aname)) (specialism)
project(join (project( select (ex_book) (pname='MIT PRESS'))(aname) ) (ex_auth) (aname=ex_auth.aname)) (specialism)
Message: Parser: (Branch node) Operation: project
Message: Parser: (Branch node) Operation: join
Message: Parser: (Branch node) Operation: project
Message: Parser: (Branch node) Operation: select
Message: Parser: (Leaf node) Relation: ex_book
Message: Parser: (Leaf node) Relation: ex_auth
Message: Parse Tree build completed.
Here's the parse tree. Not graphical, but easy to make with pen and paper...
Message: Parse Tree
Message: ==========
ROOT NODE
Message: Depth: 0
Message: Expression: project(join (project( select (ex_book) (pname='MIT PRESS'))(aname) ) (ex_auth) (aname=ex_auth.aname)) (specialism)
Message: Result:
LEFT NODE
Message: Depth: 1
Message: Expression: join (project( select (ex_book) (pname='MIT PRESS'))(aname) ) (ex_auth) (aname=ex_auth.aname)
Message: Result:
LEFT NODE
Message: Depth: 2
Message: Expression: project( select (ex_book) (pname='MIT PRESS'))(aname)
Message: Result:
LEFT NODE
Message: Depth: 3
Message: Expression: select (ex_book) (pname='MIT PRESS')
Message: Result:
LEFT NODE
Message: Depth: 4
Message: Expression: ex_book
Message: Result:
Message: Returned to depth: 3 Expression: select (ex_book) (pname='MIT PRESS')
Message: Returned to depth: 2 Expression: project( select (ex_book) (pname='MIT PRESS'))(aname)
Message: Returned to depth: 1 Expression: join (project( select (ex_book) (pname='MIT PRESS'))(aname) ) (ex_auth) (aname=ex_auth.aname)
RIGHT NODE
Message: Depth: 2
Message: Expression: ex_auth
Message: Result:
Message: Returned to depth: 1 Expression: join (project( select (ex_book) (pname='MIT PRESS'))(aname) ) (ex_auth) (aname=ex_auth.aname)
Message: Returned to depth: 0 Expression: project(join (project( select (ex_book) (pname='MIT PRESS'))(aname) ) (ex_auth) (aname=ex_auth.aname)) (specialism)
Message: End Parse Tree
Message: ==============
Message: Parse tree built successfully.
Now the parse tree is processed...
Message: Optimisation Stage: Not yet implemented
There's an idea for an undergraduate project!? Optimisation of relational operators...
Message: Processing parse tree...
Message: Populating stack...
Message: Done assignment
Message: Populating stack...
Message: Done assignment
Message: Populating stack...
Message: Done assignment
Message: Populating stack...
Message: Done assignment
Message: Operation (0): ex_book
Logical Reads: 0
Physical Reads: 0
Writes: 0
Time: 0.00000000000
Message: Operation (1): select (ex_book) (pname='MIT PRESS')
add (leaprel) (zzobcp,zzobcp.relation,TRUE,0,FALSE,FALSE)
1.2 has to maintain the leaprel relation, so we've got a mini-step here...
Message: Parser: (Branch node) Operation: add
Message: Parser: (Leaf node) Relation: leaprel
Message: Parse Tree build completed.
Message: Parse Tree
Message: ==========
ROOT NODE
Message: Depth: 0
Message: Expression: add (leaprel) (zzobcp,zzobcp.relation,TRUE,0,FALSE,FALSE)
Message: Result:
LEFT NODE
Message: Depth: 1
Message: Expression: leaprel
Message: Result:
Message: Returned to depth: 0 Expression: add (leaprel) (zzobcp,zzobcp.relation,TRUE,0,FALSE,FALSE)
Message: End Parse Tree
Message: ==============
Message: Parse tree built successfully.
Message: Optimisation Stage: Not yet implemented
Message: Processing parse tree...
Message: Populating stack...
Message: Done assignment
Message: Operation (0): leaprel
Logical Reads: 0
Physical Reads: 0
Writes: 0
Time: 0.00000000000
Message: Operation (1): add (leaprel) (zzobcp,zzobcp.relation,TRUE,0,FALSE,FALSE)
Logical Reads: 0
Physical Reads: 0
Writes: 1
Time: 0.00000000000
Message: Finished processing.
Message: Completed parse tree execution.
Total Logical Reads: 0
Total Physical Reads: 0
Total Writes: 1
Logical Reads: 0
Physical Reads: 6
Writes: 3
Time: 0.00999999978
Message: Operation (2): project( select (ex_book) (pname='MIT PRESS'))(aname)
add (leaprel) (zzxhcl,zzxhcl.relation,TRUE,0,FALSE,FALSE)
Message: Parser: (Branch node) Operation: add
Message: Parser: (Leaf node) Relation: leaprel
Message: Parse Tree build completed.
Message: Parse Tree
Message: ==========
ROOT NODE
Message: Depth: 0
Message: Expression: add (leaprel) (zzxhcl,zzxhcl.relation,TRUE,0,FALSE,FALSE)
Message: Result:
LEFT NODE
Message: Depth: 1
Message: Expression: leaprel
Message: Result:
Message: Returned to depth: 0 Expression: add (leaprel) (zzxhcl,zzxhcl.relation,TRUE,0,FALSE,FALSE)
Message: End Parse Tree
Message: ==============
Message: Parse tree built successfully.
Message: Optimisation Stage: Not yet implemented
Message: Processing parse tree...
Message: Populating stack...
Message: Done assignment
Message: Operation (0): leaprel
Logical Reads: 0
Physical Reads: 0
Writes: 0
Time: 0.00000000000
Message: Operation (1): add (leaprel) (zzxhcl,zzxhcl.relation,TRUE,0,FALSE,FALSE)
Logical Reads: 0
Physical Reads: 0
Writes: 1
Time: 0.00000000000
Message: Finished processing.
Message: Completed parse tree execution.
Total Logical Reads: 0
Total Physical Reads: 0
Total Writes: 1
add (leapattributes) (zzxhcl,aname,STRING,10)
Message: Parser: (Branch node) Operation: add
Message: Parser: (Leaf node) Relation: leapattributes
Message: Parse Tree build completed.
Message: Parse Tree
Message: ==========
ROOT NODE
Message: Depth: 0
Message: Expression: add (leapattributes) (zzxhcl,aname,STRING,10)
Message: Result:
LEFT NODE
Message: Depth: 1
Message: Expression: leapattributes
Message: Result:
Message: Returned to depth: 0 Expression: add (leapattributes) (zzxhcl,aname,STRING,10)
Message: End Parse Tree
Message: ==============
Message: Parse tree built successfully.
Message: Optimisation Stage: Not yet implemented
Message: Processing parse tree...
Message: Populating stack...
Message: Done assignment
Message: Operation (0): leapattributes
Logical Reads: 0
Physical Reads: 0
Writes: 0
Time: 0.00000000000
Message: Operation (1): add (leapattributes) (zzxhcl,aname,STRING,10)
Logical Reads: 0
Physical Reads: 0
Writes: 1
Time: 0.00000000000
Message: Finished processing.
Message: Completed parse tree execution.
Total Logical Reads: 0
Total Physical Reads: 0
Total Writes: 1
Message: Populating stack...
Logical Reads: 0
Physical Reads: 2
Writes: 3
Time: 0.00999999978
Message: Operation (3): ex_auth
Logical Reads: 0
Physical Reads: 0
Writes: 0
Time: 0.00000000000
Message: Operation (4): join (project( select (ex_book) (pname='MIT PRESS'))(aname) ) (ex_auth) (aname=ex_auth.aname)
add (leaprel) (zzpwzb,zzpwzb.relation,TRUE,0,FALSE,FALSE)
Message: Parser: (Branch node) Operation: add
Message: Parser: (Leaf node) Relation: leaprel
Message: Parse Tree build completed.
Message: Parse Tree
Message: ==========
ROOT NODE
Message: Depth: 0
Message: Expression: add (leaprel) (zzpwzb,zzpwzb.relation,TRUE,0,FALSE,FALSE)
Message: Result:
LEFT NODE
Message: Depth: 1
Message: Expression: leaprel
Message: Result:
Message: Returned to depth: 0 Expression: add (leaprel) (zzpwzb,zzpwzb.relation,TRUE,0,FALSE,FALSE)
Message: End Parse Tree
Message: ==============
Message: Parse tree built successfully.
Message: Optimisation Stage: Not yet implemented
Message: Processing parse tree...
Message: Populating stack...
Message: Done assignment
Message: Operation (0): leaprel
Logical Reads: 0
Physical Reads: 0
Writes: 0
Time: 0.00000000000
Message: Operation (1): add (leaprel) (zzpwzb,zzpwzb.relation,TRUE,0,FALSE,FALSE)
Logical Reads: 0
Physical Reads: 0
Writes: 1
Time: 0.00000000000
Message: Finished processing.
Message: Completed parse tree execution.
Total Logical Reads: 0
Total Physical Reads: 0
Total Writes: 1
Logical Reads: 0
Physical Reads: 13
Writes: 3
Time: 0.00999999978
Message: Operation (5): project(join (project( select (ex_book) (pname='MIT PRESS'))(aname) ) (ex_auth) (aname=ex_auth.aname)) (specialism)
add (leaprel) (zzlxoj,zzlxoj.relation,TRUE,0,FALSE,FALSE)
Message: Parser: (Branch node) Operation: add
Message: Parser: (Leaf node) Relation: leaprel
Message: Parse Tree build completed.
Message: Parse Tree
Message: ==========
ROOT NODE
Message: Depth: 0
Message: Expression: add (leaprel) (zzlxoj,zzlxoj.relation,TRUE,0,FALSE,FALSE)
Message: Result:
LEFT NODE
Message: Depth: 1
Message: Expression: leaprel
Message: Result:
Message: Returned to depth: 0 Expression: add (leaprel) (zzlxoj,zzlxoj.relation,TRUE,0,FALSE,FALSE)
Message: End Parse Tree
Message: ==============
Message: Parse tree built successfully.
Message: Optimisation Stage: Not yet implemented
Message: Processing parse tree...
Message: Populating stack...
Message: Done assignment
Message: Operation (0): leaprel
Logical Reads: 0
Physical Reads: 0
Writes: 0
Time: 0.00000000000
Message: Operation (1): add (leaprel) (zzlxoj,zzlxoj.relation,TRUE,0,FALSE,FALSE)
Logical Reads: 0
Physical Reads: 0
Writes: 1
Time: 0.00000000000
Message: Finished processing.
Message: Completed parse tree execution.
Total Logical Reads: 0
Total Physical Reads: 0
Total Writes: 1
add (leapattributes) (zzlxoj,specialism,STRING,15)
Message: Parser: (Branch node) Operation: add
Message: Parser: (Leaf node) Relation: leapattributes
Message: Parse Tree build completed.
Message: Parse Tree
Message: ==========
ROOT NODE
Message: Depth: 0
Message: Expression: add (leapattributes) (zzlxoj,specialism,STRING,15)
Message: Result:
LEFT NODE
Message: Depth: 1
Message: Expression: leapattributes
Message: Result:
Message: Returned to depth: 0 Expression: add (leapattributes) (zzlxoj,specialism,STRING,15)
Message: End Parse Tree
Message: ==============
Message: Parse tree built successfully.
Message: Optimisation Stage: Not yet implemented
Message: Processing parse tree...
Message: Populating stack...
Message: Done assignment
Message: Operation (0): leapattributes
Logical Reads: 0
Physical Reads: 0
Writes: 0
Time: 0.00000000000
Message: Operation (1): add (leapattributes) (zzlxoj,specialism,STRING,15)
Logical Reads: 0
Physical Reads: 0
Writes: 1
Time: 0.00000000000
Message: Finished processing.
Message: Completed parse tree execution.
Total Logical Reads: 0
Total Physical Reads: 0
Total Writes: 1
Logical Reads: 0
Physical Reads: 2
Writes: 3
Time: 0.00999999978
Message: Finished processing.
Message: Completed parse tree execution.
Total Logical Reads: 0
Total Physical Reads: 23
Total Writes: 12
Message: Relation zzlxoj returned.
[stanczyk] :-)
Message: Setting source file to stdin.
Tada! Now to inspect it...
[stanczyk] :-) print @last
Message: Parser: (Branch node) Operation: print
Message: Parser: Processing variable project
Message: Parser: (Leaf node) Relation: zzlxoj
Message: Parse Tree build completed.
Message: Parse Tree
Message: ==========
ROOT NODE
Message: Depth: 0
Message: Expression: print @last
Message: Result:
LEFT NODE
Message: Depth: 1
Message: Expression: @last
Message: Result:
Message: Returned to depth: 0 Expression: print @last
Message: End Parse Tree
Message: ==============
Message: Parse tree built successfully.
Message: Optimisation Stage: Not yet implemented
Message: Processing parse tree...
Message: Populating stack...
Message: Done assignment
Message: Operation (0): @last
Logical Reads: 0
Physical Reads: 0
Writes: 0
Time: 0.00000000000
Message: Operation (1): print @last
FRENCH
LAW
Logical Reads: 0
Physical Reads: 2
Writes: 0
Time: 0.00000000000
Message: Finished processing.
Message: Completed parse tree execution.
Total Logical Reads: 0
Total Physical Reads: 2
Total Writes: 0
Message: Relation zzlxoj returned.
Get rid of the pesky trace/time info.
[stanczyk] :-) set trace off
Message: Parser: (Branch node) Operation: set
Message: Parse Tree build completed.
Message: Parse Tree
Message: ==========
ROOT NODE
Message: Depth: 0
Message: Expression: set trace off
Message: Result:
Message: End Parse Tree
Message: ==============
Message: Parse tree built successfully.
Message: Optimisation Stage: Not yet implemented
Message: Processing parse tree...
Message: Operation (0): set trace off
Logical Reads: 0
Physical Reads: 0
Writes: 0
Time: 0.00000000000
Total Logical Reads: 0
Total Physical Reads: 0
Total Writes: 0
[stanczyk] :-) set timing off
Now, for the on-line help
[stanczyk] :-) help
Help page:
============================================================================
Help Pages
============================================================================
exit - Halt program
list - Display the relations loaded.
sourceS - Display the sources files available.
print r - Display the contents of relation r.
describe r - Describe the attributes of relation r.
delrel r - Delete the relation r from the disk.
prompt s - Specify s as the command prompt within LEAP.
use - List available databases
use dbname - Change to database dbname
@ sourcefile - Use sourcefile as command file.
! command - Execute operating system command (Not Windows/DOS).
Algebraic Operators
-------------------
Type "help" for syntax and usage of:
union, intersect, difference, product, project,
join, select, assignment, display
Miscellaneous Operations
------------------------
relation r ((a1,dt1,l1),(a2,dt2,l2) .. (an,dtn,ln))
- Create a relation r, with attributes a1, type
dt1, display length l1, etc. - Where data type is a string
number, or boolean (see DATA TYPES)`s
change r - Change the temporary status of relation r.
delete (rel) (cond) Delete tuple from relation where cond is true.
describe r - Display the fields associated with relation r.
status - Report the status information of LEAP.
set item {on|off} - Change a setting of LEAP.
help [topic] - Display help page for [topic]
help index - Display a list of available help topics.
==============================================================================
This program, and all associated files/documentation are
copyright (C) 1997, 1998 Richard Leyton.
[stanczyk] :-) help index
Help page: index
HELP PROMPT ATTRIBUTE
PROJECT ALGEBRA ASSIGNMENT
RESTRICT SELECT CONDITION
JOIN UNION UNION_COMPATIBILITY
DISPLAY INTERSECT MINUS
DIFFERENCE PRODUCT LIST
SOURCES L @
PRINT DELREL DELETE
TEMPORARY PERMANENT CHANGE
DESCRIBE DATA_TYPE STATUS
EXPRESSION INFO QUIT
COMMAND_LINE RELATION CREATE
USE DATA_DICTIONARY RENAME
DUPLICATE SET VARIABLE
PADDING WIDTH PRODUCTJOIN
TIMING ADD DUMP
INTERNAL ABOUT BOOKS
CONTACTS MAILING_LIST GNU
DOS UNIX
[stanczyk] :-) help select
Help page: select
Usage: select (rel) ((condition) bool (condition))
Operation: Produces a relation which contains all TUPLEs within the
source relation matching the given CONDITION.
Examples:
rel=select (names) (address='oxford')
rl2=select (names) ( (address='oxford') and (name='richard leyton'))
NB. RESTRICT and SELECT have been combined in LEAP, such that the following
are equally valid:
rel=select (rel) (fielda = fieldb)
rel=restrict (rel) (fielda = fieldb)
[stanczyk] :-) help join
Help page: join
Usage: join (rel1) (rel2) ((condition) bool (condition))
Operation: Produces a relation which contains the attributes of
the source relations, and reduces the tuples to those
matching the given CONDITION.
Result: Conceptually the same as a PRODUCT followed by a SELECT.
Examples:
s1=select (subject) (class_name='non-fiction')
s2=join (s1) (index) (s1.class=index.class)
s3=project (s2) (author,title,shelf)
print s3
LEAP implements both the theta-join (with all attributes from both relations)
and the natural join (with duplicate attributes resolved).
[stanczyk] :-) help about
Help page: about
About LEAP...
LEAP is a relationally complete relational database management system.
LEAP has a relational algebra based command interpreter, support for
relational structures, indexing using b-trees, hashing tables and
extensive documentation. A source code level framework for enhancement
is incorporated for interested programmers. Contact the author for
more information.
LEAP has been successfully used as a teaching aid in a course in
Databases at Oxford Brookes University, England. Students have been
encouraged to use the system to experiment with the relational algebra,
and this has proved very successful and enjoyable.
In addition, there has been a warm reception to LEAP on the Internet,
leading to a number of sites using LEAP as a teaching tool.
LEAP is copyright Richard Leyton, 1997. Type INFO for more information
on warranty and conditions.
Warranty info...
[stanczyk] :-) warranty
LEAP 1.2 - An extensible and free RDBMS
Copyright (C) 1997, 1998 Richard Leyton.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
Copying info...
[stanczyk] :-) copying
LEAP 1.2 - An extensible and free RDBMS
Copyright (C) 1997, 1998 Richard Leyton.
LEAP comes with ABSOLUTELY NO WARRANTY; for details type "warranty".
This is free software, and you are welcome to redistribute it
under certain conditions; type "copying" for details.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
See the file COPYING for full details, or write to the address above.
Type "addresses" for a list of addresses
[stanczyk] :-) exit
And done...
Comments are in bold.
Your attention is drawn to some of the new features and differences in LEAP 1.2 by highlighting items in RED.
Taken from LEAP version 1.2, running on a Solaris 5.5.1 Ultra-1 (300Mhz Ultra sparc CPU).
Script started on Thu May 28 21:49:22 1998
Invoke LEAP with a simple command:
cs3% leap
LEAP 1.2 - An extensible and free RDBMS
Copyright (C) 1997, 1998 Richard Leyton.
LEAP comes with ABSOLUTELY NO WARRANTY; for details type "warranty".
This is free software, and you are welcome to redistribute it
under certain conditions; type "copying" for details.
[NON-FATAL] #2 - Error opening file [./configs/vars].
Message: No variables set!
Message: Directory specified [./] not valid. Trying [../]
Message: Variables are now set.
Message: LEAP is starting...
Message: Opening [tempdb] database...
Message: Creating hash table for [zzbdqc].
Message: Opening [master] database...
Message: Opening [user] database...
Message: Startup sequence initiated.
Message: Sourcing startup.src in master
[user] :-) Message: Sourcing open.src in user
[user] :-)
[user] :-)
Display the status of the various settings... New settings are highlighed
[user] :-) status
program :LEAP
version :1.2
last :zzawmc
currentdb :user
trace :off
debug :off
timing :off
case :off
quiet :off
temporary :on
timelog :on
long :off
padding :off
width :auto
tempdb :on
productjoin :off
Change databases... (Note 1.2 isn't as verbose as earlier releases)
[user] :-) use date
Message: Updating Hash Tables:
leapattributes leaprel leapscripts leaptypes relship
Message: Disposing relations
Message: Opening [date] database...
Message: Creating hash table for [zzdgot].
[date] :-) > This is the Date database. Examples are taken from
[date] :-) > 'An introduction to database systems' by C.J.Date
[date] :-)
List available relations (This is actually querying the leaprel relation)
[date] :-) list
NAME
-------------------------------------------------------------------------------
leaprel
leapattributes
leaptypes
relship
leapscripts
zzdgot
zzwumw
a
b
dend
dor1
dor2
dor3
p
s
sp
Message: Relation zztsyu returned.
List the sourc programs...
[date] :-) sources
Source files:
-------------
open
datd1
datd2
dati1
datu1
closure
project
rename
product
select
njoin
ex661
tjoin
a_div
te_div
ex662
b_div
c_div
Inspect the source programs
[date] :-) l datd1
Source File: datd1
------------------
# This example is taken from DAT90.
# Note that DIFFERENCE and MINUS are the same.
datd1=(a) difference (b)
print datd1
[date] :-) l datd2
Source File: datd2
------------------
# This example is taken from DAT90.
# Note that DIFFERENCE and MINUS are the same.
datd2=(b) minus (a)
print datd2
[date] :-) print a
s sname status city
-------------------------------------------------------------------------------
S1 SMITH 20 LONDON
S4 CLARK 20 LONDON
Message: Relation a returned.
[date] :-) print b
s sname status city
-------------------------------------------------------------------------------
S1 SMITH 20 LONDON
S2 JONES 10 PARIS
Message: Relation b returned.
Execute the scripts...
[date] :-) @ datu1
[date] :-)
[date] :-)
[date] :-) datu=(a) union (b)
Message: Relation datu returned.
[date] :-) print datu
s sname status city
-------------------------------------------------------------------------------
S1 SMITH 20 LONDON
S4 CLARK 20 LONDON
S2 JONES 10 PARIS
Message: Relation datu returned.
[date] :-)
[date] :-) @ datd1
[date] :-)
[date] :-)
[date] :-) datd1=(a) difference (b)
Message: Relation datd1 returned.
[date] :-) print datd1
s sname status city
-------------------------------------------------------------------------------
S4 CLARK 20 LONDON
Message: Relation datd1 returned.
[date] :-)
[date] :-) list
NAME
-------------------------------------------------------------------------------
leaprel
leapattributes
leaptypes
relship
leapscripts
zzdgot
zzwumw
a
b
dend
dor1
dor2
dor3
p
s
sp
datu
datd1
Message: Relation zzsdxw returned.
Note the reduction in the number of 'temporary' relations (zzxxxx), they're all now stored in tempdb if the tempdb setting is on.
Change databases to the stanczyk database...
[date] :-) use stanczyk
Message: Updating Hash Tables:
a b datd1* datu* dend dor1 dor2 dor3 leapattributes leaprel leapscripts leaptypes p relship s sp
Message: Disposing relations
Message: Opening [stanczyk] database...
Message: Creating hash table for [zzkoqt].
[stanczyk] :-) > This is the Stanczyk database. Examples are taken from
[stanczyk] :-) > 'Theory and Practice of relational databases'.
[stanczyk] :-) > This database has a number of useful examples that
[stanczyk] :-) > clearly demonstrate the relational algebra.
[stanczyk] :-)
List the relations and source in this db.
[stanczyk] :-) list
NAME
-------------------------------------------------------------------------------
leaprel
leapattributes
leaptypes
relship
leapscripts
zzkoqt
zzmczq
auction
book
delivery
ex_auth
ex_book
ex_publi
example
goods
index
lc
names
q
r
s
stock
subject
Message: Relation zzojmo returned.
[stanczyk] :-) sources
Source files:
-------------
open
disp_ex
ex4_1_a
ex4_1_b
ex41a
ex41b
ex42
ex43
ex45
q4_3_3
q4_3_4
q4_3_5
q431
q432
q433
divide
ex44
Do a few examples..
[stanczyk] :-) l ex41a
Source File: ex41a
------------------
# This example is taken from STA90, and is given in the infix form
# Example 4.1 (a)
r1=project (book) (author)
print r1
[stanczyk] :-) @ ex41a
[stanczyk] :-)
[stanczyk] :-)
[stanczyk] :-) r1=project (book) (author)
Message: Relation r1 returned.
[stanczyk] :-) print r1
author
-------------------------------------------------------------------------------
JOYCE
GREENE
ORWELL
LEM
GOLDING
KING
HEMINGWAY
Message: Relation r1 returned.
[stanczyk] :-)
[stanczyk] :-) l ex4_1_a
Source File: ex4_1_a
--------------------
# This example is taken from STA90
# Exercise 4.1 (a) Page 81 & 159
project (select (ex_book) (pname='PITMAN')) (title)
[stanczyk] :-) print ex_book
title aname pname
-------------------------------------------------------------------------------
THEORY AND PRACTICE STANCZYK PITMAN
SQL STANCZYK PITMAN
PROGRAMMING IN B PASCAL PALMER SYBEX
DATABASE SYSTEM CONCEPTS KORTH MCGRAW
FRENCH PROGRAMMING SMITH MIT PRESS
A GUIDE TO DB2 JONES MIT PRESS
Message: Relation ex_book returned.
[stanczyk] :-) @ ex4_1_a
[stanczyk] :-)
[stanczyk] :-)
[stanczyk] :-) project (select (ex_book) (pname='PITMAN')) (title)
Message: Relation zzcakc returned.
[stanczyk] :-)
[stanczyk] :-) print @last
title
-------------------------------------------------------------------------------
THEORY AND PRACTICE
SQL
Message: Relation zzcakc returned.
Here's an even more complex expression with several levels of nesting.
[stanczyk] :-) l ex4_1_b
Source File: ex4_1_b
--------------------
# This example is taken from STA90.
# Exercise 4.1 (b) Pages 81 & 159
project(join (project( select (ex_book) (pname='MIT PRESS'))(aname) ) (ex_auth) (aname=ex_auth.aname)) (specialism)
[stanczyk] :-) print ex_book
title aname pname
-------------------------------------------------------------------------------
THEORY AND PRACTICE STANCZYK PITMAN
SQL STANCZYK PITMAN
PROGRAMMING IN B PASCAL PALMER SYBEX
DATABASE SYSTEM CONCEPTS KORTH MCGRAW
FRENCH PROGRAMMING SMITH MIT PRESS
A GUIDE TO DB2 JONES MIT PRESS
Message: Relation ex_book returned.
[stanczyk] :-) print ex_auth
aname address specialism
-------------------------------------------------------------------------------
SMITH OXFORD FRENCH
JONES BIRMINGHAM LAW
STANCZYK OXFORD DATABASES
PALMER USA PROGRAMMING
KORTH USA DATABASES
Message: Relation ex_auth returned.
[stanczyk] :-) @ ex4_1_b
[stanczyk] :-)
[stanczyk] :-)
[stanczyk] :-) project(join (project( select (ex_book) (pname='MIT PRESS'))(aname) ) (ex_auth) (aname=ex_auth.aname)) (specialism)
Message: Relation zzttdb returned.
[stanczyk] :-)
[stanczyk] :-) print @last
specialism
-------------------------------------------------------------------------------
FRENCH
LAW
Message: Relation zzttdb returned.
[stanczyk] :-) status
program :LEAP
version :1.2
last :zzttdb
currentdb :stanczyk
trace :off
debug :off
timing :off
case :off
quiet :off
temporary :on
timelog :on
long :off
padding :off
width :auto
tempdb :on
productjoin :off
[stanczyk] :-) set timing on
Logical Reads: 0
Physical Reads: 0
Writes: 0
Time: 0.00000000000
Total Logical Reads: 0
Total Physical Reads: 0
Total Writes: 0
[stanczyk] :-) set trace on
Logical Reads: 0
Physical Reads: 0
Writes: 0
Time: 0.00000000000
Message: Finished processing.
Message: Completed parse tree execution.
Total Logical Reads: 0
Total Physical Reads: 0
Total Writes: 0
Let's have a look at the last expression again...
[stanczyk] :-) @ ex4_1_b
First a parse tree is built for the original expression... yawn..
Message: Parser: (Branch node) Operation: @
Message: Parse Tree build completed.
Message: Parse Tree
Message: ==========
ROOT NODE
Message: Depth: 0
Message: Expression: @ ex4_1_b
Message: Result:
Message: End Parse Tree
Message: ==============
Message: Parse tree built successfully.
Message: Optimisation Stage: Not yet implemented
Message: Processing parse tree...
Message: Operation (0): @ ex4_1_b
Message: Setting source file to ../database/stanczyk/source/ex4_1_b.src.
Logical Reads: 0
Physical Reads: 0
Writes: 0
Time: 0.00000000000
Message: Finished processing.
Message: Completed parse tree execution.
Total Logical Reads: 0
Total Physical Reads: 0
Total Writes: 0
[stanczyk] :-) # This example is taken from STA90.
[stanczyk] :-) # Exercise 4.1 (b) Pages 81 & 159
[stanczyk] :-) project(join (project( select (ex_book) (pname='MIT PRESS'))(aname) ) (ex_auth) (aname=ex_auth.aname)) (specialism)
project(join (project( select (ex_book) (pname='MIT PRESS'))(aname) ) (ex_auth) (aname=ex_auth.aname)) (specialism)
Message: Parser: (Branch node) Operation: project
Message: Parser: (Branch node) Operation: join
Message: Parser: (Branch node) Operation: project
Message: Parser: (Branch node) Operation: select
Message: Parser: (Leaf node) Relation: ex_book
Message: Parser: (Leaf node) Relation: ex_auth
Message: Parse Tree build completed.
Here's the parse tree. Not graphical, but easy to make with pen and paper...
Message: Parse Tree
Message: ==========
ROOT NODE
Message: Depth: 0
Message: Expression: project(join (project( select (ex_book) (pname='MIT PRESS'))(aname) ) (ex_auth) (aname=ex_auth.aname)) (specialism)
Message: Result:
LEFT NODE
Message: Depth: 1
Message: Expression: join (project( select (ex_book) (pname='MIT PRESS'))(aname) ) (ex_auth) (aname=ex_auth.aname)
Message: Result:
LEFT NODE
Message: Depth: 2
Message: Expression: project( select (ex_book) (pname='MIT PRESS'))(aname)
Message: Result:
LEFT NODE
Message: Depth: 3
Message: Expression: select (ex_book) (pname='MIT PRESS')
Message: Result:
LEFT NODE
Message: Depth: 4
Message: Expression: ex_book
Message: Result:
Message: Returned to depth: 3 Expression: select (ex_book) (pname='MIT PRESS')
Message: Returned to depth: 2 Expression: project( select (ex_book) (pname='MIT PRESS'))(aname)
Message: Returned to depth: 1 Expression: join (project( select (ex_book) (pname='MIT PRESS'))(aname) ) (ex_auth) (aname=ex_auth.aname)
RIGHT NODE
Message: Depth: 2
Message: Expression: ex_auth
Message: Result:
Message: Returned to depth: 1 Expression: join (project( select (ex_book) (pname='MIT PRESS'))(aname) ) (ex_auth) (aname=ex_auth.aname)
Message: Returned to depth: 0 Expression: project(join (project( select (ex_book) (pname='MIT PRESS'))(aname) ) (ex_auth) (aname=ex_auth.aname)) (specialism)
Message: End Parse Tree
Message: ==============
Message: Parse tree built successfully.
Message: Optimisation Stage: Not yet implemented
There's an idea for an undergraduate project!? Optimisation of relational operators...
Message: Processing parse tree...
Message: Populating stack...
Message: Done assignment
Message: Populating stack...
Message: Done assignment
Message: Populating stack...
Message: Done assignment
Message: Populating stack...
Message: Done assignment
Message: Operation (0): ex_book
Logical Reads: 0
Physical Reads: 0
Writes: 0
Time: 0.00000000000
Message: Operation (1): select (ex_book) (pname='MIT PRESS')
add (leaprel) (zzobcp,zzobcp.relation,TRUE,0,FALSE,FALSE)
1.2 has to maintain the leaprel relation, so we've got a mini-step here...
Message: Parser: (Branch node) Operation: add
Message: Parser: (Leaf node) Relation: leaprel
Message: Parse Tree build completed.
Message: Parse Tree
Message: ==========
ROOT NODE
Message: Depth: 0
Message: Expression: add (leaprel) (zzobcp,zzobcp.relation,TRUE,0,FALSE,FALSE)
Message: Result:
LEFT NODE
Message: Depth: 1
Message: Expression: leaprel
Message: Result:
Message: Returned to depth: 0 Expression: add (leaprel) (zzobcp,zzobcp.relation,TRUE,0,FALSE,FALSE)
Message: End Parse Tree
Message: ==============
Message: Parse tree built successfully.
Message: Optimisation Stage: Not yet implemented
Message: Processing parse tree...
Message: Populating stack...
Message: Done assignment
Message: Operation (0): leaprel
Logical Reads: 0
Physical Reads: 0
Writes: 0
Time: 0.00000000000
Message: Operation (1): add (leaprel) (zzobcp,zzobcp.relation,TRUE,0,FALSE,FALSE)
Logical Reads: 0
Physical Reads: 0
Writes: 1
Time: 0.00000000000
Message: Finished processing.
Message: Completed parse tree execution.
Total Logical Reads: 0
Total Physical Reads: 0
Total Writes: 1
Logical Reads: 0
Physical Reads: 6
Writes: 3
Time: 0.00999999978
Message: Operation (2): project( select (ex_book) (pname='MIT PRESS'))(aname)
add (leaprel) (zzxhcl,zzxhcl.relation,TRUE,0,FALSE,FALSE)
Message: Parser: (Branch node) Operation: add
Message: Parser: (Leaf node) Relation: leaprel
Message: Parse Tree build completed.
Message: Parse Tree
Message: ==========
ROOT NODE
Message: Depth: 0
Message: Expression: add (leaprel) (zzxhcl,zzxhcl.relation,TRUE,0,FALSE,FALSE)
Message: Result:
LEFT NODE
Message: Depth: 1
Message: Expression: leaprel
Message: Result:
Message: Returned to depth: 0 Expression: add (leaprel) (zzxhcl,zzxhcl.relation,TRUE,0,FALSE,FALSE)
Message: End Parse Tree
Message: ==============
Message: Parse tree built successfully.
Message: Optimisation Stage: Not yet implemented
Message: Processing parse tree...
Message: Populating stack...
Message: Done assignment
Message: Operation (0): leaprel
Logical Reads: 0
Physical Reads: 0
Writes: 0
Time: 0.00000000000
Message: Operation (1): add (leaprel) (zzxhcl,zzxhcl.relation,TRUE,0,FALSE,FALSE)
Logical Reads: 0
Physical Reads: 0
Writes: 1
Time: 0.00000000000
Message: Finished processing.
Message: Completed parse tree execution.
Total Logical Reads: 0
Total Physical Reads: 0
Total Writes: 1
add (leapattributes) (zzxhcl,aname,STRING,10)
Message: Parser: (Branch node) Operation: add
Message: Parser: (Leaf node) Relation: leapattributes
Message: Parse Tree build completed.
Message: Parse Tree
Message: ==========
ROOT NODE
Message: Depth: 0
Message: Expression: add (leapattributes) (zzxhcl,aname,STRING,10)
Message: Result:
LEFT NODE
Message: Depth: 1
Message: Expression: leapattributes
Message: Result:
Message: Returned to depth: 0 Expression: add (leapattributes) (zzxhcl,aname,STRING,10)
Message: End Parse Tree
Message: ==============
Message: Parse tree built successfully.
Message: Optimisation Stage: Not yet implemented
Message: Processing parse tree...
Message: Populating stack...
Message: Done assignment
Message: Operation (0): leapattributes
Logical Reads: 0
Physical Reads: 0
Writes: 0
Time: 0.00000000000
Message: Operation (1): add (leapattributes) (zzxhcl,aname,STRING,10)
Logical Reads: 0
Physical Reads: 0
Writes: 1
Time: 0.00000000000
Message: Finished processing.
Message: Completed parse tree execution.
Total Logical Reads: 0
Total Physical Reads: 0
Total Writes: 1
Message: Populating stack...
Logical Reads: 0
Physical Reads: 2
Writes: 3
Time: 0.00999999978
Message: Operation (3): ex_auth
Logical Reads: 0
Physical Reads: 0
Writes: 0
Time: 0.00000000000
Message: Operation (4): join (project( select (ex_book) (pname='MIT PRESS'))(aname) ) (ex_auth) (aname=ex_auth.aname)
add (leaprel) (zzpwzb,zzpwzb.relation,TRUE,0,FALSE,FALSE)
Message: Parser: (Branch node) Operation: add
Message: Parser: (Leaf node) Relation: leaprel
Message: Parse Tree build completed.
Message: Parse Tree
Message: ==========
ROOT NODE
Message: Depth: 0
Message: Expression: add (leaprel) (zzpwzb,zzpwzb.relation,TRUE,0,FALSE,FALSE)
Message: Result:
LEFT NODE
Message: Depth: 1
Message: Expression: leaprel
Message: Result:
Message: Returned to depth: 0 Expression: add (leaprel) (zzpwzb,zzpwzb.relation,TRUE,0,FALSE,FALSE)
Message: End Parse Tree
Message: ==============
Message: Parse tree built successfully.
Message: Optimisation Stage: Not yet implemented
Message: Processing parse tree...
Message: Populating stack...
Message: Done assignment
Message: Operation (0): leaprel
Logical Reads: 0
Physical Reads: 0
Writes: 0
Time: 0.00000000000
Message: Operation (1): add (leaprel) (zzpwzb,zzpwzb.relation,TRUE,0,FALSE,FALSE)
Logical Reads: 0
Physical Reads: 0
Writes: 1
Time: 0.00000000000
Message: Finished processing.
Message: Completed parse tree execution.
Total Logical Reads: 0
Total Physical Reads: 0
Total Writes: 1
Logical Reads: 0
Physical Reads: 13
Writes: 3
Time: 0.00999999978
Message: Operation (5): project(join (project( select (ex_book) (pname='MIT PRESS'))(aname) ) (ex_auth) (aname=ex_auth.aname)) (specialism)
add (leaprel) (zzlxoj,zzlxoj.relation,TRUE,0,FALSE,FALSE)
Message: Parser: (Branch node) Operation: add
Message: Parser: (Leaf node) Relation: leaprel
Message: Parse Tree build completed.
Message: Parse Tree
Message: ==========
ROOT NODE
Message: Depth: 0
Message: Expression: add (leaprel) (zzlxoj,zzlxoj.relation,TRUE,0,FALSE,FALSE)
Message: Result:
LEFT NODE
Message: Depth: 1
Message: Expression: leaprel
Message: Result:
Message: Returned to depth: 0 Expression: add (leaprel) (zzlxoj,zzlxoj.relation,TRUE,0,FALSE,FALSE)
Message: End Parse Tree
Message: ==============
Message: Parse tree built successfully.
Message: Optimisation Stage: Not yet implemented
Message: Processing parse tree...
Message: Populating stack...
Message: Done assignment
Message: Operation (0): leaprel
Logical Reads: 0
Physical Reads: 0
Writes: 0
Time: 0.00000000000
Message: Operation (1): add (leaprel) (zzlxoj,zzlxoj.relation,TRUE,0,FALSE,FALSE)
Logical Reads: 0
Physical Reads: 0
Writes: 1
Time: 0.00000000000
Message: Finished processing.
Message: Completed parse tree execution.
Total Logical Reads: 0
Total Physical Reads: 0
Total Writes: 1
add (leapattributes) (zzlxoj,specialism,STRING,15)
Message: Parser: (Branch node) Operation: add
Message: Parser: (Leaf node) Relation: leapattributes
Message: Parse Tree build completed.
Message: Parse Tree
Message: ==========
ROOT NODE
Message: Depth: 0
Message: Expression: add (leapattributes) (zzlxoj,specialism,STRING,15)
Message: Result:
LEFT NODE
Message: Depth: 1
Message: Expression: leapattributes
Message: Result:
Message: Returned to depth: 0 Expression: add (leapattributes) (zzlxoj,specialism,STRING,15)
Message: End Parse Tree
Message: ==============
Message: Parse tree built successfully.
Message: Optimisation Stage: Not yet implemented
Message: Processing parse tree...
Message: Populating stack...
Message: Done assignment
Message: Operation (0): leapattributes
Logical Reads: 0
Physical Reads: 0
Writes: 0
Time: 0.00000000000
Message: Operation (1): add (leapattributes) (zzlxoj,specialism,STRING,15)
Logical Reads: 0
Physical Reads: 0
Writes: 1
Time: 0.00000000000
Message: Finished processing.
Message: Completed parse tree execution.
Total Logical Reads: 0
Total Physical Reads: 0
Total Writes: 1
Logical Reads: 0
Physical Reads: 2
Writes: 3
Time: 0.00999999978
Message: Finished processing.
Message: Completed parse tree execution.
Total Logical Reads: 0
Total Physical Reads: 23
Total Writes: 12
Message: Relation zzlxoj returned.
[stanczyk] :-)
Message: Setting source file to stdin.
[stanczyk] :-) print @last
Message: Parser: (Branch node) Operation: print
Message: Parser: Processing variable project
Message: Parser: (Leaf node) Relation: zzlxoj
Message: Parse Tree build completed.
Message: Parse Tree
Message: ==========
ROOT NODE
Message: Depth: 0
Message: Expression: print @last
Message: Result:
LEFT NODE
Message: Depth: 1
Message: Expression: @last
Message: Result:
Message: Returned to depth: 0 Expression: print @last
Message: End Parse Tree
Message: ==============
Message: Parse tree built successfully.
Message: Optimisation Stage: Not yet implemented
Message: Processing parse tree...
Message: Populating stack...
Message: Done assignment
Message: Operation (0): @last
Logical Reads: 0
Physical Reads: 0
Writes: 0
Time: 0.00000000000
Message: Operation (1): print @last
FRENCH
LAW
Logical Reads: 0
Physical Reads: 2
Writes: 0
Time: 0.00000000000
Message: Finished processing.
Message: Completed parse tree execution.
Total Logical Reads: 0
Total Physical Reads: 2
Total Writes: 0
Message: Relation zzlxoj returned.
[stanczyk] :-) set trace off
Message: Parser: (Branch node) Operation: set
Message: Parse Tree build completed.
Message: Parse Tree
Message: ==========
ROOT NODE
Message: Depth: 0
Message: Expression: set trace off
Message: Result:
Message: End Parse Tree
Message: ==============
Message: Parse tree built successfully.
Message: Optimisation Stage: Not yet implemented
Message: Processing parse tree...
Message: Operation (0): set trace off
Logical Reads: 0
Physical Reads: 0
Writes: 0
Time: 0.00000000000
Total Logical Reads: 0
Total Physical Reads: 0
Total Writes: 0
[stanczyk] :-) set timing off
[stanczyk] :-) help
Help page:
============================================================================
Help Pages
============================================================================
exit - Halt program
list - Display the relations loaded.
sourceS - Display the sources files available.
print r - Display the contents of relation r.
describe r - Describe the attributes of relation r.
delrel r - Delete the relation r from the disk.
prompt s - Specify s as the command prompt within LEAP.
use - List available databases
use dbname - Change to database dbname
@ sourcefile - Use sourcefile as command file.
! command - Execute operating system command (Not Windows/DOS).
Algebraic Operators
-------------------
Type "help
union, intersect, difference, product, project,
join, select, assignment, display
Miscellaneous Operations
------------------------
relation r ((a1,dt1,l1),(a2,dt2,l2) .. (an,dtn,ln))
- Create a relation r, with attributes a1, type
dt1, display length l1, etc. - Where data type is a string
number, or boolean (see DATA TYPES)`s
change r - Change the temporary status of relation r.
delete (rel) (cond) Delete tuple from relation where cond is true.
describe r - Display the fields associated with relation r.
status - Report the status information of LEAP.
set item {on|off} - Change a setting of LEAP.
help [topic] - Display help page for [topic]
help index - Display a list of available help topics.
==============================================================================
This program, and all associated files/documentation are
copyright (C) 1997, 1998 Richard Leyton.
[stanczyk] :-) help index
Help page: index
HELP PROMPT ATTRIBUTE
PROJECT ALGEBRA ASSIGNMENT
RESTRICT SELECT CONDITION
JOIN UNION UNION_COMPATIBILITY
DISPLAY INTERSECT MINUS
DIFFERENCE PRODUCT LIST
SOURCES L @
PRINT DELREL DELETE
TEMPORARY PERMANENT CHANGE
DESCRIBE DATA_TYPE STATUS
EXPRESSION INFO QUIT
COMMAND_LINE RELATION CREATE
USE DATA_DICTIONARY RENAME
DUPLICATE SET VARIABLE
PADDING WIDTH PRODUCTJOIN
TIMING ADD DUMP
INTERNAL ABOUT BOOKS
CONTACTS MAILING_LIST GNU
DOS UNIX
[stanczyk] :-) help select
Help page: select
Usage: select (rel) ((condition) bool (condition))
Operation: Produces a relation which contains all TUPLEs within the
source relation matching the given CONDITION.
Examples:
rel=select (names) (address='oxford')
rl2=select (names) ( (address='oxford') and (name='richard leyton'))
NB. RESTRICT and SELECT have been combined in LEAP, such that the following
are equally valid:
rel=select (rel) (fielda = fieldb)
rel=restrict (rel) (fielda = fieldb)
[stanczyk] :-) help join
Help page: join
Usage: join (rel1) (rel2) ((condition) bool (condition))
Operation: Produces a relation which contains the attributes of
the source relations, and reduces the tuples to those
matching the given CONDITION.
Result: Conceptually the same as a PRODUCT followed by a SELECT.
Examples:
s1=select (subject) (class_name='non-fiction')
s2=join (s1) (index) (s1.class=index.class)
s3=project (s2) (author,title,shelf)
print s3
LEAP implements both the theta-join (with all attributes from both relations)
and the natural join (with duplicate attributes resolved).
[stanczyk] :-) help about
Help page: about
About LEAP...
LEAP is a relationally complete relational database management system.
LEAP has a relational algebra based command interpreter, support for
relational structures, indexing using b-trees, hashing tables and
extensive documentation. A source code level framework for enhancement
is incorporated for interested programmers. Contact the author for
more information.
LEAP has been successfully used as a teaching aid in a course in
Databases at Oxford Brookes University, England. Students have been
encouraged to use the system to experiment with the relational algebra,
and this has proved very successful and enjoyable.
In addition, there has been a warm reception to LEAP on the Internet,
leading to a number of sites using LEAP as a teaching tool.
LEAP is copyright Richard Leyton, 1997. Type INFO for more information
on warranty and conditions.
[stanczyk] :-) warranty
LEAP 1.2 - An extensible and free RDBMS
Copyright (C) 1997, 1998 Richard Leyton.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
Copying info...
[stanczyk] :-) copying
LEAP 1.2 - An extensible and free RDBMS
Copyright (C) 1997, 1998 Richard Leyton.
LEAP comes with ABSOLUTELY NO WARRANTY; for details type "warranty".
This is free software, and you are welcome to redistribute it
under certain conditions; type "copying" for details.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
See the file COPYING for full details, or write to the address above.
Type "addresses" for a list of addresses
[stanczyk] :-) exit
And done...