% Beispiel-Datenbank von Oracle als Prolog-Fakten.

% CREATE TABLE DEPT (
%  DEPTNO              NUMBER(2) NOT NULL,
%  DNAME               VARCHAR2(14),
%  LOC                 VARCHAR2(13),
%  CONSTRAINT DEPT_PRIMARY_KEY PRIMARY KEY (DEPTNO));

dept(10, 'ACCOUNTING', 'NEW YORK').
dept(20, 'RESEARCH',   'DALLAS').
dept(30, 'SALES',      'CHICAGO').
dept(40, 'OPERATIONS', 'BOSTON').

%CREATE TABLE EMP (
% EMPNO               NUMBER(4) NOT NULL,
% ENAME               VARCHAR2(10),
% JOB                 VARCHAR2(9),
% MGR                 NUMBER(4) CONSTRAINT EMP_MGR_FK REFERENCES EMP (EMPNO),
% HIREDATE            DATE,  -- REMOVED IN PROLOG VERSION
% SAL                 NUMBER(7,2),
% COMM                NUMBER(7,2), -- REMOVED IN PROLOG VERSION
% DEPTNO              NUMBER(2) NOT NULL,
% CONSTRAINT EMP_DEPTNO_FK FOREIGN KEY (DEPTNO) REFERENCES DEPT (DEPTNO),
% CONSTRAINT EMP_EMPNO_PK PRIMARY KEY (EMPNO));

%   EMPNO ENAME     JOB          MGR   SAL   DEPTNO
emp(7839, 'KING',   'PRESIDENT', null, 5000, 10).
emp(7698, 'BLAKE',  'MANAGER',   7839, 2850, 30).
emp(7782, 'CLARK',  'MANAGER',   7839, 2450, 10).
emp(7566, 'JONES',  'MANAGER',   7839, 2975, 20).
emp(7654, 'MARTIN', 'SALESMAN',  7698, 1250, 30).
emp(7499, 'ALLEN',  'SALESMAN',  7698, 1600, 30).
emp(7844, 'TURNER', 'SALESMAN',  7698, 1500, 30).
emp(7900, 'JAMES',  'CLERK',     7698,  950, 30).
emp(7521, 'WARD',   'SALESMAN',  7698, 1250, 30).
emp(7902, 'FORD',   'ANALYST',   7566, 3000, 20).
emp(7369, 'SMITH',  'CLERK',     7902,  800, 20).
emp(7788, 'SCOTT',  'ANALYST',   7566, 3000, 20).
emp(7876, 'ADAMS',  'CLERK',     7788, 1100, 20).
emp(7934, 'MILLER', 'CLERK',     7782, 1300, 10).

% CREATE TABLE BONUS (
% ENAME               VARCHAR2(10),
% JOB                 VARCHAR2(9),
% SAL                 NUMBER,
% COMM                NUMBER);

% CREATE TABLE SALGRADE (
% GRADE               NUMBER,
% LOSAL               NUMBER,
% HISAL               NUMBER);

salgrade(1,  700, 1200).
salgrade(2, 1201, 1400).
salgrade(3, 1401, 2000).
salgrade(4, 2001, 3000).
salgrade(5, 3001, 9999).

