Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Apress
committed
Oct 16, 2016
0 parents
commit a80bb8c
Showing
47 changed files
with
502 additions
and
0 deletions.
There are no files selected for viewing
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
CREATE TABLESPACE APEX datafile 'C:\oraclexe\oradata\XE\APEX.dbf' | ||
SIZE 500M | ||
EXTENT MANAGEMENT LOCAL | ||
SEGMENT SPACE MANAGEMENT AUTO; | ||
|
||
CREATE TABLESPACE APEX_FILES datafile 'C:\oraclexe\oradata\XE\APEX_FILES.dbf' | ||
SIZE 100M | ||
EXTENT MANAGEMENT LOCAL | ||
SEGMENT SPACE MANAGEMENT AUTO; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
CREATE TABLE "BOOKS" | ||
( "BOOKID" NVARCHAR2(255), | ||
"BOOKTITLE" NVARCHAR2(255), | ||
"BOOKISBN" NVARCHAR2(255), | ||
"BOOKPUBLISHER" NVARCHAR2(255), | ||
"BOOKEDITION" NVARCHAR2(255), | ||
"BOOKCATEGORY" NVARCHAR2(255), | ||
"BOOKDESCRIPTION" NVARCHAR2(255), | ||
"BOOKPRICE" FLOAT(9), | ||
"AUTHOR" NVARCHAR2(255), | ||
"BOOKIMAGE" BLOB, | ||
CONSTRAINT "BOOKS_PK" PRIMARY KEY ("BOOKID") ENABLE | ||
) | ||
/ | ||
|
||
INSERT INTO BOOKS(BOOKID, BOOKTITLE, BOOKISBN, BOOKPUBLISHER, BOOKEDITION, BOOKCATEGORY, BOOKDESCRIPTION, BOOKPRICE, AUTHOR) VALUES('B1','PRO ODP.NET PROGRAMMING','9781430228202','APRESS PUBLISHING','2010','C3','This book is a comprehensive and easy-to-understand guide for using the Oracle Data Provider (ODP) version 11g on the .NET Framework',59.99,'ED ZEHOO') | ||
/ | ||
|
||
INSERT INTO BOOKS(BOOKID, BOOKTITLE, BOOKISBN, BOOKPUBLISHER, BOOKEDITION, BOOKCATEGORY, BOOKDESCRIPTION, BOOKPRICE, AUTHOR) VALUES('B2','IPHONE PROGRAMMING','9781430228400','WROX PUBLISHING','2011','C3','This book describes the basics of iPhone and iPad development using Objective C',49.99,'GREG YAP') | ||
/ | ||
|
||
INSERT INTO BOOKS(BOOKID, BOOKTITLE, BOOKISBN, BOOKPUBLISHER, BOOKEDITION, BOOKCATEGORY, BOOKDESCRIPTION, BOOKPRICE, AUTHOR) VALUES('B3','HOW MASTER CHIEF BECAME MASTER CHEF','1123433328400','TOR BOOKS','2010','C2','Master Chief goes on a vacation in China. Read about his exploits in this book!',39.99,'JAMES BURKE') | ||
/ | ||
|
||
INSERT INTO BOOKS(BOOKID, BOOKTITLE, BOOKISBN, BOOKPUBLISHER, BOOKEDITION, BOOKCATEGORY, BOOKDESCRIPTION, BOOKPRICE, AUTHOR) VALUES('B4','THE CURSE OF AMMATTAR','9781430228400','TOR BOOKS','2011','C4','Classic horror story set in medieval Thailand',29.99,'SARAH HAWKINS') | ||
/ | ||
|
||
INSERT INTO BOOKS(BOOKID, BOOKTITLE, BOOKISBN, BOOKPUBLISHER, BOOKEDITION, BOOKCATEGORY, BOOKDESCRIPTION, BOOKPRICE, AUTHOR) VALUES('B5','CHING CHONG: THE RISE AND FALL OF JACKSON','343322221400','NIECA BOOKS','2011','C1','A story about the misfortunes of Jackson Junior as he travels across Asia',12.99,'TARA WILLIAMS') | ||
/ | ||
|
||
INSERT INTO BOOKS(BOOKID, BOOKTITLE, BOOKISBN, BOOKPUBLISHER, BOOKEDITION, BOOKCATEGORY, BOOKDESCRIPTION, BOOKPRICE, AUTHOR) VALUES('B6','UNFORTUNATE CIRCUMSTANCES','115062221400','PARAMOUNT BOOKS','2011','C1','Read about the unfortunate circumstances of Ali, someone you will absolutely not care about',19.99,'DANA T. ROLLS') | ||
/ | ||
|
||
INSERT INTO BOOKS(BOOKID, BOOKTITLE, BOOKISBN, BOOKPUBLISHER, BOOKEDITION, BOOKCATEGORY, BOOKDESCRIPTION, BOOKPRICE, AUTHOR) VALUES('B7','SCARY LIONS','11553221400','PARAMOUNT BOOKS','2011','C1','A book about the greasy politicians in Mootawambaland and how Alex becomes one of them',15.99,'TERRY BARRACK') | ||
/ | ||
|
||
INSERT INTO BOOKS(BOOKID, BOOKTITLE, BOOKISBN, BOOKPUBLISHER, BOOKEDITION, BOOKCATEGORY, BOOKDESCRIPTION, BOOKPRICE, AUTHOR) VALUES('B8','THE LIME TREE','22113221400','ZACK PUBLISHING','2011','C1','A book about how Sally became a top salesperson when she decides to sell lime as lemon',16.99,'JAMES LEE') | ||
/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
CREATE TABLE "INVENTORY" | ||
( "ID" NVARCHAR2(255), | ||
"BOOKID" NVARCHAR2(255), | ||
"COPIESINSTOCK" NUMBER(9,3), | ||
CONSTRAINT "INVENTORY_PK" PRIMARY KEY ("ID") ENABLE | ||
) | ||
/ | ||
|
||
INSERT INTO INVENTORY(ID,BOOKID,COPIESINSTOCK) VALUES('1','B1',10) | ||
/ | ||
|
||
INSERT INTO INVENTORY(ID,BOOKID,COPIESINSTOCK) VALUES('2','B2',15) | ||
/ | ||
|
||
INSERT INTO INVENTORY(ID,BOOKID,COPIESINSTOCK) VALUES('3','B3',1) | ||
/ | ||
|
||
INSERT INTO INVENTORY(ID,BOOKID,COPIESINSTOCK) VALUES('4','B4',6) | ||
/ | ||
|
||
INSERT INTO INVENTORY(ID,BOOKID,COPIESINSTOCK) VALUES('5','B5',17) | ||
/ | ||
|
||
INSERT INTO INVENTORY(ID,BOOKID,COPIESINSTOCK) VALUES('6','B6',9) | ||
/ | ||
|
||
INSERT INTO INVENTORY(ID,BOOKID,COPIESINSTOCK) VALUES('7','B7',14) | ||
/ | ||
|
||
INSERT INTO INVENTORY(ID,BOOKID,COPIESINSTOCK) VALUES('8','B8',9) | ||
/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
CREATE TABLE "CATEGORY" | ||
( "CATEGORYID" NVARCHAR2(255), | ||
"CATEGORYNAME" NVARCHAR2(255), | ||
"DESCRIPTION" NVARCHAR2(255), | ||
CONSTRAINT "CATEGORY_PK" PRIMARY KEY ("CATEGORYID") ENABLE | ||
) | ||
/ | ||
|
||
INSERT INTO CATEGORY(CATEGORYID, CATEGORYNAME, DESCRIPTION) VALUES('C1','FICTION','Fiction selection') | ||
/ | ||
|
||
INSERT INTO CATEGORY(CATEGORYID, CATEGORYNAME, DESCRIPTION) VALUES('C2','SCIENCEFICTION','Science Fiction Selection') | ||
/ | ||
|
||
INSERT INTO CATEGORY(CATEGORYID, CATEGORYNAME, DESCRIPTION) VALUES('C3','COMPUTERS','Computer Books Selection') | ||
/ | ||
|
||
INSERT INTO CATEGORY(CATEGORYID, CATEGORYNAME, DESCRIPTION) VALUES('C4','HORROR','Best Horror Selections') | ||
/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
CREATE table "PAYMENTHISTORY" ( | ||
"SOCIALSECURITYNO" NVARCHAR2(9), | ||
"AMOUNTPAID" NUMBER(6,2) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
INSERT INTO CATEGORY(CATEGORYID,CATEGORYNAME) VALUES(1,'SOFTWARE') | ||
/ | ||
INSERT INTO CATEGORY(CATEGORYID,CATEGORYNAME) VALUES(2,'HARDWARE') | ||
/ | ||
INSERT INTO SUBCATEGORY(SUBCATEGORYNAME,PARENTCATEGORYID,SUBCATEGORYID) VALUES('LOTUS NOTES',1,1) | ||
/ | ||
INSERT INTO SUBCATEGORY(SUBCATEGORYNAME,PARENTCATEGORYID,SUBCATEGORYID) VALUES('SHAREPOINT',1,2) | ||
/ | ||
INSERT INTO SUBCATEGORY(SUBCATEGORYNAME,PARENTCATEGORYID,SUBCATEGORYID) VALUES('NETWORK CARD',2,3) | ||
/ | ||
INSERT INTO SUBCATEGORY(SUBCATEGORYNAME,PARENTCATEGORYID,SUBCATEGORYID) VALUES('MODEM',2,4) | ||
/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
INSERT INTO PAYMENTHISTORY(SOCIALSECURITYNO,AMOUNTPAID) VALUES (:P1_PATIENTSOCIALSECURITYNO,0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
CREATE table "PATIENTDB" ( | ||
"PATIENTNAME" NVARCHAR2(255), | ||
"PATIENTEMAIL" NVARCHAR2(255), | ||
"PATIENTDIAGNOSIS" NVARCHAR2(2000), | ||
"PATIENTID" NVARCHAR2(10), | ||
constraint "PATIENTDB_PK" primary key ("PATIENTID") | ||
) | ||
/ | ||
|
||
CREATE sequence "PATIENTDB_SEQ" | ||
/ | ||
|
||
CREATE trigger "BI_PATIENTDB" | ||
before insert on "PATIENTDB" | ||
for each row | ||
begin | ||
if :NEW."PATIENTID" is null then | ||
select "PATIENTDB_SEQ".nextval into :NEW."PATIENTID" from dual; | ||
end if; | ||
end; | ||
/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
CREATE table "PATIENTDISCHARGE" ( | ||
"DISCHARGEID" NVARCHAR2(10), | ||
"PATIENTNAME" NVARCHAR2(255), | ||
"PATIENTSOCIALSECURITYNO" NVARCHAR2(9), | ||
"DATEOFDISCHARGE" DATE, | ||
"DISCHARGEREMARKS" NVARCHAR2(2000), | ||
constraint "PATIENTDISCHARGE_PK" primary key ("DISCHARGEID") | ||
) | ||
/ | ||
|
||
CREATE sequence "PATIENTDISCHARGE_SEQ" | ||
/ | ||
|
||
CREATE trigger "BI_PATIENTDISCHARGE" | ||
before insert on "PATIENTDISCHARGE" | ||
for each row | ||
begin | ||
if :NEW."DISCHARGEID" is null then | ||
select "PATIENTDISCHARGE_SEQ".nextval into :NEW."DISCHARGEID" from dual; | ||
end if; | ||
end; | ||
/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
INSERT INTO PAYMENTHISTORY(SOCIALSECURITYNO,AMOUNTPAID) VALUES('123456789',500) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
DECLARE | ||
CT INTEGER; | ||
BEGIN | ||
SELECT COUNT(*) INTO CT FROM PAYMENTHISTORY WHERE | ||
SOCIALSECURITYNO = :P1_PATIENTSOCIALSECURITYNO; | ||
IF CT>0 THEN | ||
return true; | ||
ELSE | ||
return false; | ||
END IF; | ||
END; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
CREATE table "EMPLOYEE" ( | ||
"EMPLOYEENAME" NVARCHAR2(255), | ||
"EMPLOYEETYPE" NVARCHAR2(10), | ||
"SOCIALSECURITYNO" NVARCHAR2(10), | ||
"EMPLOYEEID" NVARCHAR2(10), | ||
constraint "EMPLOYEE_PK" primary key ("EMPLOYEEID") | ||
) | ||
/ | ||
|
||
CREATE sequence "EMPLOYEE_SEQ" | ||
/ | ||
|
||
CREATE trigger "BI_EMPLOYEE" | ||
before insert on "EMPLOYEE" | ||
for each row | ||
begin | ||
if :NEW."EMPLOYEEID" is null then | ||
select "EMPLOYEE_SEQ".nextval into :NEW."EMPLOYEEID" from dual; | ||
end if; | ||
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
CREATE table "SALARIES" ( | ||
"PAYROLLID" NVARCHAR2(255), | ||
"EMPLOYEENAME" NVARCHAR2(255), | ||
"SALARY" NUMBER(6,2), | ||
constraint "SALARIES_PK" primary key ("PAYROLLID") | ||
) | ||
/ | ||
|
||
CREATE sequence "SALARIES_SEQ" | ||
/ | ||
|
||
CREATE trigger "BI_SALARIES" | ||
before insert on "SALARIES" | ||
for each row | ||
begin | ||
if :NEW."PAYROLLID" is null then | ||
select "SALARIES_SEQ".nextval into :NEW."PAYROLLID" from dual; | ||
end if; | ||
end; | ||
/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<script type="text/javascript"> | ||
function validSalary(object){ | ||
if(parseInt(object.value)>5000) | ||
alert('Salary must be a figure below $5000'); | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
onblur="validSalary(this);" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
CREATE table "EQUIPMENTREQUEST" ( | ||
"REQUESTID" NVARCHAR2(10), | ||
"CATEGORY" NVARCHAR2(255), | ||
"SUBCATEGORY" NVARCHAR2(255), | ||
constraint "EQUIPMENTREQUEST_PK" primary key ("REQUESTID") | ||
) | ||
/ | ||
|
||
CREATE sequence "EQUIPMENTREQUEST_SEQ" | ||
/ | ||
|
||
CREATE trigger "BI_EQUIPMENTREQUEST" | ||
before insert on "EQUIPMENTREQUEST" | ||
for each row | ||
begin | ||
if :NEW."REQUESTID" is null then | ||
select "EQUIPMENTREQUEST_SEQ".nextval into :NEW."REQUESTID" from dual; | ||
end if; | ||
end; | ||
/ | ||
|
||
CREATE table "CATEGORY" ( | ||
"CATEGORYNAME" NVARCHAR2(255), | ||
"CATEGORYID" NUMBER(6,2), | ||
constraint "CATEGORY_PK" primary key ("CATEGORYID") | ||
) | ||
/ | ||
|
||
CREATE sequence "CATEGORY_SEQ" | ||
/ | ||
|
||
CREATE trigger "BI_CATEGORY" | ||
before insert on "CATEGORY" | ||
for each row | ||
begin | ||
if :NEW."CATEGORYID" is null then | ||
select "CATEGORY_SEQ".nextval into :NEW."CATEGORYID" from dual; | ||
end if; | ||
end; | ||
/ | ||
|
||
CREATE table "SUBCATEGORY" ( | ||
"SUBCATEGORYNAME" NVARCHAR2(255), | ||
"PARENTCATEGORYID" NUMBER(6,2), | ||
"SUBCATEGORYID" NUMBER(6,2), | ||
constraint "SUBCATEGORY_PK" primary key ("SUBCATEGORYID") | ||
) | ||
/ | ||
|
||
CREATE sequence "SUBCATEGORY_SEQ" | ||
/ | ||
|
||
CREATE trigger "BI_SUBCATEGORY" | ||
before insert on "SUBCATEGORY" | ||
for each row | ||
begin | ||
if :NEW."SUBCATEGORYID" is null then | ||
select "SUBCATEGORY_SEQ".nextval into :NEW."SUBCATEGORYID" from dual; | ||
end if; | ||
end; | ||
/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<style> | ||
.specialstyle | ||
{ | ||
font-family : Verdana; | ||
font-size : 12pt; | ||
color : #FF0000; | ||
font-weight : bold; | ||
text-align :left ; | ||
vertical-align : middle; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
.buttonstyle_incss | ||
{ | ||
font-family : Verdana; | ||
color : #FFFFFF; | ||
font-weight : bold; | ||
text-align :left ; | ||
vertical-align : middle; | ||
width:150px; | ||
height:25px; | ||
background-color:#000000; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<button value="#LABEL#" onclick="if (confirm('Are you sure?')) {#LINK#};" class="button-gray" type="button"> | ||
<span>#LABEL#</span> | ||
</button> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
function RENDER_LINKIE ( | ||
p_item in apex_plugin.t_page_item | ||
, p_plugin in apex_plugin.t_plugin | ||
, p_value in varchar2 | ||
, p_is_readonly in boolean | ||
, p_is_printer_friendly in boolean ) | ||
return apex_plugin.t_page_item_render_result | ||
is | ||
retval apex_plugin.t_page_item_render_result; | ||
begin | ||
htp.p('<a href="http://www.google.com">Jump to Google</a>'); | ||
return retval; | ||
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
CREATE table "EMPLOYEES" ( | ||
"EMPID" NVARCHAR2(10), | ||
"EMPNAME" NVARCHAR2(255), | ||
"EMPTITLE" NVARCHAR2(255), | ||
"EMPDEPARTMENT" NVARCHAR2(255), | ||
constraint "EMPLOYEES_PK" primary key ("EMPID") | ||
) | ||
/ | ||
|
||
CREATE TABLE "EMPLEAVE" | ||
( "EMPID" NVARCHAR2(50), | ||
"LEAVEDATE" DATE, | ||
"LEAVETYPE" NVARCHAR2(255), | ||
"LEAVEREASON" NVARCHAR2(255), | ||
"LEAVEID" NVARCHAR2(50), | ||
CONSTRAINT "EMPLEAVE_PK" PRIMARY KEY ("LEAVEID") ENABLE | ||
) | ||
/ | ||
|
||
INSERT INTO EMPLOYEES(EMPID,EMPNAME,EMPTITLE,EMPDEPARTMENT) VALUES('E1','Janet Harris','CFO','Finance') | ||
/ | ||
INSERT INTO EMPLOYEES(EMPID,EMPNAME,EMPTITLE,EMPDEPARTMENT) VALUES('E2','Greg Yap','Senior Developer','IT') | ||
/ | ||
INSERT INTO EMPLEAVE(EMPID,LEAVEDATE,LEAVETYPE,LEAVEREASON,LEAVEID) | ||
VALUES('E1',TO_DATE('20090329', 'YYYYMMDD'),'Sick Leave','Flu','L1') | ||
/ | ||
INSERT INTO EMPLEAVE(EMPID,LEAVEDATE,LEAVETYPE,LEAVEREASON,LEAVEID) | ||
VALUES('E1',TO_DATE('20100517', 'YYYYMMDD'),'Maternity Leave','Maternity','L2') | ||
/ | ||
INSERT INTO EMPLEAVE(EMPID,LEAVEDATE,LEAVETYPE,LEAVEREASON,LEAVEID) | ||
VALUES('E2',TO_DATE('20090314', 'YYYYMMDD'),'Emergency leave','To visit a dying friend','L3') | ||
/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
SELECT * FROM EMPLOYEES LEFT JOIN EMPLEAVE ON EMPLOYEES.EMPID=EMPLEAVE.EMPID |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
SELECT e1.EmpName, e1.EmpTitle, e1.EmpDepartment, e2.LeaveDate, e2.LeaveType, e2.LeaveReason, e2.LeaveID FROM Employees e1 LEFT JOIN EmpLeave e2 ON e1.EmpID=e2.EmpID |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
SELECT '',EmpName,count(*) FROM Employees INNER JOIN EmpLeave ON | ||
Employees.EmpID=EmpLeave.EmpID GROUP BY EmpName |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
INSERT INTO EMPLEAVE(EMPID,LEAVEDATE,LEAVETYPE,LEAVEREASON,LEAVEID) | ||
VALUES('E1',TO_DATE('20110110', 'YYYYMMDD'),'Maternity Leave','Maternity','L4') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
SELECT EmpName, Leavedate FROM Employees,EmpLeave WHERE Employees.EmpID=EmpLeave.EmpID |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
CREATE TABLE "SALESDATA" | ||
( "SALES" NUMBER(9,2), | ||
"ID" NVARCHAR2(50), | ||
"COUNTRY" NVARCHAR2(255), | ||
CONSTRAINT "SALESDATA_PK" PRIMARY KEY ("ID") ENABLE | ||
) | ||
|
||
INSERT INTO SALESDATA(SALES,ID,COUNTRY) VALUES(5000,1,'UNITED KINGDOM') | ||
|
||
INSERT INTO SALESDATA(SALES,ID,COUNTRY) VALUES(6000,2,'IRELAND') | ||
|
||
INSERT INTO SALESDATA(SALES,ID,COUNTRY) VALUES(6780,3,'FRANCE') |
Oops, something went wrong.