1 |
/* Script for ODS 11 */ |
2 |
|
3 |
SET SQL DIALECT 3; |
4 |
SET AUTODDL ON; |
5 |
|
6 |
CREATE DATABASE 'inet://localhost//tmp/ibx-testsuite/testsuite1.fdb' PAGE_SIZE 8192 |
7 |
|
8 |
DEFAULT CHARACTER SET NONE; |
9 |
COMMENT ON DATABASE IS 'Employee Test DB'; |
10 |
|
11 |
/* Domain definitions */ |
12 |
|
13 |
CREATE DOMAIN ADDRESSLINE AS VARCHAR(30); |
14 |
CREATE DOMAIN BUDGET AS DECIMAL(12,2) |
15 |
DEFAULT 50000; |
16 |
CREATE DOMAIN COUNTRYNAME AS VARCHAR(15); |
17 |
CREATE DOMAIN CUSTNO AS INTEGER; |
18 |
CREATE DOMAIN DEPTNO AS CHAR(3); |
19 |
CREATE DOMAIN EMPNO AS SMALLINT; |
20 |
CREATE DOMAIN FB$OUT_TYPE AS BLOB SUB_TYPE TEXT SEGMENT SIZE 80 NOT NULL; |
21 |
CREATE DOMAIN FIRSTNAME AS VARCHAR(15); |
22 |
CREATE DOMAIN JOBCODE AS VARCHAR(5); |
23 |
CREATE DOMAIN JOBGRADE AS SMALLINT; |
24 |
CREATE DOMAIN LASTNAME AS VARCHAR(20); |
25 |
CREATE DOMAIN PHONENUMBER AS VARCHAR(20); |
26 |
CREATE DOMAIN PONUMBER AS CHAR(8); |
27 |
CREATE DOMAIN PRODTYPE AS VARCHAR(12) |
28 |
DEFAULT 'software' NOT NULL; |
29 |
CREATE DOMAIN PROJNO AS CHAR(5); |
30 |
CREATE DOMAIN SALARY AS NUMERIC(10,2) |
31 |
DEFAULT 0; |
32 |
|
33 |
/* Table: COUNTRIES, Owner: SYSDBA */ |
34 |
|
35 |
CREATE TABLE COUNTRIES |
36 |
( |
37 |
COUNTRY VARCHAR(64) NOT NULL, |
38 |
NONEU SMALLINT, |
39 |
ISO2 CHAR(2), |
40 |
ISO3 CHAR(3), |
41 |
PRIMARY KEY (COUNTRY) |
42 |
); |
43 |
COMMENT ON TABLE COUNTRIES IS 'List of Countries'; |
44 |
COMMENT ON COLUMN COUNTRIES.ISO2 IS 'Two Character ISO Country Code'; |
45 |
|
46 |
/* Table: COUNTRY, Owner: SYSDBA */ |
47 |
|
48 |
CREATE TABLE COUNTRY |
49 |
( |
50 |
COUNTRY COUNTRYNAME NOT NULL, |
51 |
CURRENCY VARCHAR(10) NOT NULL, |
52 |
PRIMARY KEY (COUNTRY) |
53 |
); |
54 |
|
55 |
/* Table: CUSTOMER, Owner: SYSDBA */ |
56 |
|
57 |
CREATE TABLE CUSTOMER |
58 |
( |
59 |
CUST_NO CUSTNO NOT NULL, |
60 |
CUSTOMER VARCHAR(25) NOT NULL, |
61 |
CONTACT_FIRST FIRSTNAME, |
62 |
CONTACT_LAST LASTNAME, |
63 |
PHONE_NO PHONENUMBER, |
64 |
ADDRESS_LINE1 ADDRESSLINE, |
65 |
ADDRESS_LINE2 ADDRESSLINE, |
66 |
CITY VARCHAR(25), |
67 |
STATE_PROVINCE VARCHAR(15), |
68 |
COUNTRY COUNTRYNAME, |
69 |
POSTAL_CODE VARCHAR(12), |
70 |
ON_HOLD CHAR(1) DEFAULT NULL, |
71 |
LONG_REFERENCE BIGINT, |
72 |
PRIMARY KEY (CUST_NO) |
73 |
); |
74 |
|
75 |
/* Table: DEPARTMENT, Owner: SYSDBA */ |
76 |
|
77 |
CREATE TABLE DEPARTMENT |
78 |
( |
79 |
DEPT_NO DEPTNO NOT NULL, |
80 |
DEPARTMENT VARCHAR(25) NOT NULL, |
81 |
HEAD_DEPT DEPTNO, |
82 |
MNGR_NO EMPNO, |
83 |
BUDGET BUDGET, |
84 |
LOCATION VARCHAR(15), |
85 |
PHONE_NO PHONENUMBER DEFAULT '555-1234', |
86 |
UNIQUE (DEPARTMENT), |
87 |
PRIMARY KEY (DEPT_NO) |
88 |
); |
89 |
|
90 |
/* Table: EMPLOYEE, Owner: SYSDBA */ |
91 |
|
92 |
CREATE TABLE EMPLOYEE |
93 |
( |
94 |
EMP_NO EMPNO NOT NULL, |
95 |
FIRST_NAME FIRSTNAME NOT NULL, |
96 |
LAST_NAME LASTNAME NOT NULL, |
97 |
PHONE_EXT VARCHAR(4), |
98 |
HIRE_DATE TIMESTAMP DEFAULT 'NOW' NOT NULL, |
99 |
DEPT_NO DEPTNO NOT NULL, |
100 |
JOB_CODE JOBCODE NOT NULL, |
101 |
JOB_GRADE JOBGRADE NOT NULL, |
102 |
JOB_COUNTRY COUNTRYNAME NOT NULL, |
103 |
SALARY SALARY NOT NULL, |
104 |
FULL_NAME COMPUTED BY (last_name || ', ' || first_name), |
105 |
PRIMARY KEY (EMP_NO) |
106 |
); |
107 |
|
108 |
/* Table: EMPLOYEE_PROJECT, Owner: SYSDBA */ |
109 |
|
110 |
CREATE TABLE EMPLOYEE_PROJECT |
111 |
( |
112 |
EMP_NO EMPNO NOT NULL, |
113 |
PROJ_ID PROJNO NOT NULL, |
114 |
PRIMARY KEY (EMP_NO, PROJ_ID) |
115 |
); |
116 |
|
117 |
/* Table: FB$OUT_TABLE, Owner: SYSDBA */ |
118 |
|
119 |
CREATE GLOBAL TEMPORARY TABLE FB$OUT_TABLE |
120 |
( |
121 |
LINE_NUM INTEGER, |
122 |
CONTENT FB$OUT_TYPE |
123 |
) ON COMMIT PRESERVE ROWS ; |
124 |
|
125 |
/* Table: JOB, Owner: SYSDBA */ |
126 |
|
127 |
CREATE TABLE JOB |
128 |
( |
129 |
JOB_CODE JOBCODE NOT NULL, |
130 |
JOB_GRADE JOBGRADE NOT NULL, |
131 |
JOB_COUNTRY COUNTRYNAME NOT NULL, |
132 |
JOB_TITLE VARCHAR(25) NOT NULL, |
133 |
MIN_SALARY SALARY NOT NULL, |
134 |
MAX_SALARY SALARY NOT NULL, |
135 |
JOB_REQUIREMENT BLOB SUB_TYPE TEXT SEGMENT SIZE 400, |
136 |
LANGUAGE_REQ VARCHAR(15)[1:5], |
137 |
PRIMARY KEY (JOB_CODE, JOB_GRADE, JOB_COUNTRY) |
138 |
); |
139 |
|
140 |
/* Table: PROJECT, Owner: SYSDBA */ |
141 |
|
142 |
CREATE TABLE PROJECT |
143 |
( |
144 |
PROJ_ID PROJNO NOT NULL, |
145 |
PROJ_NAME VARCHAR(20) NOT NULL, |
146 |
PROJ_DESC BLOB SUB_TYPE TEXT SEGMENT SIZE 800, |
147 |
TEAM_LEADER EMPNO, |
148 |
PRODUCT PRODTYPE, |
149 |
UNIQUE (PROJ_NAME), |
150 |
PRIMARY KEY (PROJ_ID) |
151 |
); |
152 |
|
153 |
/* Table: PROJ_DEPT_BUDGET, Owner: SYSDBA */ |
154 |
|
155 |
CREATE TABLE PROJ_DEPT_BUDGET |
156 |
( |
157 |
FISCAL_YEAR INTEGER NOT NULL, |
158 |
PROJ_ID PROJNO NOT NULL, |
159 |
DEPT_NO DEPTNO NOT NULL, |
160 |
QUART_HEAD_CNT INTEGER[1:4], |
161 |
PROJECTED_BUDGET BUDGET, |
162 |
PRIMARY KEY (FISCAL_YEAR, PROJ_ID, DEPT_NO) |
163 |
); |
164 |
|
165 |
/* Table: SALARY_HISTORY, Owner: SYSDBA */ |
166 |
|
167 |
CREATE TABLE SALARY_HISTORY |
168 |
( |
169 |
EMP_NO EMPNO NOT NULL, |
170 |
CHANGE_DATE TIMESTAMP DEFAULT 'NOW' NOT NULL, |
171 |
UPDATER_ID VARCHAR(20) NOT NULL, |
172 |
OLD_SALARY SALARY NOT NULL, |
173 |
PERCENT_CHANGE DOUBLE PRECISION DEFAULT 0 NOT NULL, |
174 |
NEW_SALARY COMPUTED BY (old_salary + old_salary * percent_change / 100), |
175 |
PRIMARY KEY (EMP_NO, CHANGE_DATE, UPDATER_ID) |
176 |
); |
177 |
|
178 |
/* Table: SALES, Owner: SYSDBA */ |
179 |
|
180 |
CREATE TABLE SALES |
181 |
( |
182 |
PO_NUMBER PONUMBER NOT NULL, |
183 |
CUST_NO CUSTNO NOT NULL, |
184 |
SALES_REP EMPNO, |
185 |
ORDER_STATUS VARCHAR(7) DEFAULT 'new' NOT NULL, |
186 |
ORDER_DATE TIMESTAMP DEFAULT 'NOW' NOT NULL, |
187 |
SHIP_DATE TIMESTAMP, |
188 |
DATE_NEEDED TIMESTAMP, |
189 |
PAID CHAR(1) DEFAULT 'n', |
190 |
QTY_ORDERED INTEGER DEFAULT 1 NOT NULL, |
191 |
TOTAL_VALUE DECIMAL(9,2) NOT NULL, |
192 |
DISCOUNT FLOAT DEFAULT 0 NOT NULL, |
193 |
ITEM_TYPE PRODTYPE, |
194 |
AGED COMPUTED BY (ship_date - order_date), |
195 |
PRIMARY KEY (PO_NUMBER) |
196 |
); |
197 |
|
198 |
/* External Function declarations */ |
199 |
|
200 |
DECLARE EXTERNAL FUNCTION ADDDAY |
201 |
TIMESTAMP, INTEGER |
202 |
RETURNS TIMESTAMP |
203 |
ENTRY_POINT 'addDay' MODULE_NAME 'fbudf' |
204 |
; |
205 |
|
206 |
|
207 |
DECLARE EXTERNAL FUNCTION I64TRUNCATE |
208 |
NUMERIC(18,0) BY DESCRIPTOR, NUMERIC(18,0) BY DESCRIPTOR |
209 |
RETURNS PARAMETER 2 |
210 |
ENTRY_POINT 'fbtruncate' MODULE_NAME 'fbudf' |
211 |
; |
212 |
|
213 |
|
214 |
DECLARE EXTERNAL FUNCTION TESTIT |
215 |
TIMESTAMP, INTEGER NULL, CSTRING(10) CHARACTER SET NONE, CSTRING(10) CHARACTER SET NONE BY DESCRIPTOR |
216 |
RETURNS CSTRING(32) CHARACTER SET NONE FREE_IT |
217 |
ENTRY_POINT 'testit' MODULE_NAME 'fbudf' |
218 |
; |
219 |
|
220 |
|
221 |
/* Data Starts */ |
222 |
|
223 |
/* Inserting data into Table: COUNTRY */ |
224 |
|
225 |
INSERT INTO COUNTRY (COUNTRY,CURRENCY) VALUES('USA','Dollar'); |
226 |
INSERT INTO COUNTRY (COUNTRY,CURRENCY) VALUES('England','Pound'); |
227 |
INSERT INTO COUNTRY (COUNTRY,CURRENCY) VALUES('Canada','CdnDlr'); |
228 |
INSERT INTO COUNTRY (COUNTRY,CURRENCY) VALUES('Switzerland','SFranc'); |
229 |
INSERT INTO COUNTRY (COUNTRY,CURRENCY) VALUES('Japan','Yen'); |
230 |
INSERT INTO COUNTRY (COUNTRY,CURRENCY) VALUES('Italy','Euro'); |
231 |
INSERT INTO COUNTRY (COUNTRY,CURRENCY) VALUES('France','Euro'); |
232 |
INSERT INTO COUNTRY (COUNTRY,CURRENCY) VALUES('Germany','Euro'); |
233 |
INSERT INTO COUNTRY (COUNTRY,CURRENCY) VALUES('Australia','ADollar'); |
234 |
INSERT INTO COUNTRY (COUNTRY,CURRENCY) VALUES('Hong Kong','HKDollar'); |
235 |
INSERT INTO COUNTRY (COUNTRY,CURRENCY) VALUES('Netherlands','Euro'); |
236 |
INSERT INTO COUNTRY (COUNTRY,CURRENCY) VALUES('Belgium','Euro'); |
237 |
INSERT INTO COUNTRY (COUNTRY,CURRENCY) VALUES('Austria','Euro'); |
238 |
INSERT INTO COUNTRY (COUNTRY,CURRENCY) VALUES('Fiji','FDollar'); |
239 |
INSERT INTO COUNTRY (COUNTRY,CURRENCY) VALUES('Russia','Ruble'); |
240 |
INSERT INTO COUNTRY (COUNTRY,CURRENCY) VALUES('Romania','RLeu'); |
241 |
COMMIT; |
242 |
|
243 |
/* Inserting data into Table: CUSTOMER */ |
244 |
|
245 |
INSERT INTO CUSTOMER (CUST_NO,CUSTOMER,CONTACT_FIRST,CONTACT_LAST,PHONE_NO,ADDRESS_LINE1,ADDRESS_LINE2,CITY,STATE_PROVINCE,COUNTRY,POSTAL_CODE,ON_HOLD,LONG_REFERENCE) VALUES(1001,'Signature Design','Dale J.','Little','(619) 530-2710','15500 Pacific Heights Blvd.',NULL,'San Diego','CA','USA','92121',NULL,NULL); |
246 |
INSERT INTO CUSTOMER (CUST_NO,CUSTOMER,CONTACT_FIRST,CONTACT_LAST,PHONE_NO,ADDRESS_LINE1,ADDRESS_LINE2,CITY,STATE_PROVINCE,COUNTRY,POSTAL_CODE,ON_HOLD,LONG_REFERENCE) VALUES(1002,'Dallas Technologies','Glen','Brown','(214) 960-2233','P. O. Box 47000',NULL,'Dallas','TX','USA','75205','*',NULL); |
247 |
INSERT INTO CUSTOMER (CUST_NO,CUSTOMER,CONTACT_FIRST,CONTACT_LAST,PHONE_NO,ADDRESS_LINE1,ADDRESS_LINE2,CITY,STATE_PROVINCE,COUNTRY,POSTAL_CODE,ON_HOLD,LONG_REFERENCE) VALUES(1003,'Buttle, Griffith and Co.','James','Buttle','(617) 488-1864','2300 Newbury Street','Suite 101','Boston','MA','USA','02115',NULL,NULL); |
248 |
INSERT INTO CUSTOMER (CUST_NO,CUSTOMER,CONTACT_FIRST,CONTACT_LAST,PHONE_NO,ADDRESS_LINE1,ADDRESS_LINE2,CITY,STATE_PROVINCE,COUNTRY,POSTAL_CODE,ON_HOLD,LONG_REFERENCE) VALUES(1004,'Central Bank','Elizabeth','Brocket','61 211 99 88','66 Lloyd Street',NULL,'Manchester',NULL,'England','M2 3LA',NULL,NULL); |
249 |
INSERT INTO CUSTOMER (CUST_NO,CUSTOMER,CONTACT_FIRST,CONTACT_LAST,PHONE_NO,ADDRESS_LINE1,ADDRESS_LINE2,CITY,STATE_PROVINCE,COUNTRY,POSTAL_CODE,ON_HOLD,LONG_REFERENCE) VALUES(1005,'DT Systems, LTD.','Tai','Wu','(852) 850 43 98','400 Connaught Road',NULL,'Central Hong Kong',NULL,'Hong Kong',NULL,NULL,NULL); |
250 |
INSERT INTO CUSTOMER (CUST_NO,CUSTOMER,CONTACT_FIRST,CONTACT_LAST,PHONE_NO,ADDRESS_LINE1,ADDRESS_LINE2,CITY,STATE_PROVINCE,COUNTRY,POSTAL_CODE,ON_HOLD,LONG_REFERENCE) VALUES(1006,'DataServe International','Tomas','Bright','(613) 229 3323','2000 Carling Avenue','Suite 150','Ottawa','ON','Canada','K1V 9G1',NULL,NULL); |
251 |
INSERT INTO CUSTOMER (CUST_NO,CUSTOMER,CONTACT_FIRST,CONTACT_LAST,PHONE_NO,ADDRESS_LINE1,ADDRESS_LINE2,CITY,STATE_PROVINCE,COUNTRY,POSTAL_CODE,ON_HOLD,LONG_REFERENCE) VALUES(1007,'Mrs. Beauvais',NULL,'Mrs. Beauvais',NULL,'P.O. Box 22743',NULL,'Pebble Beach','CA','USA','93953',NULL,NULL); |
252 |
INSERT INTO CUSTOMER (CUST_NO,CUSTOMER,CONTACT_FIRST,CONTACT_LAST,PHONE_NO,ADDRESS_LINE1,ADDRESS_LINE2,CITY,STATE_PROVINCE,COUNTRY,POSTAL_CODE,ON_HOLD,LONG_REFERENCE) VALUES(1008,'Anini Vacation Rentals','Leilani','Briggs','(808) 835-7605','3320 Lawai Road',NULL,'Lihue','HI','USA','96766',NULL,NULL); |
253 |
INSERT INTO CUSTOMER (CUST_NO,CUSTOMER,CONTACT_FIRST,CONTACT_LAST,PHONE_NO,ADDRESS_LINE1,ADDRESS_LINE2,CITY,STATE_PROVINCE,COUNTRY,POSTAL_CODE,ON_HOLD,LONG_REFERENCE) VALUES(1009,'Max','Max',NULL,'22 01 23','1 Emerald Cove',NULL,'Turtle Island',NULL,'Fiji',NULL,'*',NULL); |
254 |
INSERT INTO CUSTOMER (CUST_NO,CUSTOMER,CONTACT_FIRST,CONTACT_LAST,PHONE_NO,ADDRESS_LINE1,ADDRESS_LINE2,CITY,STATE_PROVINCE,COUNTRY,POSTAL_CODE,ON_HOLD,LONG_REFERENCE) VALUES(1010,'MPM Corporation','Miwako','Miyamoto','3 880 77 19','2-64-7 Sasazuka',NULL,'Tokyo',NULL,'Japan','150',NULL,NULL); |
255 |
INSERT INTO CUSTOMER (CUST_NO,CUSTOMER,CONTACT_FIRST,CONTACT_LAST,PHONE_NO,ADDRESS_LINE1,ADDRESS_LINE2,CITY,STATE_PROVINCE,COUNTRY,POSTAL_CODE,ON_HOLD,LONG_REFERENCE) VALUES(1011,'Dynamic Intelligence Corp','Victor','Granges','01 221 16 50','Florhofgasse 10',NULL,'Zurich',NULL,'Switzerland','8005',NULL,NULL); |
256 |
INSERT INTO CUSTOMER (CUST_NO,CUSTOMER,CONTACT_FIRST,CONTACT_LAST,PHONE_NO,ADDRESS_LINE1,ADDRESS_LINE2,CITY,STATE_PROVINCE,COUNTRY,POSTAL_CODE,ON_HOLD,LONG_REFERENCE) VALUES(1012,'3D-Pad Corp.','Michelle','Roche','1 43 60 61','22 Place de la Concorde',NULL,'Paris',NULL,'France','75008',NULL,NULL); |
257 |
INSERT INTO CUSTOMER (CUST_NO,CUSTOMER,CONTACT_FIRST,CONTACT_LAST,PHONE_NO,ADDRESS_LINE1,ADDRESS_LINE2,CITY,STATE_PROVINCE,COUNTRY,POSTAL_CODE,ON_HOLD,LONG_REFERENCE) VALUES(1013,'Lorenzi Export, Ltd.','Andreas','Lorenzi','02 404 6284','Via Eugenia, 15',NULL,'Milan',NULL,'Italy','20124',NULL,NULL); |
258 |
INSERT INTO CUSTOMER (CUST_NO,CUSTOMER,CONTACT_FIRST,CONTACT_LAST,PHONE_NO,ADDRESS_LINE1,ADDRESS_LINE2,CITY,STATE_PROVINCE,COUNTRY,POSTAL_CODE,ON_HOLD,LONG_REFERENCE) VALUES(1014,'Dyno Consulting','Greta','Hessels','02 500 5940','Rue Royale 350',NULL,'Brussels',NULL,'Belgium','1210',NULL,NULL); |
259 |
INSERT INTO CUSTOMER (CUST_NO,CUSTOMER,CONTACT_FIRST,CONTACT_LAST,PHONE_NO,ADDRESS_LINE1,ADDRESS_LINE2,CITY,STATE_PROVINCE,COUNTRY,POSTAL_CODE,ON_HOLD,LONG_REFERENCE) VALUES(1015,'GeoTech Inc.','K.M.','Neppelenbroek','(070) 44 91 18','P.0.Box 702',NULL,'Den Haag',NULL,'Netherlands','2514',NULL,NULL); |
260 |
COMMIT; |
261 |
|
262 |
/* Inserting data into Table: DEPARTMENT */ |
263 |
|
264 |
INSERT INTO DEPARTMENT (DEPT_NO,DEPARTMENT,HEAD_DEPT,MNGR_NO,BUDGET,LOCATION,PHONE_NO) VALUES('000','Corporate Headquarters',NULL,105,1000000,'Monterey','(408) 555-1234'); |
265 |
INSERT INTO DEPARTMENT (DEPT_NO,DEPARTMENT,HEAD_DEPT,MNGR_NO,BUDGET,LOCATION,PHONE_NO) VALUES('100','Sales and Marketing','000',85,2000000,'San Francisco','(415) 555-1234'); |
266 |
INSERT INTO DEPARTMENT (DEPT_NO,DEPARTMENT,HEAD_DEPT,MNGR_NO,BUDGET,LOCATION,PHONE_NO) VALUES('600','Engineering','000',2,1100000,'Monterey','(408) 555-1234'); |
267 |
INSERT INTO DEPARTMENT (DEPT_NO,DEPARTMENT,HEAD_DEPT,MNGR_NO,BUDGET,LOCATION,PHONE_NO) VALUES('900','Finance','000',46,400000,'Monterey','(408) 555-1234'); |
268 |
INSERT INTO DEPARTMENT (DEPT_NO,DEPARTMENT,HEAD_DEPT,MNGR_NO,BUDGET,LOCATION,PHONE_NO) VALUES('180','Marketing','100',NULL,1500000,'San Francisco','(415) 555-1234'); |
269 |
INSERT INTO DEPARTMENT (DEPT_NO,DEPARTMENT,HEAD_DEPT,MNGR_NO,BUDGET,LOCATION,PHONE_NO) VALUES('620','Software Products Div.','600',NULL,1200000,'Monterey','(408) 555-1234'); |
270 |
INSERT INTO DEPARTMENT (DEPT_NO,DEPARTMENT,HEAD_DEPT,MNGR_NO,BUDGET,LOCATION,PHONE_NO) VALUES('621','Software Development','620',NULL,400000,'Monterey','(408) 555-1234'); |
271 |
INSERT INTO DEPARTMENT (DEPT_NO,DEPARTMENT,HEAD_DEPT,MNGR_NO,BUDGET,LOCATION,PHONE_NO) VALUES('622','Quality Assurance','620',9,300000,'Monterey','(408) 555-1234'); |
272 |
INSERT INTO DEPARTMENT (DEPT_NO,DEPARTMENT,HEAD_DEPT,MNGR_NO,BUDGET,LOCATION,PHONE_NO) VALUES('623','Customer Support','620',15,650000,'Monterey','(408) 555-1234'); |
273 |
INSERT INTO DEPARTMENT (DEPT_NO,DEPARTMENT,HEAD_DEPT,MNGR_NO,BUDGET,LOCATION,PHONE_NO) VALUES('670','Consumer Electronics Div.','600',107,1150000,'Burlington, VT','(802) 555-1234'); |
274 |
INSERT INTO DEPARTMENT (DEPT_NO,DEPARTMENT,HEAD_DEPT,MNGR_NO,BUDGET,LOCATION,PHONE_NO) VALUES('671','Research and Development','670',20,460000,'Burlington, VT','(802) 555-1234'); |
275 |
INSERT INTO DEPARTMENT (DEPT_NO,DEPARTMENT,HEAD_DEPT,MNGR_NO,BUDGET,LOCATION,PHONE_NO) VALUES('672','Customer Services','670',94,850000,'Burlington, VT','(802) 555-1234'); |
276 |
INSERT INTO DEPARTMENT (DEPT_NO,DEPARTMENT,HEAD_DEPT,MNGR_NO,BUDGET,LOCATION,PHONE_NO) VALUES('130','Field Office: East Coast','100',11,500000,'Boston','(617) 555-1234'); |
277 |
INSERT INTO DEPARTMENT (DEPT_NO,DEPARTMENT,HEAD_DEPT,MNGR_NO,BUDGET,LOCATION,PHONE_NO) VALUES('140','Field Office: Canada','100',72,500000,'Toronto','(416) 677-1000'); |
278 |
INSERT INTO DEPARTMENT (DEPT_NO,DEPARTMENT,HEAD_DEPT,MNGR_NO,BUDGET,LOCATION,PHONE_NO) VALUES('110','Pacific Rim Headquarters','100',34,600000,'Kuaui','(808) 555-1234'); |
279 |
INSERT INTO DEPARTMENT (DEPT_NO,DEPARTMENT,HEAD_DEPT,MNGR_NO,BUDGET,LOCATION,PHONE_NO) VALUES('115','Field Office: Japan','110',118,500000,'Tokyo','3 5350 0901'); |
280 |
INSERT INTO DEPARTMENT (DEPT_NO,DEPARTMENT,HEAD_DEPT,MNGR_NO,BUDGET,LOCATION,PHONE_NO) VALUES('116','Field Office: Singapore','110',NULL,300000,'Singapore','3 55 1234'); |
281 |
INSERT INTO DEPARTMENT (DEPT_NO,DEPARTMENT,HEAD_DEPT,MNGR_NO,BUDGET,LOCATION,PHONE_NO) VALUES('120','European Headquarters','100',36,700000,'London','71 235-4400'); |
282 |
INSERT INTO DEPARTMENT (DEPT_NO,DEPARTMENT,HEAD_DEPT,MNGR_NO,BUDGET,LOCATION,PHONE_NO) VALUES('121','Field Office: Switzerland','120',141,500000,'Zurich','1 211 7767'); |
283 |
INSERT INTO DEPARTMENT (DEPT_NO,DEPARTMENT,HEAD_DEPT,MNGR_NO,BUDGET,LOCATION,PHONE_NO) VALUES('123','Field Office: France','120',134,400000,'Cannes','58 68 11 12'); |
284 |
INSERT INTO DEPARTMENT (DEPT_NO,DEPARTMENT,HEAD_DEPT,MNGR_NO,BUDGET,LOCATION,PHONE_NO) VALUES('125','Field Office: Italy','120',121,400000,'Milan','2 430 39 39'); |
285 |
COMMIT; |
286 |
|
287 |
/* Inserting data into Table: EMPLOYEE */ |
288 |
|
289 |
INSERT INTO EMPLOYEE (EMP_NO,FIRST_NAME,LAST_NAME,PHONE_EXT,HIRE_DATE,DEPT_NO,JOB_CODE,JOB_GRADE,JOB_COUNTRY,SALARY) VALUES(2,'Robert','Nelson','250','1988.12.28 00:00:00.000','600','VP',2,'USA',105900); |
290 |
INSERT INTO EMPLOYEE (EMP_NO,FIRST_NAME,LAST_NAME,PHONE_EXT,HIRE_DATE,DEPT_NO,JOB_CODE,JOB_GRADE,JOB_COUNTRY,SALARY) VALUES(4,'Bruce','Young','233','1988.12.28 00:00:00.000','621','Eng',2,'USA',97500); |
291 |
INSERT INTO EMPLOYEE (EMP_NO,FIRST_NAME,LAST_NAME,PHONE_EXT,HIRE_DATE,DEPT_NO,JOB_CODE,JOB_GRADE,JOB_COUNTRY,SALARY) VALUES(5,'Kim','Lambert','22','1989.02.06 00:00:00.000','130','Eng',2,'USA',102750); |
292 |
INSERT INTO EMPLOYEE (EMP_NO,FIRST_NAME,LAST_NAME,PHONE_EXT,HIRE_DATE,DEPT_NO,JOB_CODE,JOB_GRADE,JOB_COUNTRY,SALARY) VALUES(8,'Leslie','Johnson','410','1989.04.05 00:00:00.000','180','Mktg',3,'USA',64635); |
293 |
INSERT INTO EMPLOYEE (EMP_NO,FIRST_NAME,LAST_NAME,PHONE_EXT,HIRE_DATE,DEPT_NO,JOB_CODE,JOB_GRADE,JOB_COUNTRY,SALARY) VALUES(9,'Phil','Forest','229','1989.04.17 00:00:00.000','622','Mngr',3,'USA',75060); |
294 |
INSERT INTO EMPLOYEE (EMP_NO,FIRST_NAME,LAST_NAME,PHONE_EXT,HIRE_DATE,DEPT_NO,JOB_CODE,JOB_GRADE,JOB_COUNTRY,SALARY) VALUES(11,'K. J.','Weston','34','1990.01.17 00:00:00.000','130','SRep',4,'USA',86292.94); |
295 |
INSERT INTO EMPLOYEE (EMP_NO,FIRST_NAME,LAST_NAME,PHONE_EXT,HIRE_DATE,DEPT_NO,JOB_CODE,JOB_GRADE,JOB_COUNTRY,SALARY) VALUES(12,'Terri','Lee','256','1990.05.01 00:00:00.000','000','Admin',4,'USA',53793); |
296 |
INSERT INTO EMPLOYEE (EMP_NO,FIRST_NAME,LAST_NAME,PHONE_EXT,HIRE_DATE,DEPT_NO,JOB_CODE,JOB_GRADE,JOB_COUNTRY,SALARY) VALUES(14,'Stewart','Hall','227','1990.06.04 00:00:00.000','900','Finan',3,'USA',69482.63); |
297 |
INSERT INTO EMPLOYEE (EMP_NO,FIRST_NAME,LAST_NAME,PHONE_EXT,HIRE_DATE,DEPT_NO,JOB_CODE,JOB_GRADE,JOB_COUNTRY,SALARY) VALUES(15,'Katherine','Young','231','1990.06.14 00:00:00.000','623','Mngr',3,'USA',67241.25); |
298 |
INSERT INTO EMPLOYEE (EMP_NO,FIRST_NAME,LAST_NAME,PHONE_EXT,HIRE_DATE,DEPT_NO,JOB_CODE,JOB_GRADE,JOB_COUNTRY,SALARY) VALUES(20,'Chris','Papadopoulos','887','1990.01.01 00:00:00.000','671','Mngr',3,'USA',89655); |
299 |
INSERT INTO EMPLOYEE (EMP_NO,FIRST_NAME,LAST_NAME,PHONE_EXT,HIRE_DATE,DEPT_NO,JOB_CODE,JOB_GRADE,JOB_COUNTRY,SALARY) VALUES(24,'Pete','Fisher','888','1990.09.12 00:00:00.000','671','Eng',3,'USA',81810.19); |
300 |
INSERT INTO EMPLOYEE (EMP_NO,FIRST_NAME,LAST_NAME,PHONE_EXT,HIRE_DATE,DEPT_NO,JOB_CODE,JOB_GRADE,JOB_COUNTRY,SALARY) VALUES(28,'Ann','Bennet','5','1991.02.01 00:00:00.000','120','Admin',5,'England',22935); |
301 |
INSERT INTO EMPLOYEE (EMP_NO,FIRST_NAME,LAST_NAME,PHONE_EXT,HIRE_DATE,DEPT_NO,JOB_CODE,JOB_GRADE,JOB_COUNTRY,SALARY) VALUES(29,'Roger','De Souza','288','1991.02.18 00:00:00.000','623','Eng',3,'USA',69482.63); |
302 |
INSERT INTO EMPLOYEE (EMP_NO,FIRST_NAME,LAST_NAME,PHONE_EXT,HIRE_DATE,DEPT_NO,JOB_CODE,JOB_GRADE,JOB_COUNTRY,SALARY) VALUES(34,'Janet','Baldwin','2','1991.03.21 00:00:00.000','110','Sales',3,'USA',61637.8); |
303 |
INSERT INTO EMPLOYEE (EMP_NO,FIRST_NAME,LAST_NAME,PHONE_EXT,HIRE_DATE,DEPT_NO,JOB_CODE,JOB_GRADE,JOB_COUNTRY,SALARY) VALUES(36,'Roger','Reeves','6','1991.04.25 00:00:00.000','120','Sales',3,'England',33620.63); |
304 |
INSERT INTO EMPLOYEE (EMP_NO,FIRST_NAME,LAST_NAME,PHONE_EXT,HIRE_DATE,DEPT_NO,JOB_CODE,JOB_GRADE,JOB_COUNTRY,SALARY) VALUES(37,'Willie','Stansbury','7','1991.04.25 00:00:00.000','120','Eng',4,'England',39224.06); |
305 |
INSERT INTO EMPLOYEE (EMP_NO,FIRST_NAME,LAST_NAME,PHONE_EXT,HIRE_DATE,DEPT_NO,JOB_CODE,JOB_GRADE,JOB_COUNTRY,SALARY) VALUES(44,'Leslie','Phong','216','1991.06.03 00:00:00.000','623','Eng',4,'USA',56034.38); |
306 |
INSERT INTO EMPLOYEE (EMP_NO,FIRST_NAME,LAST_NAME,PHONE_EXT,HIRE_DATE,DEPT_NO,JOB_CODE,JOB_GRADE,JOB_COUNTRY,SALARY) VALUES(45,'Ashok','Ramanathan','209','1991.08.01 00:00:00.000','621','Eng',3,'USA',80689.5); |
307 |
INSERT INTO EMPLOYEE (EMP_NO,FIRST_NAME,LAST_NAME,PHONE_EXT,HIRE_DATE,DEPT_NO,JOB_CODE,JOB_GRADE,JOB_COUNTRY,SALARY) VALUES(46,'Walter','Steadman','210','1991.08.09 00:00:00.000','900','CFO',1,'USA',116100); |
308 |
INSERT INTO EMPLOYEE (EMP_NO,FIRST_NAME,LAST_NAME,PHONE_EXT,HIRE_DATE,DEPT_NO,JOB_CODE,JOB_GRADE,JOB_COUNTRY,SALARY) VALUES(52,'Carol','Nordstrom','420','1991.10.02 00:00:00.000','180','PRel',4,'USA',42742.5); |
309 |
INSERT INTO EMPLOYEE (EMP_NO,FIRST_NAME,LAST_NAME,PHONE_EXT,HIRE_DATE,DEPT_NO,JOB_CODE,JOB_GRADE,JOB_COUNTRY,SALARY) VALUES(61,'Luke','Leung','3','1992.02.18 00:00:00.000','110','SRep',4,'USA',68805); |
310 |
INSERT INTO EMPLOYEE (EMP_NO,FIRST_NAME,LAST_NAME,PHONE_EXT,HIRE_DATE,DEPT_NO,JOB_CODE,JOB_GRADE,JOB_COUNTRY,SALARY) VALUES(65,'Sue Anne','O''Brien','877','1992.03.23 00:00:00.000','670','Admin',5,'USA',31275); |
311 |
INSERT INTO EMPLOYEE (EMP_NO,FIRST_NAME,LAST_NAME,PHONE_EXT,HIRE_DATE,DEPT_NO,JOB_CODE,JOB_GRADE,JOB_COUNTRY,SALARY) VALUES(71,'Jennifer M.','Burbank','289','1992.04.15 00:00:00.000','622','Eng',3,'USA',53167.5); |
312 |
INSERT INTO EMPLOYEE (EMP_NO,FIRST_NAME,LAST_NAME,PHONE_EXT,HIRE_DATE,DEPT_NO,JOB_CODE,JOB_GRADE,JOB_COUNTRY,SALARY) VALUES(72,'Claudia','Sutherland',NULL,'1992.04.20 00:00:00.000','140','SRep',4,'Canada',100914); |
313 |
INSERT INTO EMPLOYEE (EMP_NO,FIRST_NAME,LAST_NAME,PHONE_EXT,HIRE_DATE,DEPT_NO,JOB_CODE,JOB_GRADE,JOB_COUNTRY,SALARY) VALUES(83,'Dana','Bishop','290','1992.06.02 00:00:00.000','621','Eng',3,'USA',62550.02); |
314 |
INSERT INTO EMPLOYEE (EMP_NO,FIRST_NAME,LAST_NAME,PHONE_EXT,HIRE_DATE,DEPT_NO,JOB_CODE,JOB_GRADE,JOB_COUNTRY,SALARY) VALUES(85,'Mary S.','MacDonald','477','1992.06.01 00:00:00.000','100','VP',2,'USA',111262.5); |
315 |
INSERT INTO EMPLOYEE (EMP_NO,FIRST_NAME,LAST_NAME,PHONE_EXT,HIRE_DATE,DEPT_NO,JOB_CODE,JOB_GRADE,JOB_COUNTRY,SALARY) VALUES(94,'Randy','Williams','892','1992.08.08 00:00:00.000','672','Mngr',4,'USA',56295); |
316 |
INSERT INTO EMPLOYEE (EMP_NO,FIRST_NAME,LAST_NAME,PHONE_EXT,HIRE_DATE,DEPT_NO,JOB_CODE,JOB_GRADE,JOB_COUNTRY,SALARY) VALUES(105,'Oliver H A','Bender','255','1992.10.08 00:00:00.000','000','CEO',1,'USA',212850); |
317 |
INSERT INTO EMPLOYEE (EMP_NO,FIRST_NAME,LAST_NAME,PHONE_EXT,HIRE_DATE,DEPT_NO,JOB_CODE,JOB_GRADE,JOB_COUNTRY,SALARY) VALUES(107,'Kevin','Cook','894','1993.02.01 00:00:00.000','670','Dir',2,'USA',111262.5); |
318 |
INSERT INTO EMPLOYEE (EMP_NO,FIRST_NAME,LAST_NAME,PHONE_EXT,HIRE_DATE,DEPT_NO,JOB_CODE,JOB_GRADE,JOB_COUNTRY,SALARY) VALUES(109,'Kelly','Brown','202','1993.02.04 00:00:00.000','600','Admin',5,'USA',27000.01); |
319 |
INSERT INTO EMPLOYEE (EMP_NO,FIRST_NAME,LAST_NAME,PHONE_EXT,HIRE_DATE,DEPT_NO,JOB_CODE,JOB_GRADE,JOB_COUNTRY,SALARY) VALUES(110,'Yuki','Ichida','22','1993.02.04 00:00:00.000','115','Eng',3,'Japan',6000000); |
320 |
INSERT INTO EMPLOYEE (EMP_NO,FIRST_NAME,LAST_NAME,PHONE_EXT,HIRE_DATE,DEPT_NO,JOB_CODE,JOB_GRADE,JOB_COUNTRY,SALARY) VALUES(113,'Mary','Page','845','1993.04.12 00:00:00.000','671','Eng',4,'USA',48000); |
321 |
INSERT INTO EMPLOYEE (EMP_NO,FIRST_NAME,LAST_NAME,PHONE_EXT,HIRE_DATE,DEPT_NO,JOB_CODE,JOB_GRADE,JOB_COUNTRY,SALARY) VALUES(114,'Bill','Parker','247','1993.06.01 00:00:00.000','623','Eng',5,'USA',35000); |
322 |
INSERT INTO EMPLOYEE (EMP_NO,FIRST_NAME,LAST_NAME,PHONE_EXT,HIRE_DATE,DEPT_NO,JOB_CODE,JOB_GRADE,JOB_COUNTRY,SALARY) VALUES(118,'Takashi','Yamamoto','23','1993.07.01 00:00:00.000','115','SRep',4,'Japan',7480000); |
323 |
INSERT INTO EMPLOYEE (EMP_NO,FIRST_NAME,LAST_NAME,PHONE_EXT,HIRE_DATE,DEPT_NO,JOB_CODE,JOB_GRADE,JOB_COUNTRY,SALARY) VALUES(121,'Roberto','Ferrari','1','1993.07.12 00:00:00.000','125','SRep',4,'USA',33000.01); |
324 |
INSERT INTO EMPLOYEE (EMP_NO,FIRST_NAME,LAST_NAME,PHONE_EXT,HIRE_DATE,DEPT_NO,JOB_CODE,JOB_GRADE,JOB_COUNTRY,SALARY) VALUES(127,'Michael','Yanowski','492','1993.08.09 00:00:00.000','100','SRep',4,'USA',44000); |
325 |
INSERT INTO EMPLOYEE (EMP_NO,FIRST_NAME,LAST_NAME,PHONE_EXT,HIRE_DATE,DEPT_NO,JOB_CODE,JOB_GRADE,JOB_COUNTRY,SALARY) VALUES(134,'Jacques','Glon',NULL,'1993.08.23 00:00:00.000','123','SRep',4,'France',38500); |
326 |
INSERT INTO EMPLOYEE (EMP_NO,FIRST_NAME,LAST_NAME,PHONE_EXT,HIRE_DATE,DEPT_NO,JOB_CODE,JOB_GRADE,JOB_COUNTRY,SALARY) VALUES(136,'Scott','Johnson','265','1993.09.13 00:00:00.000','623','Doc',3,'USA',60000); |
327 |
INSERT INTO EMPLOYEE (EMP_NO,FIRST_NAME,LAST_NAME,PHONE_EXT,HIRE_DATE,DEPT_NO,JOB_CODE,JOB_GRADE,JOB_COUNTRY,SALARY) VALUES(138,'T.J.','Green','218','1993.11.01 00:00:00.000','621','Eng',4,'USA',36000); |
328 |
INSERT INTO EMPLOYEE (EMP_NO,FIRST_NAME,LAST_NAME,PHONE_EXT,HIRE_DATE,DEPT_NO,JOB_CODE,JOB_GRADE,JOB_COUNTRY,SALARY) VALUES(141,'Pierre','Osborne',NULL,'1994.01.03 00:00:00.000','121','SRep',4,'Switzerland',110000); |
329 |
INSERT INTO EMPLOYEE (EMP_NO,FIRST_NAME,LAST_NAME,PHONE_EXT,HIRE_DATE,DEPT_NO,JOB_CODE,JOB_GRADE,JOB_COUNTRY,SALARY) VALUES(144,'John','Montgomery','820','1994.03.30 00:00:00.000','672','Eng',5,'USA',35000); |
330 |
INSERT INTO EMPLOYEE (EMP_NO,FIRST_NAME,LAST_NAME,PHONE_EXT,HIRE_DATE,DEPT_NO,JOB_CODE,JOB_GRADE,JOB_COUNTRY,SALARY) VALUES(145,'Mark','Guckenheimer','221','1994.05.02 00:00:00.000','622','Eng',5,'USA',32000); |
331 |
COMMIT; |
332 |
|
333 |
/* Inserting data into Table: EMPLOYEE_PROJECT */ |
334 |
|
335 |
INSERT INTO EMPLOYEE_PROJECT (EMP_NO,PROJ_ID) VALUES(144,'DGPII'); |
336 |
INSERT INTO EMPLOYEE_PROJECT (EMP_NO,PROJ_ID) VALUES(113,'DGPII'); |
337 |
INSERT INTO EMPLOYEE_PROJECT (EMP_NO,PROJ_ID) VALUES(24,'DGPII'); |
338 |
INSERT INTO EMPLOYEE_PROJECT (EMP_NO,PROJ_ID) VALUES(8,'VBASE'); |
339 |
INSERT INTO EMPLOYEE_PROJECT (EMP_NO,PROJ_ID) VALUES(136,'VBASE'); |
340 |
INSERT INTO EMPLOYEE_PROJECT (EMP_NO,PROJ_ID) VALUES(15,'VBASE'); |
341 |
INSERT INTO EMPLOYEE_PROJECT (EMP_NO,PROJ_ID) VALUES(71,'VBASE'); |
342 |
INSERT INTO EMPLOYEE_PROJECT (EMP_NO,PROJ_ID) VALUES(145,'VBASE'); |
343 |
INSERT INTO EMPLOYEE_PROJECT (EMP_NO,PROJ_ID) VALUES(44,'VBASE'); |
344 |
INSERT INTO EMPLOYEE_PROJECT (EMP_NO,PROJ_ID) VALUES(4,'VBASE'); |
345 |
INSERT INTO EMPLOYEE_PROJECT (EMP_NO,PROJ_ID) VALUES(83,'VBASE'); |
346 |
INSERT INTO EMPLOYEE_PROJECT (EMP_NO,PROJ_ID) VALUES(138,'VBASE'); |
347 |
INSERT INTO EMPLOYEE_PROJECT (EMP_NO,PROJ_ID) VALUES(45,'VBASE'); |
348 |
INSERT INTO EMPLOYEE_PROJECT (EMP_NO,PROJ_ID) VALUES(20,'GUIDE'); |
349 |
INSERT INTO EMPLOYEE_PROJECT (EMP_NO,PROJ_ID) VALUES(24,'GUIDE'); |
350 |
INSERT INTO EMPLOYEE_PROJECT (EMP_NO,PROJ_ID) VALUES(113,'GUIDE'); |
351 |
INSERT INTO EMPLOYEE_PROJECT (EMP_NO,PROJ_ID) VALUES(8,'GUIDE'); |
352 |
INSERT INTO EMPLOYEE_PROJECT (EMP_NO,PROJ_ID) VALUES(4,'MAPDB'); |
353 |
INSERT INTO EMPLOYEE_PROJECT (EMP_NO,PROJ_ID) VALUES(71,'MAPDB'); |
354 |
INSERT INTO EMPLOYEE_PROJECT (EMP_NO,PROJ_ID) VALUES(46,'MKTPR'); |
355 |
INSERT INTO EMPLOYEE_PROJECT (EMP_NO,PROJ_ID) VALUES(105,'MKTPR'); |
356 |
INSERT INTO EMPLOYEE_PROJECT (EMP_NO,PROJ_ID) VALUES(12,'MKTPR'); |
357 |
INSERT INTO EMPLOYEE_PROJECT (EMP_NO,PROJ_ID) VALUES(85,'MKTPR'); |
358 |
INSERT INTO EMPLOYEE_PROJECT (EMP_NO,PROJ_ID) VALUES(110,'MKTPR'); |
359 |
INSERT INTO EMPLOYEE_PROJECT (EMP_NO,PROJ_ID) VALUES(34,'MKTPR'); |
360 |
INSERT INTO EMPLOYEE_PROJECT (EMP_NO,PROJ_ID) VALUES(8,'MKTPR'); |
361 |
INSERT INTO EMPLOYEE_PROJECT (EMP_NO,PROJ_ID) VALUES(14,'MKTPR'); |
362 |
INSERT INTO EMPLOYEE_PROJECT (EMP_NO,PROJ_ID) VALUES(52,'MKTPR'); |
363 |
COMMIT; |
364 |
|
365 |
/* Inserting data into Table: JOB */ |
366 |
|
367 |
INSERT INTO JOB (JOB_CODE,JOB_GRADE,JOB_COUNTRY,JOB_TITLE,MIN_SALARY,MAX_SALARY,JOB_REQUIREMENT,LANGUAGE_REQ) VALUES('CEO',1,'USA','Chief Executive Officer',130000,250000,'No specific requirements. |
368 |
',NULL); |
369 |
INSERT INTO JOB (JOB_CODE,JOB_GRADE,JOB_COUNTRY,JOB_TITLE,MIN_SALARY,MAX_SALARY,JOB_REQUIREMENT,LANGUAGE_REQ) VALUES('CFO',1,'USA','Chief Financial Officer',85000,140000,'15+ years in finance or 5+ years as a CFO |
370 |
with a proven track record. |
371 |
MBA or J.D. degree. |
372 |
',NULL); |
373 |
INSERT INTO JOB (JOB_CODE,JOB_GRADE,JOB_COUNTRY,JOB_TITLE,MIN_SALARY,MAX_SALARY,JOB_REQUIREMENT,LANGUAGE_REQ) VALUES('VP',2,'USA','Vice President',80000,130000,'No specific requirements. |
374 |
',NULL); |
375 |
INSERT INTO JOB (JOB_CODE,JOB_GRADE,JOB_COUNTRY,JOB_TITLE,MIN_SALARY,MAX_SALARY,JOB_REQUIREMENT,LANGUAGE_REQ) VALUES('Dir',2,'USA','Director',75000,120000,'5-10 years as a director in computer or electronics industries. |
376 |
An advanced degree. |
377 |
',NULL); |
378 |
INSERT INTO JOB (JOB_CODE,JOB_GRADE,JOB_COUNTRY,JOB_TITLE,MIN_SALARY,MAX_SALARY,JOB_REQUIREMENT,LANGUAGE_REQ) VALUES('Mngr',3,'USA','Manager',60000,100000,'BA/BS required. |
379 |
3-5 years in management, |
380 |
plus 2-4 years engineering experience. |
381 |
',NULL); |
382 |
INSERT INTO JOB (JOB_CODE,JOB_GRADE,JOB_COUNTRY,JOB_TITLE,MIN_SALARY,MAX_SALARY,JOB_REQUIREMENT,LANGUAGE_REQ) VALUES('Mngr',4,'USA','Manager',30000,60000,'5+ years office management experience. |
383 |
',NULL); |
384 |
INSERT INTO JOB (JOB_CODE,JOB_GRADE,JOB_COUNTRY,JOB_TITLE,MIN_SALARY,MAX_SALARY,JOB_REQUIREMENT,LANGUAGE_REQ) VALUES('Admin',4,'USA','Administrative Assistant',35000,55000,'3-5 years experience in executive environment. |
385 |
Strong organizational and communication skills required. |
386 |
BA degree preferred. |
387 |
',NULL); |
388 |
INSERT INTO JOB (JOB_CODE,JOB_GRADE,JOB_COUNTRY,JOB_TITLE,MIN_SALARY,MAX_SALARY,JOB_REQUIREMENT,LANGUAGE_REQ) VALUES('Admin',5,'USA','Administrative Assistant',20000,40000,'2-4 years clerical experience. |
389 |
Facility with word processing and data entry. |
390 |
AA degree preferred. |
391 |
',NULL); |
392 |
INSERT INTO JOB (JOB_CODE,JOB_GRADE,JOB_COUNTRY,JOB_TITLE,MIN_SALARY,MAX_SALARY,JOB_REQUIREMENT,LANGUAGE_REQ) VALUES('Admin',5,'England','Administrative Assistant',13400,26800,NULL,NULL); |
393 |
INSERT INTO JOB (JOB_CODE,JOB_GRADE,JOB_COUNTRY,JOB_TITLE,MIN_SALARY,MAX_SALARY,JOB_REQUIREMENT,LANGUAGE_REQ) VALUES('PRel',4,'USA','Public Relations Rep.',25000,65000,NULL,NULL); |
394 |
INSERT INTO JOB (JOB_CODE,JOB_GRADE,JOB_COUNTRY,JOB_TITLE,MIN_SALARY,MAX_SALARY,JOB_REQUIREMENT,LANGUAGE_REQ) VALUES('Mktg',3,'USA','Marketing Analyst',40000,80000,'MBA required. |
395 |
10+ years experience in high tech environment. |
396 |
',NULL); |
397 |
INSERT INTO JOB (JOB_CODE,JOB_GRADE,JOB_COUNTRY,JOB_TITLE,MIN_SALARY,MAX_SALARY,JOB_REQUIREMENT,LANGUAGE_REQ) VALUES('Mktg',4,'USA','Marketing Analyst',20000,50000,'BA/BS required. MBA preferred. |
398 |
3-5 years experience. |
399 |
Knowledgeable with spreadsheets and databases. |
400 |
',NULL); |
401 |
INSERT INTO JOB (JOB_CODE,JOB_GRADE,JOB_COUNTRY,JOB_TITLE,MIN_SALARY,MAX_SALARY,JOB_REQUIREMENT,LANGUAGE_REQ) VALUES('Accnt',4,'USA','Accountant',28000,55000,'CPA with 3-5 years experience. |
402 |
Spreadsheet, data entry, and word processing knowledge required. |
403 |
',NULL); |
404 |
INSERT INTO JOB (JOB_CODE,JOB_GRADE,JOB_COUNTRY,JOB_TITLE,MIN_SALARY,MAX_SALARY,JOB_REQUIREMENT,LANGUAGE_REQ) VALUES('Finan',3,'USA','Financial Analyst',35000,85000,'5-10 years of accounting and financial experience. |
405 |
Strong analytical skills. |
406 |
CPA/MBA required. |
407 |
',NULL); |
408 |
INSERT INTO JOB (JOB_CODE,JOB_GRADE,JOB_COUNTRY,JOB_TITLE,MIN_SALARY,MAX_SALARY,JOB_REQUIREMENT,LANGUAGE_REQ) VALUES('Eng',2,'USA','Engineer',70000,110000,'Distinguished engineer. |
409 |
Ph.D/MS/BS or equivalent experience. |
410 |
',NULL); |
411 |
INSERT INTO JOB (JOB_CODE,JOB_GRADE,JOB_COUNTRY,JOB_TITLE,MIN_SALARY,MAX_SALARY,JOB_REQUIREMENT,LANGUAGE_REQ) VALUES('Eng',3,'USA','Engineer',50000,90000,'5+ years experience. |
412 |
BA/BS required. |
413 |
MS degree preferred. |
414 |
',NULL); |
415 |
INSERT INTO JOB (JOB_CODE,JOB_GRADE,JOB_COUNTRY,JOB_TITLE,MIN_SALARY,MAX_SALARY,JOB_REQUIREMENT,LANGUAGE_REQ) VALUES('Eng',3,'Japan','Engineer',5400000,9720000,'5+ years experience. |
416 |
BA/BS and/or MS degrees required. |
417 |
Customer support experience desired. |
418 |
Knowledge of Japanese and English. |
419 |
',<array dim = "1" sqltype = "448" length = "15" relation_name = "JOB" column_name = "LANGUAGE_REQ" charset = "NONE" bounds="1:5"> |
420 |
<elt ix="1">Japanese |
421 |
</elt> |
422 |
<elt ix="2">Mandarin |
423 |
</elt> |
424 |
<elt ix="3">English |
425 |
</elt> |
426 |
<elt ix="4"> |
427 |
</elt> |
428 |
<elt ix="5"> |
429 |
</elt> |
430 |
</array> |
431 |
); |
432 |
INSERT INTO JOB (JOB_CODE,JOB_GRADE,JOB_COUNTRY,JOB_TITLE,MIN_SALARY,MAX_SALARY,JOB_REQUIREMENT,LANGUAGE_REQ) VALUES('Eng',4,'USA','Engineer',30000,65000,'BA/BS and 3-5 years experience. |
433 |
',NULL); |
434 |
INSERT INTO JOB (JOB_CODE,JOB_GRADE,JOB_COUNTRY,JOB_TITLE,MIN_SALARY,MAX_SALARY,JOB_REQUIREMENT,LANGUAGE_REQ) VALUES('Eng',4,'England','Engineer',20100,43550,'BA/BS and |
435 |
2-4 years experience in technical support. |
436 |
Knowledge of several European languages helpful. |
437 |
',<array dim = "1" sqltype = "448" length = "15" relation_name = "JOB" column_name = "LANGUAGE_REQ" charset = "NONE" bounds="1:5"> |
438 |
<elt ix="1">English |
439 |
</elt> |
440 |
<elt ix="2">German |
441 |
</elt> |
442 |
<elt ix="3">French |
443 |
</elt> |
444 |
<elt ix="4"> |
445 |
</elt> |
446 |
<elt ix="5"> |
447 |
</elt> |
448 |
</array> |
449 |
); |
450 |
INSERT INTO JOB (JOB_CODE,JOB_GRADE,JOB_COUNTRY,JOB_TITLE,MIN_SALARY,MAX_SALARY,JOB_REQUIREMENT,LANGUAGE_REQ) VALUES('Eng',5,'USA','Engineer',25000,35000,'BA/BS preferred. |
451 |
2-4 years technical experience. |
452 |
',NULL); |
453 |
INSERT INTO JOB (JOB_CODE,JOB_GRADE,JOB_COUNTRY,JOB_TITLE,MIN_SALARY,MAX_SALARY,JOB_REQUIREMENT,LANGUAGE_REQ) VALUES('Doc',3,'USA','Technical Writer',38000,60000,'4+ years writing highly technical |
454 |
software documentation. |
455 |
A bachelor''s degree or equivalent. |
456 |
Programming experience required. |
457 |
Excellent language skills. |
458 |
',NULL); |
459 |
INSERT INTO JOB (JOB_CODE,JOB_GRADE,JOB_COUNTRY,JOB_TITLE,MIN_SALARY,MAX_SALARY,JOB_REQUIREMENT,LANGUAGE_REQ) VALUES('Doc',5,'USA','Technical Writer',22000,40000,'BA in English/journalism or excellent language skills. |
460 |
Some programming experience required. |
461 |
2-4 years of technical writing. |
462 |
',NULL); |
463 |
INSERT INTO JOB (JOB_CODE,JOB_GRADE,JOB_COUNTRY,JOB_TITLE,MIN_SALARY,MAX_SALARY,JOB_REQUIREMENT,LANGUAGE_REQ) VALUES('Sales',3,'USA','Sales Co-ordinator',40000,70000,'Experience in sales and public relations |
464 |
in a high tech environment. |
465 |
Excellent communication skills. |
466 |
BA or equivalent. |
467 |
',NULL); |
468 |
INSERT INTO JOB (JOB_CODE,JOB_GRADE,JOB_COUNTRY,JOB_TITLE,MIN_SALARY,MAX_SALARY,JOB_REQUIREMENT,LANGUAGE_REQ) VALUES('Sales',3,'England','Sales Co-ordinator',26800,46900,'Experience in sales and public relations |
469 |
in a high tech environment. |
470 |
Excellent communication skills. |
471 |
BA or equivalent. |
472 |
Knowledge of several European languages helpful. |
473 |
',<array dim = "1" sqltype = "448" length = "15" relation_name = "JOB" column_name = "LANGUAGE_REQ" charset = "NONE" bounds="1:5"> |
474 |
<elt ix="1">English |
475 |
</elt> |
476 |
<elt ix="2">German |
477 |
</elt> |
478 |
<elt ix="3">French |
479 |
</elt> |
480 |
<elt ix="4"> |
481 |
</elt> |
482 |
<elt ix="5"> |
483 |
</elt> |
484 |
</array> |
485 |
); |
486 |
INSERT INTO JOB (JOB_CODE,JOB_GRADE,JOB_COUNTRY,JOB_TITLE,MIN_SALARY,MAX_SALARY,JOB_REQUIREMENT,LANGUAGE_REQ) VALUES('SRep',4,'USA','Sales Representative',20000,100000,'Computer/electronics industry sales experience. |
487 |
Excellent communications, negotiation, and analytical skills. |
488 |
Experience in establishing long term customer relationships. |
489 |
Some knowledge of Spanish required. |
490 |
Travel required. |
491 |
',<array dim = "1" sqltype = "448" length = "15" relation_name = "JOB" column_name = "LANGUAGE_REQ" charset = "NONE" bounds="1:5"> |
492 |
<elt ix="1">English |
493 |
</elt> |
494 |
<elt ix="2">Spanish |
495 |
</elt> |
496 |
<elt ix="3"> |
497 |
</elt> |
498 |
<elt ix="4"> |
499 |
</elt> |
500 |
<elt ix="5"> |
501 |
</elt> |
502 |
</array> |
503 |
); |
504 |
INSERT INTO JOB (JOB_CODE,JOB_GRADE,JOB_COUNTRY,JOB_TITLE,MIN_SALARY,MAX_SALARY,JOB_REQUIREMENT,LANGUAGE_REQ) VALUES('SRep',4,'England','Sales Representative',13400,67000,'Computer/electronics industry sales experience. |
505 |
Excellent communications, negotiation, and analytical skills. |
506 |
Experience in establishing long term customer relationships. |
507 |
Knowledge of several European languages helpful. |
508 |
Travel required. |
509 |
',<array dim = "1" sqltype = "448" length = "15" relation_name = "JOB" column_name = "LANGUAGE_REQ" charset = "NONE" bounds="1:5"> |
510 |
<elt ix="1">English |
511 |
</elt> |
512 |
<elt ix="2">German |
513 |
</elt> |
514 |
<elt ix="3">French |
515 |
</elt> |
516 |
<elt ix="4"> |
517 |
</elt> |
518 |
<elt ix="5"> |
519 |
</elt> |
520 |
</array> |
521 |
); |
522 |
INSERT INTO JOB (JOB_CODE,JOB_GRADE,JOB_COUNTRY,JOB_TITLE,MIN_SALARY,MAX_SALARY,JOB_REQUIREMENT,LANGUAGE_REQ) VALUES('SRep',4,'Canada','Sales Representative',26400,132000,'Computer/electronics industry sales experience. |
523 |
Excellent communications, negotiation, and analytical skills. |
524 |
Experience in establishing long term customer relationships. |
525 |
Travel required. |
526 |
English plus speaking knowledge of French required. |
527 |
',<array dim = "1" sqltype = "448" length = "15" relation_name = "JOB" column_name = "LANGUAGE_REQ" charset = "NONE" bounds="1:5"> |
528 |
<elt ix="1">English |
529 |
</elt> |
530 |
<elt ix="2">French |
531 |
</elt> |
532 |
<elt ix="3"> |
533 |
</elt> |
534 |
<elt ix="4"> |
535 |
</elt> |
536 |
<elt ix="5"> |
537 |
</elt> |
538 |
</array> |
539 |
); |
540 |
INSERT INTO JOB (JOB_CODE,JOB_GRADE,JOB_COUNTRY,JOB_TITLE,MIN_SALARY,MAX_SALARY,JOB_REQUIREMENT,LANGUAGE_REQ) VALUES('SRep',4,'Switzerland','Sales Representative',28000,149000,'Computer/electronics industry sales experience. |
541 |
Excellent communications, negotiation, and analytical skills. |
542 |
Experience in establishing long term customer relationships. |
543 |
Knowledge of German required; one or more other European language helpful. |
544 |
Travel required. |
545 |
',<array dim = "1" sqltype = "448" length = "15" relation_name = "JOB" column_name = "LANGUAGE_REQ" charset = "NONE" bounds="1:5"> |
546 |
<elt ix="1">German |
547 |
</elt> |
548 |
<elt ix="2">French |
549 |
</elt> |
550 |
<elt ix="3">English |
551 |
</elt> |
552 |
<elt ix="4">Italian |
553 |
</elt> |
554 |
<elt ix="5"> |
555 |
</elt> |
556 |
</array> |
557 |
); |
558 |
INSERT INTO JOB (JOB_CODE,JOB_GRADE,JOB_COUNTRY,JOB_TITLE,MIN_SALARY,MAX_SALARY,JOB_REQUIREMENT,LANGUAGE_REQ) VALUES('SRep',4,'Japan','Sales Representative',2160000,10800000,'Computer/electronics industry sales experience. |
559 |
Excellent communications, negotiation, and analytical skills. |
560 |
Experience in establishing long term customer relationships. |
561 |
Knowledge of Japanese required. |
562 |
Travel required. |
563 |
',<array dim = "1" sqltype = "448" length = "15" relation_name = "JOB" column_name = "LANGUAGE_REQ" charset = "NONE" bounds="1:5"> |
564 |
<elt ix="1">Japanese |
565 |
</elt> |
566 |
<elt ix="2">English |
567 |
</elt> |
568 |
<elt ix="3"> |
569 |
</elt> |
570 |
<elt ix="4"> |
571 |
</elt> |
572 |
<elt ix="5"> |
573 |
</elt> |
574 |
</array> |
575 |
); |
576 |
INSERT INTO JOB (JOB_CODE,JOB_GRADE,JOB_COUNTRY,JOB_TITLE,MIN_SALARY,MAX_SALARY,JOB_REQUIREMENT,LANGUAGE_REQ) VALUES('SRep',4,'Italy','Sales Representative',20000,100000,'Computer/electronics industry sales experience. |
577 |
Excellent communications, negotiation, and analytical skills. |
578 |
Experience in establishing long term customer relationships. |
579 |
Fluency in Italian; some knowledge of German helpful. |
580 |
Travel required. |
581 |
',<array dim = "1" sqltype = "448" length = "15" relation_name = "JOB" column_name = "LANGUAGE_REQ" charset = "NONE" bounds="1:5"> |
582 |
<elt ix="1">Italian |
583 |
</elt> |
584 |
<elt ix="2">German |
585 |
</elt> |
586 |
<elt ix="3">French |
587 |
</elt> |
588 |
<elt ix="4"> |
589 |
</elt> |
590 |
<elt ix="5"> |
591 |
</elt> |
592 |
</array> |
593 |
); |
594 |
INSERT INTO JOB (JOB_CODE,JOB_GRADE,JOB_COUNTRY,JOB_TITLE,MIN_SALARY,MAX_SALARY,JOB_REQUIREMENT,LANGUAGE_REQ) VALUES('SRep',4,'France','Sales Representative',20000,100000,'Computer/electronics industry sales experience. |
595 |
Excellent communications, negotiation, and analytical skills. |
596 |
Experience in establishing long term customer relationships. |
597 |
Fluency in French; some knowledge of German/Spanish helpful. |
598 |
Travel required. |
599 |
',<array dim = "1" sqltype = "448" length = "15" relation_name = "JOB" column_name = "LANGUAGE_REQ" charset = "NONE" bounds="1:5"> |
600 |
<elt ix="1">English |
601 |
</elt> |
602 |
<elt ix="2">French |
603 |
</elt> |
604 |
<elt ix="3">Spanish |
605 |
</elt> |
606 |
<elt ix="4"> |
607 |
</elt> |
608 |
<elt ix="5"> |
609 |
</elt> |
610 |
</array> |
611 |
); |
612 |
COMMIT; |
613 |
|
614 |
/* Inserting data into Table: PROJECT */ |
615 |
|
616 |
INSERT INTO PROJECT (PROJ_ID,PROJ_NAME,PROJ_DESC,TEAM_LEADER,PRODUCT) VALUES('VBASE','Video Database','Design a video data base management system for |
617 |
controlling on-demand video distribution. |
618 |
',45,'software'); |
619 |
INSERT INTO PROJECT (PROJ_ID,PROJ_NAME,PROJ_DESC,TEAM_LEADER,PRODUCT) VALUES('DGPII','DigiPizza','Develop second generation digital pizza maker |
620 |
with flash-bake heating element and |
621 |
digital ingredient measuring system. |
622 |
',24,'other'); |
623 |
INSERT INTO PROJECT (PROJ_ID,PROJ_NAME,PROJ_DESC,TEAM_LEADER,PRODUCT) VALUES('GUIDE','AutoMap','Develop a prototype for the automobile version of |
624 |
the hand-held map browsing device. |
625 |
',20,'hardware'); |
626 |
INSERT INTO PROJECT (PROJ_ID,PROJ_NAME,PROJ_DESC,TEAM_LEADER,PRODUCT) VALUES('MAPDB','MapBrowser port','Port the map browsing database software to run |
627 |
on the automobile model. |
628 |
',4,'software'); |
629 |
INSERT INTO PROJECT (PROJ_ID,PROJ_NAME,PROJ_DESC,TEAM_LEADER,PRODUCT) VALUES('HWRII','Translator upgrade','Integrate the hand-writing recognition module into the |
630 |
universal language translator. |
631 |
',NULL,'software'); |
632 |
INSERT INTO PROJECT (PROJ_ID,PROJ_NAME,PROJ_DESC,TEAM_LEADER,PRODUCT) VALUES('MKTPR','Marketing project 3','Expand marketing and sales in the Pacific Rim. |
633 |
Set up a field office in Australia and Singapore. |
634 |
',85,'N/A'); |
635 |
COMMIT; |
636 |
|
637 |
/* Inserting data into Table: PROJ_DEPT_BUDGET */ |
638 |
|
639 |
INSERT INTO PROJ_DEPT_BUDGET (FISCAL_YEAR,PROJ_ID,DEPT_NO,QUART_HEAD_CNT,PROJECTED_BUDGET) VALUES(1994,'GUIDE','100',<array dim = "1" sqltype = "496" length = "4" relation_name = "PROJ_DEPT_BUDGET" column_name = "QUART_HEAD_CNT" scale = "0" bounds="1:4"> |
640 |
<elt ix="1">1</elt> |
641 |
<elt ix="2">1</elt> |
642 |
<elt ix="3">1</elt> |
643 |
<elt ix="4">0</elt> |
644 |
</array> |
645 |
,200000); |
646 |
INSERT INTO PROJ_DEPT_BUDGET (FISCAL_YEAR,PROJ_ID,DEPT_NO,QUART_HEAD_CNT,PROJECTED_BUDGET) VALUES(1994,'GUIDE','671',<array dim = "1" sqltype = "496" length = "4" relation_name = "PROJ_DEPT_BUDGET" column_name = "QUART_HEAD_CNT" scale = "0" bounds="1:4"> |
647 |
<elt ix="1">3</elt> |
648 |
<elt ix="2">2</elt> |
649 |
<elt ix="3">1</elt> |
650 |
<elt ix="4">0</elt> |
651 |
</array> |
652 |
,450000); |
653 |
INSERT INTO PROJ_DEPT_BUDGET (FISCAL_YEAR,PROJ_ID,DEPT_NO,QUART_HEAD_CNT,PROJECTED_BUDGET) VALUES(1993,'MAPDB','621',<array dim = "1" sqltype = "496" length = "4" relation_name = "PROJ_DEPT_BUDGET" column_name = "QUART_HEAD_CNT" scale = "0" bounds="1:4"> |
654 |
<elt ix="1">0</elt> |
655 |
<elt ix="2">0</elt> |
656 |
<elt ix="3">0</elt> |
657 |
<elt ix="4">1</elt> |
658 |
</array> |
659 |
,20000); |
660 |
INSERT INTO PROJ_DEPT_BUDGET (FISCAL_YEAR,PROJ_ID,DEPT_NO,QUART_HEAD_CNT,PROJECTED_BUDGET) VALUES(1994,'MAPDB','621',<array dim = "1" sqltype = "496" length = "4" relation_name = "PROJ_DEPT_BUDGET" column_name = "QUART_HEAD_CNT" scale = "0" bounds="1:4"> |
661 |
<elt ix="1">2</elt> |
662 |
<elt ix="2">1</elt> |
663 |
<elt ix="3">0</elt> |
664 |
<elt ix="4">0</elt> |
665 |
</array> |
666 |
,40000); |
667 |
INSERT INTO PROJ_DEPT_BUDGET (FISCAL_YEAR,PROJ_ID,DEPT_NO,QUART_HEAD_CNT,PROJECTED_BUDGET) VALUES(1994,'MAPDB','622',<array dim = "1" sqltype = "496" length = "4" relation_name = "PROJ_DEPT_BUDGET" column_name = "QUART_HEAD_CNT" scale = "0" bounds="1:4"> |
668 |
<elt ix="1">1</elt> |
669 |
<elt ix="2">1</elt> |
670 |
<elt ix="3">0</elt> |
671 |
<elt ix="4">0</elt> |
672 |
</array> |
673 |
,60000); |
674 |
INSERT INTO PROJ_DEPT_BUDGET (FISCAL_YEAR,PROJ_ID,DEPT_NO,QUART_HEAD_CNT,PROJECTED_BUDGET) VALUES(1994,'MAPDB','671',<array dim = "1" sqltype = "496" length = "4" relation_name = "PROJ_DEPT_BUDGET" column_name = "QUART_HEAD_CNT" scale = "0" bounds="1:4"> |
675 |
<elt ix="1">1</elt> |
676 |
<elt ix="2">1</elt> |
677 |
<elt ix="3">0</elt> |
678 |
<elt ix="4">0</elt> |
679 |
</array> |
680 |
,11000); |
681 |
INSERT INTO PROJ_DEPT_BUDGET (FISCAL_YEAR,PROJ_ID,DEPT_NO,QUART_HEAD_CNT,PROJECTED_BUDGET) VALUES(1994,'HWRII','670',<array dim = "1" sqltype = "496" length = "4" relation_name = "PROJ_DEPT_BUDGET" column_name = "QUART_HEAD_CNT" scale = "0" bounds="1:4"> |
682 |
<elt ix="1">1</elt> |
683 |
<elt ix="2">1</elt> |
684 |
<elt ix="3">1</elt> |
685 |
<elt ix="4">1</elt> |
686 |
</array> |
687 |
,20000); |
688 |
INSERT INTO PROJ_DEPT_BUDGET (FISCAL_YEAR,PROJ_ID,DEPT_NO,QUART_HEAD_CNT,PROJECTED_BUDGET) VALUES(1994,'HWRII','621',<array dim = "1" sqltype = "496" length = "4" relation_name = "PROJ_DEPT_BUDGET" column_name = "QUART_HEAD_CNT" scale = "0" bounds="1:4"> |
689 |
<elt ix="1">2</elt> |
690 |
<elt ix="2">3</elt> |
691 |
<elt ix="3">2</elt> |
692 |
<elt ix="4">1</elt> |
693 |
</array> |
694 |
,400000); |
695 |
INSERT INTO PROJ_DEPT_BUDGET (FISCAL_YEAR,PROJ_ID,DEPT_NO,QUART_HEAD_CNT,PROJECTED_BUDGET) VALUES(1994,'HWRII','622',<array dim = "1" sqltype = "496" length = "4" relation_name = "PROJ_DEPT_BUDGET" column_name = "QUART_HEAD_CNT" scale = "0" bounds="1:4"> |
696 |
<elt ix="1">1</elt> |
697 |
<elt ix="2">1</elt> |
698 |
<elt ix="3">2</elt> |
699 |
<elt ix="4">2</elt> |
700 |
</array> |
701 |
,100000); |
702 |
INSERT INTO PROJ_DEPT_BUDGET (FISCAL_YEAR,PROJ_ID,DEPT_NO,QUART_HEAD_CNT,PROJECTED_BUDGET) VALUES(1994,'MKTPR','623',<array dim = "1" sqltype = "496" length = "4" relation_name = "PROJ_DEPT_BUDGET" column_name = "QUART_HEAD_CNT" scale = "0" bounds="1:4"> |
703 |
<elt ix="1">1</elt> |
704 |
<elt ix="2">1</elt> |
705 |
<elt ix="3">1</elt> |
706 |
<elt ix="4">2</elt> |
707 |
</array> |
708 |
,80000); |
709 |
INSERT INTO PROJ_DEPT_BUDGET (FISCAL_YEAR,PROJ_ID,DEPT_NO,QUART_HEAD_CNT,PROJECTED_BUDGET) VALUES(1994,'MKTPR','672',<array dim = "1" sqltype = "496" length = "4" relation_name = "PROJ_DEPT_BUDGET" column_name = "QUART_HEAD_CNT" scale = "0" bounds="1:4"> |
710 |
<elt ix="1">1</elt> |
711 |
<elt ix="2">1</elt> |
712 |
<elt ix="3">1</elt> |
713 |
<elt ix="4">2</elt> |
714 |
</array> |
715 |
,100000); |
716 |
INSERT INTO PROJ_DEPT_BUDGET (FISCAL_YEAR,PROJ_ID,DEPT_NO,QUART_HEAD_CNT,PROJECTED_BUDGET) VALUES(1994,'MKTPR','100',<array dim = "1" sqltype = "496" length = "4" relation_name = "PROJ_DEPT_BUDGET" column_name = "QUART_HEAD_CNT" scale = "0" bounds="1:4"> |
717 |
<elt ix="1">4</elt> |
718 |
<elt ix="2">5</elt> |
719 |
<elt ix="3">6</elt> |
720 |
<elt ix="4">6</elt> |
721 |
</array> |
722 |
,1000000); |
723 |
INSERT INTO PROJ_DEPT_BUDGET (FISCAL_YEAR,PROJ_ID,DEPT_NO,QUART_HEAD_CNT,PROJECTED_BUDGET) VALUES(1994,'MKTPR','110',<array dim = "1" sqltype = "496" length = "4" relation_name = "PROJ_DEPT_BUDGET" column_name = "QUART_HEAD_CNT" scale = "0" bounds="1:4"> |
724 |
<elt ix="1">2</elt> |
725 |
<elt ix="2">2</elt> |
726 |
<elt ix="3">0</elt> |
727 |
<elt ix="4">3</elt> |
728 |
</array> |
729 |
,200000); |
730 |
INSERT INTO PROJ_DEPT_BUDGET (FISCAL_YEAR,PROJ_ID,DEPT_NO,QUART_HEAD_CNT,PROJECTED_BUDGET) VALUES(1994,'MKTPR','000',<array dim = "1" sqltype = "496" length = "4" relation_name = "PROJ_DEPT_BUDGET" column_name = "QUART_HEAD_CNT" scale = "0" bounds="1:4"> |
731 |
<elt ix="1">1</elt> |
732 |
<elt ix="2">1</elt> |
733 |
<elt ix="3">2</elt> |
734 |
<elt ix="4">2</elt> |
735 |
</array> |
736 |
,100000); |
737 |
INSERT INTO PROJ_DEPT_BUDGET (FISCAL_YEAR,PROJ_ID,DEPT_NO,QUART_HEAD_CNT,PROJECTED_BUDGET) VALUES(1995,'MKTPR','623',<array dim = "1" sqltype = "496" length = "4" relation_name = "PROJ_DEPT_BUDGET" column_name = "QUART_HEAD_CNT" scale = "0" bounds="1:4"> |
738 |
<elt ix="1">7</elt> |
739 |
<elt ix="2">7</elt> |
740 |
<elt ix="3">4</elt> |
741 |
<elt ix="4">4</elt> |
742 |
</array> |
743 |
,1200000); |
744 |
INSERT INTO PROJ_DEPT_BUDGET (FISCAL_YEAR,PROJ_ID,DEPT_NO,QUART_HEAD_CNT,PROJECTED_BUDGET) VALUES(1995,'MKTPR','672',<array dim = "1" sqltype = "496" length = "4" relation_name = "PROJ_DEPT_BUDGET" column_name = "QUART_HEAD_CNT" scale = "0" bounds="1:4"> |
745 |
<elt ix="1">2</elt> |
746 |
<elt ix="2">3</elt> |
747 |
<elt ix="3">3</elt> |
748 |
<elt ix="4">3</elt> |
749 |
</array> |
750 |
,800000); |
751 |
INSERT INTO PROJ_DEPT_BUDGET (FISCAL_YEAR,PROJ_ID,DEPT_NO,QUART_HEAD_CNT,PROJECTED_BUDGET) VALUES(1995,'MKTPR','100',<array dim = "1" sqltype = "496" length = "4" relation_name = "PROJ_DEPT_BUDGET" column_name = "QUART_HEAD_CNT" scale = "0" bounds="1:4"> |
752 |
<elt ix="1">4</elt> |
753 |
<elt ix="2">5</elt> |
754 |
<elt ix="3">6</elt> |
755 |
<elt ix="4">6</elt> |
756 |
</array> |
757 |
,2000000); |
758 |
INSERT INTO PROJ_DEPT_BUDGET (FISCAL_YEAR,PROJ_ID,DEPT_NO,QUART_HEAD_CNT,PROJECTED_BUDGET) VALUES(1995,'MKTPR','110',<array dim = "1" sqltype = "496" length = "4" relation_name = "PROJ_DEPT_BUDGET" column_name = "QUART_HEAD_CNT" scale = "0" bounds="1:4"> |
759 |
<elt ix="1">1</elt> |
760 |
<elt ix="2">1</elt> |
761 |
<elt ix="3">1</elt> |
762 |
<elt ix="4">1</elt> |
763 |
</array> |
764 |
,1200000); |
765 |
INSERT INTO PROJ_DEPT_BUDGET (FISCAL_YEAR,PROJ_ID,DEPT_NO,QUART_HEAD_CNT,PROJECTED_BUDGET) VALUES(1994,'VBASE','621',<array dim = "1" sqltype = "496" length = "4" relation_name = "PROJ_DEPT_BUDGET" column_name = "QUART_HEAD_CNT" scale = "0" bounds="1:4"> |
766 |
<elt ix="1">4</elt> |
767 |
<elt ix="2">5</elt> |
768 |
<elt ix="3">5</elt> |
769 |
<elt ix="4">3</elt> |
770 |
</array> |
771 |
,1900000); |
772 |
INSERT INTO PROJ_DEPT_BUDGET (FISCAL_YEAR,PROJ_ID,DEPT_NO,QUART_HEAD_CNT,PROJECTED_BUDGET) VALUES(1995,'VBASE','621',<array dim = "1" sqltype = "496" length = "4" relation_name = "PROJ_DEPT_BUDGET" column_name = "QUART_HEAD_CNT" scale = "0" bounds="1:4"> |
773 |
<elt ix="1">4</elt> |
774 |
<elt ix="2">3</elt> |
775 |
<elt ix="3">2</elt> |
776 |
<elt ix="4">2</elt> |
777 |
</array> |
778 |
,900000); |
779 |
INSERT INTO PROJ_DEPT_BUDGET (FISCAL_YEAR,PROJ_ID,DEPT_NO,QUART_HEAD_CNT,PROJECTED_BUDGET) VALUES(1994,'VBASE','622',<array dim = "1" sqltype = "496" length = "4" relation_name = "PROJ_DEPT_BUDGET" column_name = "QUART_HEAD_CNT" scale = "0" bounds="1:4"> |
780 |
<elt ix="1">2</elt> |
781 |
<elt ix="2">2</elt> |
782 |
<elt ix="3">2</elt> |
783 |
<elt ix="4">1</elt> |
784 |
</array> |
785 |
,400000); |
786 |
INSERT INTO PROJ_DEPT_BUDGET (FISCAL_YEAR,PROJ_ID,DEPT_NO,QUART_HEAD_CNT,PROJECTED_BUDGET) VALUES(1994,'VBASE','100',<array dim = "1" sqltype = "496" length = "4" relation_name = "PROJ_DEPT_BUDGET" column_name = "QUART_HEAD_CNT" scale = "0" bounds="1:4"> |
787 |
<elt ix="1">1</elt> |
788 |
<elt ix="2">1</elt> |
789 |
<elt ix="3">2</elt> |
790 |
<elt ix="4">3</elt> |
791 |
</array> |
792 |
,300000); |
793 |
INSERT INTO PROJ_DEPT_BUDGET (FISCAL_YEAR,PROJ_ID,DEPT_NO,QUART_HEAD_CNT,PROJECTED_BUDGET) VALUES(1995,'VBASE','100',<array dim = "1" sqltype = "496" length = "4" relation_name = "PROJ_DEPT_BUDGET" column_name = "QUART_HEAD_CNT" scale = "0" bounds="1:4"> |
794 |
<elt ix="1">3</elt> |
795 |
<elt ix="2">3</elt> |
796 |
<elt ix="3">1</elt> |
797 |
<elt ix="4">1</elt> |
798 |
</array> |
799 |
,1500000); |
800 |
INSERT INTO PROJ_DEPT_BUDGET (FISCAL_YEAR,PROJ_ID,DEPT_NO,QUART_HEAD_CNT,PROJECTED_BUDGET) VALUES(1996,'VBASE','100',<array dim = "1" sqltype = "496" length = "4" relation_name = "PROJ_DEPT_BUDGET" column_name = "QUART_HEAD_CNT" scale = "0" bounds="1:4"> |
801 |
<elt ix="1">1</elt> |
802 |
<elt ix="2">1</elt> |
803 |
<elt ix="3">0</elt> |
804 |
<elt ix="4">0</elt> |
805 |
</array> |
806 |
,150000); |
807 |
COMMIT; |
808 |
|
809 |
/* Inserting data into Table: SALARY_HISTORY */ |
810 |
|
811 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(28,'1992.12.15 00:00:00.000','admin2',20000,10); |
812 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(2,'1992.12.15 00:00:00.000','admin2',98000,8.0612); |
813 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(4,'1992.12.15 00:00:00.000','admin2',90000,8.3333); |
814 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(5,'1992.12.15 00:00:00.000','admin2',95000,8.1578); |
815 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(11,'1992.12.15 00:00:00.000','admin2',70000,7.5); |
816 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(12,'1992.12.15 00:00:00.000','admin2',48000,7.5); |
817 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(14,'1992.12.15 00:00:00.000','admin2',62000,7.5); |
818 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(15,'1992.12.15 00:00:00.000','admin2',60000,7.5); |
819 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(20,'1992.12.15 00:00:00.000','admin2',80000,7.5); |
820 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(24,'1992.12.15 00:00:00.000','admin2',73000,7.5); |
821 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(29,'1992.12.15 00:00:00.000','admin2',62000,7.5); |
822 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(34,'1992.12.15 00:00:00.000','admin2',55000,7.5); |
823 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(36,'1992.12.15 00:00:00.000','admin2',30000,7.5); |
824 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(37,'1992.12.15 00:00:00.000','admin2',35000,7.5); |
825 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(44,'1992.12.15 00:00:00.000','admin2',50000,7.5); |
826 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(45,'1992.12.15 00:00:00.000','admin2',72000,7.5); |
827 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(8,'1993.09.08 00:00:00.000','elaine',62000,4.25); |
828 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(9,'1993.09.08 00:00:00.000','elaine',72000,4.25); |
829 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(11,'1993.09.08 00:00:00.000','elaine',75250,4.25); |
830 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(12,'1993.09.08 00:00:00.000','elaine',51600,4.25); |
831 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(14,'1993.09.08 00:00:00.000','elaine',66650,4.25); |
832 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(15,'1993.09.08 00:00:00.000','elaine',64500,4.25); |
833 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(20,'1993.09.08 00:00:00.000','elaine',86000,4.25); |
834 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(24,'1993.09.08 00:00:00.000','elaine',78475,4.25); |
835 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(28,'1993.09.08 00:00:00.000','elaine',22000,4.25); |
836 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(29,'1993.09.08 00:00:00.000','elaine',66650,4.25); |
837 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(34,'1993.09.08 00:00:00.000','elaine',59125,4.2499); |
838 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(36,'1993.09.08 00:00:00.000','elaine',32250,4.25); |
839 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(37,'1993.09.08 00:00:00.000','elaine',37625,4.2499); |
840 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(44,'1993.09.08 00:00:00.000','elaine',53750,4.25); |
841 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(45,'1993.09.08 00:00:00.000','elaine',77400,4.25); |
842 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(52,'1993.09.08 00:00:00.000','elaine',41000,4.25); |
843 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(61,'1993.09.08 00:00:00.000','elaine',60000,4.25); |
844 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(65,'1993.09.08 00:00:00.000','elaine',30000,4.25); |
845 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(71,'1993.09.08 00:00:00.000','elaine',51000,4.25); |
846 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(72,'1993.09.08 00:00:00.000','elaine',88000,4.25); |
847 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(83,'1993.09.08 00:00:00.000','elaine',60000,4.25); |
848 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(94,'1993.09.08 00:00:00.000','elaine',54000,4.25); |
849 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(46,'1993.12.20 00:00:00.000','tj',120000,-3.25); |
850 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(85,'1993.12.20 00:00:00.000','tj',115000,-3.25); |
851 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(105,'1993.12.20 00:00:00.000','tj',220000,-3.25); |
852 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(107,'1993.12.20 00:00:00.000','tj',115000,-3.25); |
853 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(11,'1993.12.20 00:00:00.000','elaine',78448.13,9.9999); |
854 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(61,'1993.12.20 00:00:00.000','elaine',62550,10); |
855 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(72,'1993.12.20 00:00:00.000','elaine',91740,10); |
856 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(118,'1993.12.20 00:00:00.000','elaine',6800000,10); |
857 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(121,'1993.12.20 00:00:00.000','elaine',30000,10); |
858 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(127,'1993.12.20 00:00:00.000','elaine',40000,10); |
859 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(134,'1993.12.20 00:00:00.000','elaine',35000,10); |
860 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(28,'2017.11.06 16:46:27.145','SYSDBA',22935,0); |
861 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(28,'2017.11.06 16:47:01.376','SYSDBA',22935.01,0); |
862 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(12,'2017.12.29 12:18:48.909','SYSDBA',53793,0); |
863 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(12,'2017.12.29 12:18:58.051','SYSDBA',53793.01,0); |
864 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(83,'2018.01.04 10:57:34.245','SYSDBA',62550,0); |
865 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(121,'2018.03.13 15:29:08.850','SYSDBA',33000,0); |
866 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(109,'2018.03.13 17:12:06.340','SYSDBA',27000,0); |
867 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(34,'2018.03.13 17:13:20.671','SYSDBA',61637.81,0); |
868 |
INSERT INTO SALARY_HISTORY (EMP_NO,CHANGE_DATE,UPDATER_ID,OLD_SALARY,PERCENT_CHANGE) VALUES(83,'2018.03.13 17:13:35.845','SYSDBA',62550.01,0); |
869 |
COMMIT; |
870 |
|
871 |
/* Inserting data into Table: SALES */ |
872 |
|
873 |
INSERT INTO SALES (PO_NUMBER,CUST_NO,SALES_REP,ORDER_STATUS,ORDER_DATE,SHIP_DATE,DATE_NEEDED,PAID,QTY_ORDERED,TOTAL_VALUE,DISCOUNT,ITEM_TYPE) VALUES('V91E0210',1004,11,'shipped','1991.03.04 00:00:00.000','1991.03.05 00:00:00.000',NULL,'y',10,5000,0.100000001490116,'hardware'); |
874 |
INSERT INTO SALES (PO_NUMBER,CUST_NO,SALES_REP,ORDER_STATUS,ORDER_DATE,SHIP_DATE,DATE_NEEDED,PAID,QTY_ORDERED,TOTAL_VALUE,DISCOUNT,ITEM_TYPE) VALUES('V92E0340',1004,11,'shipped','1992.10.15 00:00:00.000','1992.10.16 00:00:00.000','1992.10.17 00:00:00.000','y',7,70000,0,'hardware'); |
875 |
INSERT INTO SALES (PO_NUMBER,CUST_NO,SALES_REP,ORDER_STATUS,ORDER_DATE,SHIP_DATE,DATE_NEEDED,PAID,QTY_ORDERED,TOTAL_VALUE,DISCOUNT,ITEM_TYPE) VALUES('V92J1003',1010,61,'shipped','1992.07.26 00:00:00.000','1992.08.04 00:00:00.000','1992.09.15 00:00:00.000','y',15,2985,0,'software'); |
876 |
INSERT INTO SALES (PO_NUMBER,CUST_NO,SALES_REP,ORDER_STATUS,ORDER_DATE,SHIP_DATE,DATE_NEEDED,PAID,QTY_ORDERED,TOTAL_VALUE,DISCOUNT,ITEM_TYPE) VALUES('V93J2004',1010,118,'shipped','1993.10.30 00:00:00.000','1993.12.02 00:00:00.000','1993.11.15 00:00:00.000','y',3,210,0,'software'); |
877 |
INSERT INTO SALES (PO_NUMBER,CUST_NO,SALES_REP,ORDER_STATUS,ORDER_DATE,SHIP_DATE,DATE_NEEDED,PAID,QTY_ORDERED,TOTAL_VALUE,DISCOUNT,ITEM_TYPE) VALUES('V93J3100',1010,118,'shipped','1993.08.20 00:00:00.000','1993.08.20 00:00:00.000',NULL,'y',16,18000.4,0.100000001490116,'software'); |
878 |
INSERT INTO SALES (PO_NUMBER,CUST_NO,SALES_REP,ORDER_STATUS,ORDER_DATE,SHIP_DATE,DATE_NEEDED,PAID,QTY_ORDERED,TOTAL_VALUE,DISCOUNT,ITEM_TYPE) VALUES('V92F3004',1012,11,'shipped','1992.10.15 00:00:00.000','1993.01.16 00:00:00.000','1993.01.16 00:00:00.000','y',3,2000,0,'software'); |
879 |
INSERT INTO SALES (PO_NUMBER,CUST_NO,SALES_REP,ORDER_STATUS,ORDER_DATE,SHIP_DATE,DATE_NEEDED,PAID,QTY_ORDERED,TOTAL_VALUE,DISCOUNT,ITEM_TYPE) VALUES('V93F3088',1012,134,'shipped','1993.08.27 00:00:00.000','1993.09.08 00:00:00.000',NULL,'n',10,10000,0,'software'); |
880 |
INSERT INTO SALES (PO_NUMBER,CUST_NO,SALES_REP,ORDER_STATUS,ORDER_DATE,SHIP_DATE,DATE_NEEDED,PAID,QTY_ORDERED,TOTAL_VALUE,DISCOUNT,ITEM_TYPE) VALUES('V93F2030',1012,134,'open','1993.12.12 00:00:00.000',NULL,NULL,'y',15,450000.49,0,'hardware'); |
881 |
INSERT INTO SALES (PO_NUMBER,CUST_NO,SALES_REP,ORDER_STATUS,ORDER_DATE,SHIP_DATE,DATE_NEEDED,PAID,QTY_ORDERED,TOTAL_VALUE,DISCOUNT,ITEM_TYPE) VALUES('V93F2051',1012,134,'waiting','1993.12.18 00:00:00.000',NULL,'1994.03.01 00:00:00.000','n',1,999.98,0,'software'); |
882 |
INSERT INTO SALES (PO_NUMBER,CUST_NO,SALES_REP,ORDER_STATUS,ORDER_DATE,SHIP_DATE,DATE_NEEDED,PAID,QTY_ORDERED,TOTAL_VALUE,DISCOUNT,ITEM_TYPE) VALUES('V93H0030',1005,118,'open','1993.12.12 00:00:00.000',NULL,'1994.01.01 00:00:00.000','y',20,5980,0.200000002980232,'software'); |
883 |
INSERT INTO SALES (PO_NUMBER,CUST_NO,SALES_REP,ORDER_STATUS,ORDER_DATE,SHIP_DATE,DATE_NEEDED,PAID,QTY_ORDERED,TOTAL_VALUE,DISCOUNT,ITEM_TYPE) VALUES('V94H0079',1005,61,'open','1994.02.13 00:00:00.000',NULL,'1994.04.20 00:00:00.000','n',10,9000,0.0500000007450581,'software'); |
884 |
INSERT INTO SALES (PO_NUMBER,CUST_NO,SALES_REP,ORDER_STATUS,ORDER_DATE,SHIP_DATE,DATE_NEEDED,PAID,QTY_ORDERED,TOTAL_VALUE,DISCOUNT,ITEM_TYPE) VALUES('V9324200',1001,72,'shipped','1993.08.09 00:00:00.000','1993.08.09 00:00:00.000','1993.08.17 00:00:00.000','y',1000,560000,0.200000002980232,'hardware'); |
885 |
INSERT INTO SALES (PO_NUMBER,CUST_NO,SALES_REP,ORDER_STATUS,ORDER_DATE,SHIP_DATE,DATE_NEEDED,PAID,QTY_ORDERED,TOTAL_VALUE,DISCOUNT,ITEM_TYPE) VALUES('V9324320',1001,127,'shipped','1993.08.16 00:00:00.000','1993.08.16 00:00:00.000','1993.09.01 00:00:00.000','y',1,0,1,'software'); |
886 |
INSERT INTO SALES (PO_NUMBER,CUST_NO,SALES_REP,ORDER_STATUS,ORDER_DATE,SHIP_DATE,DATE_NEEDED,PAID,QTY_ORDERED,TOTAL_VALUE,DISCOUNT,ITEM_TYPE) VALUES('V9320630',1001,127,'open','1993.12.12 00:00:00.000',NULL,'1993.12.15 00:00:00.000','n',3,60000,0.200000002980232,'hardware'); |
887 |
INSERT INTO SALES (PO_NUMBER,CUST_NO,SALES_REP,ORDER_STATUS,ORDER_DATE,SHIP_DATE,DATE_NEEDED,PAID,QTY_ORDERED,TOTAL_VALUE,DISCOUNT,ITEM_TYPE) VALUES('V9420099',1001,127,'open','1994.01.17 00:00:00.000',NULL,'1994.06.01 00:00:00.000','n',100,3399.15,0.150000005960464,'software'); |
888 |
INSERT INTO SALES (PO_NUMBER,CUST_NO,SALES_REP,ORDER_STATUS,ORDER_DATE,SHIP_DATE,DATE_NEEDED,PAID,QTY_ORDERED,TOTAL_VALUE,DISCOUNT,ITEM_TYPE) VALUES('V9427029',1001,127,'shipped','1994.02.07 00:00:00.000','1994.02.10 00:00:00.000','1994.02.10 00:00:00.000','n',17,422210.97,0,'hardware'); |
889 |
INSERT INTO SALES (PO_NUMBER,CUST_NO,SALES_REP,ORDER_STATUS,ORDER_DATE,SHIP_DATE,DATE_NEEDED,PAID,QTY_ORDERED,TOTAL_VALUE,DISCOUNT,ITEM_TYPE) VALUES('V9333005',1002,11,'shipped','1993.02.03 00:00:00.000','1993.03.03 00:00:00.000',NULL,'y',2,600.5,0,'software'); |
890 |
INSERT INTO SALES (PO_NUMBER,CUST_NO,SALES_REP,ORDER_STATUS,ORDER_DATE,SHIP_DATE,DATE_NEEDED,PAID,QTY_ORDERED,TOTAL_VALUE,DISCOUNT,ITEM_TYPE) VALUES('V9333006',1002,11,'shipped','1993.04.27 00:00:00.000','1993.05.02 00:00:00.000','1993.05.02 00:00:00.000','n',5,20000,0,'other'); |
891 |
INSERT INTO SALES (PO_NUMBER,CUST_NO,SALES_REP,ORDER_STATUS,ORDER_DATE,SHIP_DATE,DATE_NEEDED,PAID,QTY_ORDERED,TOTAL_VALUE,DISCOUNT,ITEM_TYPE) VALUES('V9336100',1002,11,'waiting','1993.12.27 00:00:00.000','1994.01.01 00:00:00.000','1994.01.01 00:00:00.000','n',150,14850,0.0500000007450581,'software'); |
892 |
INSERT INTO SALES (PO_NUMBER,CUST_NO,SALES_REP,ORDER_STATUS,ORDER_DATE,SHIP_DATE,DATE_NEEDED,PAID,QTY_ORDERED,TOTAL_VALUE,DISCOUNT,ITEM_TYPE) VALUES('V9346200',1003,11,'waiting','1993.12.31 00:00:00.000',NULL,'1994.01.24 00:00:00.000','n',3,0,1,'software'); |
893 |
INSERT INTO SALES (PO_NUMBER,CUST_NO,SALES_REP,ORDER_STATUS,ORDER_DATE,SHIP_DATE,DATE_NEEDED,PAID,QTY_ORDERED,TOTAL_VALUE,DISCOUNT,ITEM_TYPE) VALUES('V9345200',1003,11,'shipped','1993.11.11 00:00:00.000','1993.12.02 00:00:00.000','1993.12.01 00:00:00.000','y',900,27000,0.300000011920929,'software'); |
894 |
INSERT INTO SALES (PO_NUMBER,CUST_NO,SALES_REP,ORDER_STATUS,ORDER_DATE,SHIP_DATE,DATE_NEEDED,PAID,QTY_ORDERED,TOTAL_VALUE,DISCOUNT,ITEM_TYPE) VALUES('V9345139',1003,127,'shipped','1993.09.09 00:00:00.000','1993.09.20 00:00:00.000','1993.10.01 00:00:00.000','y',20,12582.12,0.100000001490116,'software'); |
895 |
INSERT INTO SALES (PO_NUMBER,CUST_NO,SALES_REP,ORDER_STATUS,ORDER_DATE,SHIP_DATE,DATE_NEEDED,PAID,QTY_ORDERED,TOTAL_VALUE,DISCOUNT,ITEM_TYPE) VALUES('V93C0120',1006,72,'shipped','1993.03.22 00:00:00.000','1993.05.31 00:00:00.000','1993.04.17 00:00:00.000','y',1,47.5,0,'other'); |
896 |
INSERT INTO SALES (PO_NUMBER,CUST_NO,SALES_REP,ORDER_STATUS,ORDER_DATE,SHIP_DATE,DATE_NEEDED,PAID,QTY_ORDERED,TOTAL_VALUE,DISCOUNT,ITEM_TYPE) VALUES('V93C0990',1006,72,'shipped','1993.08.09 00:00:00.000','1993.09.02 00:00:00.000',NULL,'y',40,399960.5,0.100000001490116,'hardware'); |
897 |
INSERT INTO SALES (PO_NUMBER,CUST_NO,SALES_REP,ORDER_STATUS,ORDER_DATE,SHIP_DATE,DATE_NEEDED,PAID,QTY_ORDERED,TOTAL_VALUE,DISCOUNT,ITEM_TYPE) VALUES('V9456220',1007,127,'open','1994.01.04 00:00:00.000',NULL,'1994.01.30 00:00:00.000','y',1,3999.99,0,'hardware'); |
898 |
INSERT INTO SALES (PO_NUMBER,CUST_NO,SALES_REP,ORDER_STATUS,ORDER_DATE,SHIP_DATE,DATE_NEEDED,PAID,QTY_ORDERED,TOTAL_VALUE,DISCOUNT,ITEM_TYPE) VALUES('V93S4702',1011,121,'shipped','1993.10.27 00:00:00.000','1993.10.28 00:00:00.000','1993.12.15 00:00:00.000','y',4,120000,0,'hardware'); |
899 |
INSERT INTO SALES (PO_NUMBER,CUST_NO,SALES_REP,ORDER_STATUS,ORDER_DATE,SHIP_DATE,DATE_NEEDED,PAID,QTY_ORDERED,TOTAL_VALUE,DISCOUNT,ITEM_TYPE) VALUES('V94S6400',1011,141,'waiting','1994.01.06 00:00:00.000',NULL,'1994.02.15 00:00:00.000','y',20,1980.72,0.400000005960464,'software'); |
900 |
INSERT INTO SALES (PO_NUMBER,CUST_NO,SALES_REP,ORDER_STATUS,ORDER_DATE,SHIP_DATE,DATE_NEEDED,PAID,QTY_ORDERED,TOTAL_VALUE,DISCOUNT,ITEM_TYPE) VALUES('V93H3009',1008,61,'shipped','1993.08.01 00:00:00.000','1993.12.02 00:00:00.000','1993.12.01 00:00:00.000','n',3,9000,0.0500000007450581,'software'); |
901 |
INSERT INTO SALES (PO_NUMBER,CUST_NO,SALES_REP,ORDER_STATUS,ORDER_DATE,SHIP_DATE,DATE_NEEDED,PAID,QTY_ORDERED,TOTAL_VALUE,DISCOUNT,ITEM_TYPE) VALUES('V93H0500',1008,61,'open','1993.12.12 00:00:00.000',NULL,'1993.12.15 00:00:00.000','n',3,16000,0.200000002980232,'hardware'); |
902 |
INSERT INTO SALES (PO_NUMBER,CUST_NO,SALES_REP,ORDER_STATUS,ORDER_DATE,SHIP_DATE,DATE_NEEDED,PAID,QTY_ORDERED,TOTAL_VALUE,DISCOUNT,ITEM_TYPE) VALUES('V93F0020',1009,61,'shipped','1993.10.10 00:00:00.000','1993.11.11 00:00:00.000','1993.11.11 00:00:00.000','n',1,490.69,0,'software'); |
903 |
INSERT INTO SALES (PO_NUMBER,CUST_NO,SALES_REP,ORDER_STATUS,ORDER_DATE,SHIP_DATE,DATE_NEEDED,PAID,QTY_ORDERED,TOTAL_VALUE,DISCOUNT,ITEM_TYPE) VALUES('V93I4700',1013,121,'open','1993.10.27 00:00:00.000',NULL,'1993.12.15 00:00:00.000','n',5,2693,0,'hardware'); |
904 |
INSERT INTO SALES (PO_NUMBER,CUST_NO,SALES_REP,ORDER_STATUS,ORDER_DATE,SHIP_DATE,DATE_NEEDED,PAID,QTY_ORDERED,TOTAL_VALUE,DISCOUNT,ITEM_TYPE) VALUES('V93B1002',1014,134,'shipped','1993.09.20 00:00:00.000','1993.09.21 00:00:00.000','1993.09.25 00:00:00.000','y',1,100.02,0,'software'); |
905 |
INSERT INTO SALES (PO_NUMBER,CUST_NO,SALES_REP,ORDER_STATUS,ORDER_DATE,SHIP_DATE,DATE_NEEDED,PAID,QTY_ORDERED,TOTAL_VALUE,DISCOUNT,ITEM_TYPE) VALUES('V93N5822',1015,134,'shipped','1993.12.18 00:00:00.000','1994.01.14 00:00:00.000',NULL,'n',2,1500,0,'software'); |
906 |
COMMIT; |
907 |
/* Data Ends */ |
908 |
|
909 |
/* Index definitions for all user tables */ |
910 |
|
911 |
CREATE INDEX CUSTNAMEX ON CUSTOMER(CUSTOMER); |
912 |
CREATE INDEX CUSTREGION ON CUSTOMER(COUNTRY, CITY); |
913 |
CREATE DESCENDING INDEX BUDGETX ON DEPARTMENT(BUDGET); |
914 |
CREATE INDEX NAMEX ON EMPLOYEE(LAST_NAME, FIRST_NAME); |
915 |
CREATE DESCENDING INDEX MAXSALX ON JOB(JOB_COUNTRY, MAX_SALARY); |
916 |
CREATE INDEX MINSALX ON JOB(JOB_COUNTRY, MIN_SALARY); |
917 |
CREATE UNIQUE INDEX PRODTYPEX ON PROJECT(PRODUCT, PROJ_NAME); |
918 |
CREATE DESCENDING INDEX CHANGEX ON SALARY_HISTORY(CHANGE_DATE); |
919 |
CREATE INDEX UPDATERX ON SALARY_HISTORY(UPDATER_ID); |
920 |
CREATE INDEX NEEDX ON SALES(DATE_NEEDED); |
921 |
CREATE DESCENDING INDEX QTYX ON SALES(ITEM_TYPE, QTY_ORDERED); |
922 |
CREATE INDEX SALESTATX ON SALES(ORDER_STATUS, PAID); |
923 |
ALTER TABLE CUSTOMER ADD FOREIGN KEY (COUNTRY) REFERENCES COUNTRY (COUNTRY); |
924 |
ALTER TABLE DEPARTMENT ADD FOREIGN KEY (HEAD_DEPT) REFERENCES DEPARTMENT (DEPT_NO); |
925 |
ALTER TABLE DEPARTMENT ADD FOREIGN KEY (MNGR_NO) REFERENCES EMPLOYEE (EMP_NO); |
926 |
ALTER TABLE EMPLOYEE ADD FOREIGN KEY (DEPT_NO) REFERENCES DEPARTMENT (DEPT_NO); |
927 |
ALTER TABLE EMPLOYEE ADD FOREIGN KEY (JOB_CODE, JOB_GRADE, JOB_COUNTRY) REFERENCES JOB (JOB_CODE, JOB_GRADE, JOB_COUNTRY); |
928 |
ALTER TABLE EMPLOYEE_PROJECT ADD FOREIGN KEY (EMP_NO) REFERENCES EMPLOYEE (EMP_NO); |
929 |
ALTER TABLE EMPLOYEE_PROJECT ADD FOREIGN KEY (PROJ_ID) REFERENCES PROJECT (PROJ_ID); |
930 |
ALTER TABLE JOB ADD FOREIGN KEY (JOB_COUNTRY) REFERENCES COUNTRY (COUNTRY); |
931 |
ALTER TABLE PROJECT ADD FOREIGN KEY (TEAM_LEADER) REFERENCES EMPLOYEE (EMP_NO); |
932 |
ALTER TABLE PROJ_DEPT_BUDGET ADD FOREIGN KEY (DEPT_NO) REFERENCES DEPARTMENT (DEPT_NO); |
933 |
ALTER TABLE PROJ_DEPT_BUDGET ADD FOREIGN KEY (PROJ_ID) REFERENCES PROJECT (PROJ_ID); |
934 |
ALTER TABLE SALARY_HISTORY ADD FOREIGN KEY (EMP_NO) REFERENCES EMPLOYEE (EMP_NO); |
935 |
ALTER TABLE SALES ADD FOREIGN KEY (CUST_NO) REFERENCES CUSTOMER (CUST_NO); |
936 |
ALTER TABLE SALES ADD FOREIGN KEY (SALES_REP) REFERENCES EMPLOYEE (EMP_NO); |
937 |
|
938 |
CREATE SEQUENCE CUST_NO_GEN; |
939 |
ALTER SEQUENCE CUST_NO_GEN RESTART WITH 1016; |
940 |
CREATE SEQUENCE EMP_NO_GEN; |
941 |
ALTER SEQUENCE EMP_NO_GEN RESTART WITH 158; |
942 |
CREATE SEQUENCE FB$OUT_SEQ; |
943 |
ALTER SEQUENCE FB$OUT_SEQ RESTART WITH 1; |
944 |
|
945 |
/* View: DEPTLIST, Owner: SYSDBA */ |
946 |
|
947 |
CREATE VIEW DEPTLIST ( |
948 |
EMP_NO, |
949 |
FIRST_NAME, |
950 |
LAST_NAME, |
951 |
PHONE_EXT, |
952 |
HIRE_DATE, |
953 |
DEPT_NO, |
954 |
JOB_CODE, |
955 |
JOB_GRADE, |
956 |
JOB_COUNTRY, |
957 |
SALARY, |
958 |
FULL_NAME, |
959 |
DEPT_PATH, |
960 |
DEPT_KEY_PATH |
961 |
) AS |
962 |
with recursive Depts As ( |
963 |
Select DEPT_NO, DEPARTMENT, HEAD_DEPT, cast(DEPARTMENT as VarChar(256)) as DEPT_PATH, |
964 |
cast(DEPT_NO as VarChar(64)) as DEPT_KEY_PATH |
965 |
From DEPARTMENT Where HEAD_DEPT is NULL |
966 |
UNION ALL |
967 |
Select D.DEPT_NO, D.DEPARTMENT, D.HEAD_DEPT, Depts.DEPT_PATH || ' / ' || D.DEPARTMENT as DEPT_PATH, |
968 |
Depts.DEPT_KEY_PATH || ';' || D.DEPT_NO as DEPT_KEY_PATH |
969 |
From DEPARTMENT D |
970 |
JOIN Depts On D.HEAD_DEPT = Depts.DEPT_NO |
971 |
) |
972 |
|
973 |
Select distinct A.EMP_NO, A.FIRST_NAME, A.LAST_NAME, A.PHONE_EXT, A.HIRE_DATE, A.DEPT_NO, A.JOB_CODE, |
974 |
A.JOB_GRADE, A.JOB_COUNTRY, A.SALARY, A.FULL_NAME, D.DEPT_PATH, D.DEPT_KEY_PATH |
975 |
From EMPLOYEE A |
976 |
JOIN Depts D On D.DEPT_NO = A.DEPT_NO |
977 |
; |
978 |
|
979 |
/* View: PHONE_LIST, Owner: SYSDBA */ |
980 |
|
981 |
CREATE VIEW PHONE_LIST ( |
982 |
EMP_NO, |
983 |
FIRST_NAME, |
984 |
LAST_NAME, |
985 |
PHONE_EXT, |
986 |
LOCATION, |
987 |
PHONE_NO |
988 |
) AS |
989 |
SELECT |
990 |
emp_no, first_name, last_name, phone_ext, location, phone_no |
991 |
FROM employee, department |
992 |
WHERE employee.dept_no = department.dept_no |
993 |
; |
994 |
|
995 |
/* Add Domain Check Constraints */ |
996 |
|
997 |
|
998 |
ALTER DOMAIN BUDGET ADD CONSTRAINT |
999 |
CHECK (VALUE > 10000 AND VALUE <= 2000000); |
1000 |
|
1001 |
ALTER DOMAIN CUSTNO ADD CONSTRAINT |
1002 |
CHECK (VALUE > 1000); |
1003 |
ALTER DOMAIN DEPTNO ADD CONSTRAINT |
1004 |
CHECK (VALUE = '000' OR (VALUE > '0' AND VALUE <= '999') OR VALUE IS NULL); |
1005 |
|
1006 |
|
1007 |
|
1008 |
ALTER DOMAIN JOBCODE ADD CONSTRAINT |
1009 |
CHECK (VALUE > '99999'); |
1010 |
ALTER DOMAIN JOBGRADE ADD CONSTRAINT |
1011 |
CHECK (VALUE BETWEEN 0 AND 6); |
1012 |
|
1013 |
|
1014 |
ALTER DOMAIN PONUMBER ADD CONSTRAINT |
1015 |
CHECK (VALUE STARTING WITH 'V'); |
1016 |
ALTER DOMAIN PRODTYPE ADD CONSTRAINT |
1017 |
CHECK (VALUE IN ('software', 'hardware', 'other', 'N/A')); |
1018 |
ALTER DOMAIN PROJNO ADD CONSTRAINT |
1019 |
CHECK (VALUE = UPPER (VALUE)); |
1020 |
ALTER DOMAIN SALARY ADD CONSTRAINT |
1021 |
CHECK (VALUE > 0); |
1022 |
ALTER TABLE JOB ADD |
1023 |
CHECK (min_salary < max_salary); |
1024 |
|
1025 |
ALTER TABLE JOB ADD |
1026 |
CHECK (min_salary < max_salary); |
1027 |
|
1028 |
ALTER TABLE EMPLOYEE ADD |
1029 |
CHECK ( salary >= (SELECT min_salary FROM job WHERE |
1030 |
job.job_code = employee.job_code AND |
1031 |
job.job_grade = employee.job_grade AND |
1032 |
job.job_country = employee.job_country) AND |
1033 |
salary <= (SELECT max_salary FROM job WHERE |
1034 |
job.job_code = employee.job_code AND |
1035 |
job.job_grade = employee.job_grade AND |
1036 |
job.job_country = employee.job_country)); |
1037 |
|
1038 |
ALTER TABLE PROJ_DEPT_BUDGET ADD |
1039 |
CHECK (FISCAL_YEAR >= 1993); |
1040 |
|
1041 |
ALTER TABLE SALARY_HISTORY ADD |
1042 |
CHECK (percent_change between -50 and 50); |
1043 |
|
1044 |
ALTER TABLE CUSTOMER ADD |
1045 |
CHECK (on_hold IS NULL OR on_hold = '*'); |
1046 |
|
1047 |
ALTER TABLE SALES ADD |
1048 |
CHECK (order_status in |
1049 |
('new', 'open', 'shipped', 'waiting')); |
1050 |
|
1051 |
ALTER TABLE SALES ADD |
1052 |
CHECK (ship_date >= order_date OR ship_date IS NULL); |
1053 |
|
1054 |
ALTER TABLE SALES ADD |
1055 |
CHECK (date_needed > order_date OR date_needed IS NULL); |
1056 |
|
1057 |
ALTER TABLE SALES ADD |
1058 |
CHECK (paid in ('y', 'n')); |
1059 |
|
1060 |
ALTER TABLE SALES ADD |
1061 |
CHECK (qty_ordered >= 1); |
1062 |
|
1063 |
ALTER TABLE SALES ADD |
1064 |
CHECK (total_value >= 0); |
1065 |
|
1066 |
ALTER TABLE SALES ADD |
1067 |
CHECK (discount >= 0 AND discount <= 1); |
1068 |
|
1069 |
ALTER TABLE SALES ADD |
1070 |
CHECK (NOT (order_status = 'shipped' AND ship_date IS NULL)); |
1071 |
|
1072 |
ALTER TABLE SALES ADD |
1073 |
CHECK (NOT (order_status = 'shipped' AND |
1074 |
EXISTS (SELECT on_hold FROM customer |
1075 |
WHERE customer.cust_no = sales.cust_no |
1076 |
AND customer.on_hold = '*'))); |
1077 |
|
1078 |
|
1079 |
/* Exceptions */ |
1080 |
|
1081 |
CREATE EXCEPTION CUSTOMER_CHECK 'Overdue balance -- can not ship.'; |
1082 |
CREATE EXCEPTION CUSTOMER_ON_HOLD 'This customer is on hold.'; |
1083 |
CREATE EXCEPTION ORDER_ALREADY_SHIPPED 'Order status is "shipped."'; |
1084 |
CREATE EXCEPTION REASSIGN_SALES 'Reassign the sales records before deleting this employee.'; |
1085 |
CREATE EXCEPTION UNKNOWN_EMP_ID 'Invalid employee number or project id.'; |
1086 |
COMMIT WORK; |
1087 |
SET AUTODDL OFF; |
1088 |
SET TERM ^; |
1089 |
|
1090 |
/* Stored procedures Definitions*/ |
1091 |
|
1092 |
CREATE PROCEDURE SHOW_LANGS |
1093 |
( |
1094 |
CODE VARCHAR(5) CHARACTER SET NONE, |
1095 |
GRADE SMALLINT, |
1096 |
CTY VARCHAR(15) CHARACTER SET NONE |
1097 |
) |
1098 |
RETURNS |
1099 |
( |
1100 |
LANGUAGES VARCHAR(15) CHARACTER SET NONE |
1101 |
) |
1102 |
AS |
1103 |
BEGIN SUSPEND; EXIT; END |
1104 |
^ |
1105 |
|
1106 |
CREATE PROCEDURE ADD_EMP_PROJ |
1107 |
( |
1108 |
EMP_NO SMALLINT, |
1109 |
PROJ_ID CHAR(5) CHARACTER SET NONE |
1110 |
) |
1111 |
AS |
1112 |
BEGIN EXIT; END |
1113 |
^ |
1114 |
|
1115 |
CREATE PROCEDURE ALL_LANGS |
1116 |
RETURNS |
1117 |
( |
1118 |
CODE VARCHAR(5) CHARACTER SET NONE, |
1119 |
GRADE VARCHAR(5) CHARACTER SET NONE, |
1120 |
COUNTRY VARCHAR(15) CHARACTER SET NONE, |
1121 |
LANG VARCHAR(15) CHARACTER SET NONE |
1122 |
) |
1123 |
AS |
1124 |
BEGIN SUSPEND; EXIT; END |
1125 |
^ |
1126 |
|
1127 |
CREATE PROCEDURE DELETE_EMPLOYEE |
1128 |
( |
1129 |
EMP_NUM INTEGER |
1130 |
) |
1131 |
AS |
1132 |
BEGIN EXIT; END |
1133 |
^ |
1134 |
|
1135 |
CREATE PROCEDURE DEPT_BUDGET |
1136 |
( |
1137 |
DNO CHAR(3) CHARACTER SET NONE |
1138 |
) |
1139 |
RETURNS |
1140 |
( |
1141 |
TOT DECIMAL(12,2) |
1142 |
) |
1143 |
AS |
1144 |
BEGIN SUSPEND; EXIT; END |
1145 |
^ |
1146 |
|
1147 |
CREATE PROCEDURE GET_EMP_PROJ |
1148 |
( |
1149 |
EMP_NO SMALLINT |
1150 |
) |
1151 |
RETURNS |
1152 |
( |
1153 |
PROJ_ID CHAR(5) CHARACTER SET NONE |
1154 |
) |
1155 |
AS |
1156 |
BEGIN SUSPEND; EXIT; END |
1157 |
^ |
1158 |
|
1159 |
CREATE PROCEDURE "Has Space" |
1160 |
( |
1161 |
ARG1 INTEGER |
1162 |
) |
1163 |
AS |
1164 |
BEGIN EXIT; END |
1165 |
^ |
1166 |
|
1167 |
CREATE PROCEDURE MAIL_LABEL |
1168 |
( |
1169 |
CUST_NO INTEGER |
1170 |
) |
1171 |
RETURNS |
1172 |
( |
1173 |
LINE1 CHAR(40) CHARACTER SET NONE, |
1174 |
LINE2 CHAR(40) CHARACTER SET NONE, |
1175 |
LINE3 CHAR(40) CHARACTER SET NONE, |
1176 |
LINE4 CHAR(40) CHARACTER SET NONE, |
1177 |
LINE5 CHAR(40) CHARACTER SET NONE, |
1178 |
LINE6 CHAR(40) CHARACTER SET NONE |
1179 |
) |
1180 |
AS |
1181 |
BEGIN SUSPEND; EXIT; END |
1182 |
^ |
1183 |
|
1184 |
CREATE PROCEDURE ORG_CHART |
1185 |
RETURNS |
1186 |
( |
1187 |
HEAD_DEPT CHAR(25) CHARACTER SET NONE, |
1188 |
DEPARTMENT CHAR(25) CHARACTER SET NONE, |
1189 |
MNGR_NAME CHAR(20) CHARACTER SET NONE, |
1190 |
TITLE CHAR(5) CHARACTER SET NONE, |
1191 |
EMP_CNT INTEGER |
1192 |
) |
1193 |
AS |
1194 |
BEGIN SUSPEND; EXIT; END |
1195 |
^ |
1196 |
|
1197 |
CREATE PROCEDURE SHIP_ORDER |
1198 |
( |
1199 |
PO_NUM CHAR(8) CHARACTER SET NONE |
1200 |
) |
1201 |
AS |
1202 |
BEGIN EXIT; END |
1203 |
^ |
1204 |
|
1205 |
CREATE PROCEDURE SUB_TOT_BUDGET |
1206 |
( |
1207 |
HEAD_DEPT CHAR(3) CHARACTER SET NONE |
1208 |
) |
1209 |
RETURNS |
1210 |
( |
1211 |
TOT_BUDGET DECIMAL(12,2), |
1212 |
AVG_BUDGET DECIMAL(12,2), |
1213 |
MIN_BUDGET DECIMAL(12,2), |
1214 |
MAX_BUDGET DECIMAL(12,2) |
1215 |
) |
1216 |
AS |
1217 |
BEGIN SUSPEND; EXIT; END |
1218 |
^ |
1219 |
|
1220 |
CREATE PROCEDURE "UC SPACE" |
1221 |
( |
1222 |
ARG1 INTEGER |
1223 |
) |
1224 |
AS |
1225 |
BEGIN EXIT; END |
1226 |
^ |
1227 |
|
1228 |
CREATE PROCEDURE "iCASE" |
1229 |
AS |
1230 |
BEGIN EXIT; END |
1231 |
^ |
1232 |
|
1233 |
SET TERM ;^ |
1234 |
COMMIT WORK; |
1235 |
SET AUTODDL ON; |
1236 |
SET TERM ^; |
1237 |
|
1238 |
|
1239 |
/* Triggers only will work for SQL triggers */ |
1240 |
|
1241 |
CREATE TRIGGER SET_CUST_NO FOR CUSTOMER |
1242 |
ACTIVE BEFORE INSERT POSITION 0 |
1243 |
AS |
1244 |
BEGIN |
1245 |
if (new.cust_no is null) then |
1246 |
new.cust_no = gen_id(cust_no_gen, 1); |
1247 |
END |
1248 |
^ |
1249 |
|
1250 |
CREATE TRIGGER SET_EMP_NO FOR EMPLOYEE |
1251 |
ACTIVE BEFORE INSERT POSITION 0 |
1252 |
AS |
1253 |
BEGIN |
1254 |
if (new.emp_no is null) then |
1255 |
new.emp_no = gen_id(emp_no_gen, 1); |
1256 |
END |
1257 |
^ |
1258 |
|
1259 |
CREATE TRIGGER SAVE_SALARY_CHANGE FOR EMPLOYEE |
1260 |
ACTIVE AFTER UPDATE POSITION 0 |
1261 |
AS |
1262 |
BEGIN |
1263 |
IF (old.salary <> new.salary) THEN |
1264 |
INSERT INTO salary_history |
1265 |
(emp_no, change_date, updater_id, old_salary, percent_change) |
1266 |
VALUES ( |
1267 |
old.emp_no, |
1268 |
'NOW', |
1269 |
user, |
1270 |
old.salary, |
1271 |
(new.salary - old.salary) * 100 / old.salary); |
1272 |
END |
1273 |
^ |
1274 |
|
1275 |
CREATE TRIGGER POST_NEW_ORDER FOR SALES |
1276 |
ACTIVE AFTER INSERT POSITION 0 |
1277 |
AS |
1278 |
BEGIN |
1279 |
POST_EVENT 'new_order'; |
1280 |
END |
1281 |
^ |
1282 |
|
1283 |
COMMIT WORK^ |
1284 |
SET TERM ;^ |
1285 |
COMMIT WORK; |
1286 |
SET AUTODDL OFF; |
1287 |
SET TERM ^; |
1288 |
|
1289 |
/* Stored procedure Bodies */ |
1290 |
|
1291 |
ALTER PROCEDURE SHOW_LANGS |
1292 |
( |
1293 |
CODE VARCHAR(5) CHARACTER SET NONE, |
1294 |
GRADE SMALLINT, |
1295 |
CTY VARCHAR(15) CHARACTER SET NONE |
1296 |
) |
1297 |
RETURNS |
1298 |
( |
1299 |
LANGUAGES VARCHAR(15) CHARACTER SET NONE |
1300 |
) |
1301 |
AS |
1302 |
DECLARE VARIABLE i INTEGER; |
1303 |
BEGIN |
1304 |
i = 1; |
1305 |
WHILE (i <= 5) DO |
1306 |
BEGIN |
1307 |
SELECT language_req[:i] FROM joB |
1308 |
WHERE ((job_code = :code) AND (job_grade = :grade) AND (job_country = :cty) |
1309 |
AND (language_req IS NOT NULL)) |
1310 |
INTO :languages; |
1311 |
IF (languages = ' ') THEN /* Prints 'NULL' instead of blanks */ |
1312 |
languages = 'NULL'; |
1313 |
i = i +1; |
1314 |
SUSPEND; |
1315 |
END |
1316 |
END |
1317 |
^ |
1318 |
|
1319 |
ALTER PROCEDURE ADD_EMP_PROJ |
1320 |
( |
1321 |
EMP_NO SMALLINT, |
1322 |
PROJ_ID CHAR(5) CHARACTER SET NONE |
1323 |
) |
1324 |
AS |
1325 |
BEGIN |
1326 |
BEGIN |
1327 |
INSERT INTO employee_project (emp_no, proj_id) VALUES (:emp_no, :proj_id); |
1328 |
WHEN SQLCODE -530 DO |
1329 |
EXCEPTION unknown_emp_id; |
1330 |
END |
1331 |
END |
1332 |
^ |
1333 |
|
1334 |
ALTER PROCEDURE ALL_LANGS |
1335 |
RETURNS |
1336 |
( |
1337 |
CODE VARCHAR(5) CHARACTER SET NONE, |
1338 |
GRADE VARCHAR(5) CHARACTER SET NONE, |
1339 |
COUNTRY VARCHAR(15) CHARACTER SET NONE, |
1340 |
LANG VARCHAR(15) CHARACTER SET NONE |
1341 |
) |
1342 |
AS |
1343 |
BEGIN |
1344 |
FOR SELECT job_code, job_grade, job_country FROM job |
1345 |
INTO :code, :grade, :country |
1346 |
|
1347 |
DO |
1348 |
BEGIN |
1349 |
FOR SELECT languages FROM show_langs |
1350 |
(:code, :grade, :country) INTO :lang DO |
1351 |
SUSPEND; |
1352 |
/* Put nice separators between rows */ |
1353 |
code = '====='; |
1354 |
grade = '====='; |
1355 |
country = '==============='; |
1356 |
lang = '=============='; |
1357 |
SUSPEND; |
1358 |
END |
1359 |
END |
1360 |
^ |
1361 |
|
1362 |
ALTER PROCEDURE DELETE_EMPLOYEE |
1363 |
( |
1364 |
EMP_NUM INTEGER |
1365 |
) |
1366 |
AS |
1367 |
DECLARE VARIABLE any_sales INTEGER; |
1368 |
BEGIN |
1369 |
any_sales = 0; |
1370 |
|
1371 |
/* |
1372 |
* If there are any sales records referencing this employee, |
1373 |
* cannot delete the employee until the sales are re-assigned |
1374 |
* to another employee or changed to NULL. |
1375 |
*/ |
1376 |
SELECT count(po_number) |
1377 |
FROM sales |
1378 |
WHERE sales_rep = :emp_num |
1379 |
INTO :any_sales; |
1380 |
|
1381 |
IF (any_sales > 0) THEN |
1382 |
BEGIN |
1383 |
EXCEPTION reassign_sales; |
1384 |
END |
1385 |
|
1386 |
/* |
1387 |
* If the employee is a manager, update the department. |
1388 |
*/ |
1389 |
UPDATE department |
1390 |
SET mngr_no = NULL |
1391 |
WHERE mngr_no = :emp_num; |
1392 |
|
1393 |
/* |
1394 |
* If the employee is a project leader, update project. |
1395 |
*/ |
1396 |
UPDATE project |
1397 |
SET team_leader = NULL |
1398 |
WHERE team_leader = :emp_num; |
1399 |
|
1400 |
/* |
1401 |
* Delete the employee from any projects. |
1402 |
*/ |
1403 |
DELETE FROM employee_project |
1404 |
WHERE emp_no = :emp_num; |
1405 |
|
1406 |
/* |
1407 |
* Delete old salary records. |
1408 |
*/ |
1409 |
DELETE FROM salary_history |
1410 |
WHERE emp_no = :emp_num; |
1411 |
|
1412 |
/* |
1413 |
* Delete the employee. |
1414 |
*/ |
1415 |
DELETE FROM employee |
1416 |
WHERE emp_no = :emp_num; |
1417 |
|
1418 |
END |
1419 |
^ |
1420 |
|
1421 |
ALTER PROCEDURE DEPT_BUDGET |
1422 |
( |
1423 |
DNO CHAR(3) CHARACTER SET NONE |
1424 |
) |
1425 |
RETURNS |
1426 |
( |
1427 |
TOT DECIMAL(12,2) |
1428 |
) |
1429 |
AS |
1430 |
DECLARE VARIABLE sumb DECIMAL(12,2); |
1431 |
DECLARE VARIABLE rdno CHAR(3); |
1432 |
DECLARE VARIABLE cnt INTEGER; |
1433 |
BEGIN |
1434 |
tot = 0; |
1435 |
|
1436 |
SELECT budget FROM department WHERE dept_no = :dno INTO :tot; |
1437 |
|
1438 |
SELECT count(budget) FROM department WHERE head_dept = :dno INTO :cnt; |
1439 |
|
1440 |
IF (cnt = 0) THEN |
1441 |
SUSPEND; |
1442 |
|
1443 |
FOR SELECT dept_no |
1444 |
FROM department |
1445 |
WHERE head_dept = :dno |
1446 |
INTO :rdno |
1447 |
DO |
1448 |
BEGIN |
1449 |
EXECUTE PROCEDURE dept_budget :rdno RETURNING_VALUES :sumb; |
1450 |
tot = tot + sumb; |
1451 |
END |
1452 |
|
1453 |
SUSPEND; |
1454 |
END |
1455 |
^ |
1456 |
|
1457 |
ALTER PROCEDURE GET_EMP_PROJ |
1458 |
( |
1459 |
EMP_NO SMALLINT |
1460 |
) |
1461 |
RETURNS |
1462 |
( |
1463 |
PROJ_ID CHAR(5) CHARACTER SET NONE |
1464 |
) |
1465 |
AS |
1466 |
BEGIN |
1467 |
FOR SELECT proj_id |
1468 |
FROM employee_project |
1469 |
WHERE emp_no = :emp_no |
1470 |
INTO :proj_id |
1471 |
DO |
1472 |
SUSPEND; |
1473 |
END |
1474 |
^ |
1475 |
|
1476 |
ALTER PROCEDURE "Has Space" |
1477 |
( |
1478 |
ARG1 INTEGER |
1479 |
) |
1480 |
AS |
1481 |
Begin End |
1482 |
^ |
1483 |
|
1484 |
ALTER PROCEDURE MAIL_LABEL |
1485 |
( |
1486 |
CUST_NO INTEGER |
1487 |
) |
1488 |
RETURNS |
1489 |
( |
1490 |
LINE1 CHAR(40) CHARACTER SET NONE, |
1491 |
LINE2 CHAR(40) CHARACTER SET NONE, |
1492 |
LINE3 CHAR(40) CHARACTER SET NONE, |
1493 |
LINE4 CHAR(40) CHARACTER SET NONE, |
1494 |
LINE5 CHAR(40) CHARACTER SET NONE, |
1495 |
LINE6 CHAR(40) CHARACTER SET NONE |
1496 |
) |
1497 |
AS |
1498 |
DECLARE VARIABLE customer VARCHAR(25); |
1499 |
DECLARE VARIABLE first_name VARCHAR(15); |
1500 |
DECLARE VARIABLE last_name VARCHAR(20); |
1501 |
DECLARE VARIABLE addr1 VARCHAR(30); |
1502 |
DECLARE VARIABLE addr2 VARCHAR(30); |
1503 |
DECLARE VARIABLE city VARCHAR(25); |
1504 |
DECLARE VARIABLE state VARCHAR(15); |
1505 |
DECLARE VARIABLE country VARCHAR(15); |
1506 |
DECLARE VARIABLE postcode VARCHAR(12); |
1507 |
DECLARE VARIABLE cnt INTEGER; |
1508 |
BEGIN |
1509 |
line1 = ''; |
1510 |
line2 = ''; |
1511 |
line3 = ''; |
1512 |
line4 = ''; |
1513 |
line5 = ''; |
1514 |
line6 = ''; |
1515 |
|
1516 |
SELECT customer, contact_first, contact_last, address_line1, |
1517 |
address_line2, city, state_province, country, postal_code |
1518 |
FROM CUSTOMER |
1519 |
WHERE cust_no = :cust_no |
1520 |
INTO :customer, :first_name, :last_name, :addr1, :addr2, |
1521 |
:city, :state, :country, :postcode; |
1522 |
|
1523 |
IF (customer IS NOT NULL) THEN |
1524 |
line1 = customer; |
1525 |
IF (first_name IS NOT NULL) THEN |
1526 |
line2 = first_name || ' ' || last_name; |
1527 |
ELSE |
1528 |
line2 = last_name; |
1529 |
IF (addr1 IS NOT NULL) THEN |
1530 |
line3 = addr1; |
1531 |
IF (addr2 IS NOT NULL) THEN |
1532 |
line4 = addr2; |
1533 |
|
1534 |
IF (country = 'USA') THEN |
1535 |
BEGIN |
1536 |
IF (city IS NOT NULL) THEN |
1537 |
line5 = city || ', ' || state || ' ' || postcode; |
1538 |
ELSE |
1539 |
line5 = state || ' ' || postcode; |
1540 |
END |
1541 |
ELSE |
1542 |
BEGIN |
1543 |
IF (city IS NOT NULL) THEN |
1544 |
line5 = city || ', ' || state; |
1545 |
ELSE |
1546 |
line5 = state; |
1547 |
line6 = country || ' ' || postcode; |
1548 |
END |
1549 |
|
1550 |
SUSPEND; |
1551 |
END |
1552 |
^ |
1553 |
|
1554 |
ALTER PROCEDURE ORG_CHART |
1555 |
RETURNS |
1556 |
( |
1557 |
HEAD_DEPT CHAR(25) CHARACTER SET NONE, |
1558 |
DEPARTMENT CHAR(25) CHARACTER SET NONE, |
1559 |
MNGR_NAME CHAR(20) CHARACTER SET NONE, |
1560 |
TITLE CHAR(5) CHARACTER SET NONE, |
1561 |
EMP_CNT INTEGER |
1562 |
) |
1563 |
AS |
1564 |
DECLARE VARIABLE mngr_no INTEGER; |
1565 |
DECLARE VARIABLE dno CHAR(3); |
1566 |
BEGIN |
1567 |
FOR SELECT h.department, d.department, d.mngr_no, d.dept_no |
1568 |
FROM department d |
1569 |
LEFT OUTER JOIN department h ON d.head_dept = h.dept_no |
1570 |
ORDER BY d.dept_no |
1571 |
INTO :head_dept, :department, :mngr_no, :dno |
1572 |
DO |
1573 |
BEGIN |
1574 |
IF (:mngr_no IS NULL) THEN |
1575 |
BEGIN |
1576 |
mngr_name = '--TBH--'; |
1577 |
title = ''; |
1578 |
END |
1579 |
|
1580 |
ELSE |
1581 |
SELECT full_name, job_code |
1582 |
FROM employee |
1583 |
WHERE emp_no = :mngr_no |
1584 |
INTO :mngr_name, :title; |
1585 |
|
1586 |
SELECT COUNT(emp_no) |
1587 |
FROM employee |
1588 |
WHERE dept_no = :dno |
1589 |
INTO :emp_cnt; |
1590 |
|
1591 |
SUSPEND; |
1592 |
END |
1593 |
END |
1594 |
^ |
1595 |
|
1596 |
ALTER PROCEDURE SHIP_ORDER |
1597 |
( |
1598 |
PO_NUM CHAR(8) CHARACTER SET NONE |
1599 |
) |
1600 |
AS |
1601 |
DECLARE VARIABLE ord_stat CHAR(7); |
1602 |
DECLARE VARIABLE hold_stat CHAR(1); |
1603 |
DECLARE VARIABLE cust_no INTEGER; |
1604 |
DECLARE VARIABLE any_po CHAR(8); |
1605 |
BEGIN |
1606 |
SELECT s.order_status, c.on_hold, c.cust_no |
1607 |
FROM sales s, customer c |
1608 |
WHERE po_number = :po_num |
1609 |
AND s.cust_no = c.cust_no |
1610 |
INTO :ord_stat, :hold_stat, :cust_no; |
1611 |
|
1612 |
/* This purchase order has been already shipped. */ |
1613 |
IF (ord_stat = 'shipped') THEN |
1614 |
BEGIN |
1615 |
EXCEPTION order_already_shipped; |
1616 |
END |
1617 |
|
1618 |
/* Customer is on hold. */ |
1619 |
ELSE IF (hold_stat = '*') THEN |
1620 |
BEGIN |
1621 |
EXCEPTION customer_on_hold; |
1622 |
END |
1623 |
|
1624 |
/* |
1625 |
* If there is an unpaid balance on orders shipped over 2 months ago, |
1626 |
* put the customer on hold. |
1627 |
*/ |
1628 |
FOR SELECT po_number |
1629 |
FROM sales |
1630 |
WHERE cust_no = :cust_no |
1631 |
AND order_status = 'shipped' |
1632 |
AND paid = 'n' |
1633 |
AND ship_date < CAST('NOW' AS TIMESTAMP) - 60 |
1634 |
INTO :any_po |
1635 |
DO |
1636 |
BEGIN |
1637 |
EXCEPTION customer_check; |
1638 |
|
1639 |
UPDATE customer |
1640 |
SET on_hold = '*' |
1641 |
WHERE cust_no = :cust_no; |
1642 |
|
1643 |
END |
1644 |
|
1645 |
/* |
1646 |
* Ship the order. |
1647 |
*/ |
1648 |
UPDATE sales |
1649 |
SET order_status = 'shipped', ship_date = 'NOW' |
1650 |
WHERE po_number = :po_num; |
1651 |
|
1652 |
END |
1653 |
^ |
1654 |
|
1655 |
ALTER PROCEDURE SUB_TOT_BUDGET |
1656 |
( |
1657 |
HEAD_DEPT CHAR(3) CHARACTER SET NONE |
1658 |
) |
1659 |
RETURNS |
1660 |
( |
1661 |
TOT_BUDGET DECIMAL(12,2), |
1662 |
AVG_BUDGET DECIMAL(12,2), |
1663 |
MIN_BUDGET DECIMAL(12,2), |
1664 |
MAX_BUDGET DECIMAL(12,2) |
1665 |
) |
1666 |
AS |
1667 |
BEGIN |
1668 |
SELECT SUM(budget), AVG(budget), MIN(budget), MAX(budget) |
1669 |
FROM department |
1670 |
WHERE head_dept = :head_dept |
1671 |
INTO :tot_budget, :avg_budget, :min_budget, :max_budget; |
1672 |
SUSPEND; |
1673 |
END |
1674 |
^ |
1675 |
|
1676 |
ALTER PROCEDURE "UC SPACE" |
1677 |
( |
1678 |
ARG1 INTEGER |
1679 |
) |
1680 |
AS |
1681 |
Begin End |
1682 |
^ |
1683 |
|
1684 |
ALTER PROCEDURE "iCASE" |
1685 |
AS |
1686 |
Begin End |
1687 |
^ |
1688 |
|
1689 |
SET TERM ;^ |
1690 |
COMMIT WORK; |
1691 |
SET AUTODDL ON; |
1692 |
|
1693 |
/* Comments on System Objects */ |
1694 |
|
1695 |
COMMENT ON CHARACTER SET UTF8 IS 'Default Character set'; |
1696 |
|
1697 |
/* Grant Roles for this database */ |
1698 |
|
1699 |
|
1700 |
/* Grant permissions for this database */ |
1701 |
|
1702 |
GRANT REFERENCES ON TABLE COUNTRIES TO USER BOB ; |
1703 |
GRANT DELETE,INSERT,REFERENCES,SELECT,UPDATE ON TABLE COUNTRY TO USER PUBLIC WITH GRANT OPTION ; |
1704 |
GRANT DELETE,INSERT,REFERENCES,SELECT,UPDATE ON TABLE CUSTOMER TO USER PUBLIC WITH GRANT OPTION ; |
1705 |
GRANT DELETE,INSERT,REFERENCES,SELECT,UPDATE ON TABLE DEPARTMENT TO USER PUBLIC WITH GRANT OPTION ; |
1706 |
GRANT SELECT ON TABLE EMPLOYEE TO USER ALICE WITH GRANT OPTION GRANTED BY BOB ; |
1707 |
GRANT SELECT,Update(FIRST_NAME,LAST_NAME) ON TABLE EMPLOYEE TO USER BOB ; |
1708 |
GRANT DELETE,INSERT,REFERENCES,SELECT,UPDATE ON TABLE EMPLOYEE TO USER PUBLIC WITH GRANT OPTION ; |
1709 |
GRANT DELETE,INSERT,REFERENCES,SELECT,UPDATE ON TABLE EMPLOYEE_PROJECT TO USER PUBLIC WITH GRANT OPTION ; |
1710 |
GRANT DELETE,INSERT,REFERENCES,SELECT,UPDATE ON TABLE JOB TO USER PUBLIC WITH GRANT OPTION ; |
1711 |
GRANT DELETE,INSERT,REFERENCES,SELECT,UPDATE ON TABLE PHONE_LIST TO USER PUBLIC WITH GRANT OPTION ; |
1712 |
GRANT DELETE,INSERT,REFERENCES,SELECT,UPDATE ON TABLE PROJECT TO USER PUBLIC WITH GRANT OPTION ; |
1713 |
GRANT DELETE,INSERT,REFERENCES,SELECT,UPDATE ON TABLE PROJ_DEPT_BUDGET TO USER PUBLIC WITH GRANT OPTION ; |
1714 |
GRANT DELETE,INSERT,REFERENCES,SELECT,UPDATE ON TABLE SALARY_HISTORY TO USER PUBLIC WITH GRANT OPTION ; |
1715 |
GRANT DELETE,INSERT,REFERENCES,SELECT,UPDATE ON TABLE SALES TO USER PUBLIC WITH GRANT OPTION ; |
1716 |
GRANT RDB$ADMIN TO ALICE; |
1717 |
|
1718 |
GRANT RDB$ADMIN TO BOB; |
1719 |
|
1720 |
GRANT EXECUTE ON PROCEDURE ADD_EMP_PROJ TO USER PUBLIC WITH GRANT OPTION ; |
1721 |
GRANT EXECUTE ON PROCEDURE ALL_LANGS TO USER PUBLIC WITH GRANT OPTION ; |
1722 |
GRANT EXECUTE ON PROCEDURE DELETE_EMPLOYEE TO USER PUBLIC WITH GRANT OPTION ; |
1723 |
GRANT EXECUTE ON PROCEDURE DEPT_BUDGET TO USER PUBLIC WITH GRANT OPTION ; |
1724 |
GRANT EXECUTE ON PROCEDURE GET_EMP_PROJ TO USER PUBLIC WITH GRANT OPTION ; |
1725 |
GRANT EXECUTE ON PROCEDURE MAIL_LABEL TO USER PUBLIC WITH GRANT OPTION ; |
1726 |
GRANT EXECUTE ON PROCEDURE ORG_CHART TO USER PUBLIC WITH GRANT OPTION ; |
1727 |
GRANT EXECUTE ON PROCEDURE SHIP_ORDER TO USER PUBLIC WITH GRANT OPTION ; |
1728 |
GRANT EXECUTE ON PROCEDURE SHOW_LANGS TO USER PUBLIC WITH GRANT OPTION ; |
1729 |
GRANT EXECUTE ON PROCEDURE SUB_TOT_BUDGET TO USER PUBLIC WITH GRANT OPTION ; |