dbase(mailorder,[employees,parts,customers,orders,odetails,zipcodes]).

table(employees,[eno,ename,zip,"hdate"]).
employees(1000,jones,67226,'12-dec-95').
employees(1001,smith,60606,'01-jan-92').
employees(1002,brown,50302,'01-sep-94').
employees(1003,hastings,67226,'01-sep-94').

table(parts,[pno,"pname",qoh,price,level]).
parts(10506,'land before time i',200,19.99,20).
parts(10507,'land before time ii',156,19.99,20).
parts(10508,'land before time iii',190,19.99,20).
parts(10509,'land before time iv',60,19.99,20).
parts(10601,'sleeping beauty',300,24.99,20).
parts(10701,'when harry met sally',120,19.99,30).
parts(10800,'dirty harry',140,14.99,30).
parts(10900,'dr. zhivago',100,24.99,30).

table(customers,[cno,cname,"street",zip,"phone"]).
customers(1111,charles,'123 main st.',67226,'316-636-5555').
customers(2222,bertram,'237 ash avenue',67266,'316-689-5555').
customers(3333,barbara,'111 inwood avenue',60606,'316-111-1234').

table(orders,[ono,cno,eno,"received","shipped"]).
orders(1020,1111,1000,'10-dec-94','12-dec-94').
orders(1021,1111,1000,'12-jan-95','15-jan-95').
orders(1022,2222,1001,'13-feb-95','20-feb-95').
orders(1023,3333,1000,'20-jun-97','null').

table(odetails,[id,ono,pno,qty]).
odetails(d1,1020,10506,1).
odetails(d2,1020,10507,1).
odetails(d3,1020,10508,2).
odetails(d4,1020,10509,3).
odetails(d5,1021,10601,4).
odetails(d6,1022,10601,1).
odetails(d7,1022,10701,1).
odetails(d8,1023,10800,1).
odetails(d9,1023,10900,1).

table(zipcodes,[zip,"city"]).
zipcodes(67226,'wichita').
zipcodes(60606,'fort dodge').
zipcodes(50302,'kansas city').
zipcodes(54444,'columbia').
zipcodes(66002,'liberal').
zipcodes(61111,'fort hays').
