This file contains hidden or 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
DROP TABLE student CASCADE CONSTRAINTS ; | |
DROP TABLE enrollment CASCADE CONSTRAINTS; | |
-- Did not see any data so gonna make some big assumptions | |
CREATE TABLE student( | |
student_name VARCHAR2(40), | |
student_id NUMBER(10) | |
); | |
CREATE TABLE enrollment( | |
course_id NUMBER, |
This file contains hidden or 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
/* | |
The procedure should take IN a second parameter representing the amount of the commission to be applied. | |
This amount should be a dollar amount, but in the display should be shown as a percentage of the sales_amount_in ??? | |
Condition of negative or zero sales should be handled as a custom exception | |
If the rate is not supplied, assume a 10% commission | |
*/ | |
SET SERVEROUTPUT ON; | |
CREATE OR REPLACE PROCEDURE calc_commission | |
(sales_amount_in IN number, amountApplicableTocommission IN number DEFAULT 0) |
This file contains hidden or 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
SET SERVEROUTPUT ON; | |
CREATE OR REPLACE PROCEDURE calc_commission | |
(sales_amount_in IN number, commission OUT number) | |
IS | |
excep_has_no_sales EXCEPTION; | |
PRAGMA EXCEPTION_INIT (excep_has_no_sales,-2292); | |
v_comission number(10,2) := 0; | |
BEGIN | |
--Throw exception if negative sales |
This file contains hidden or 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
/*Read in the count (into a scalar variable) of the number of students registered in section 44172 of CS 276 | |
If the count of students is greater than 15 | |
output the title of the class | |
the number of students enrolled | |
A message saying a waitlist has been started | |
If the count of students is less than 7, | |
output the title of the class | |
the number of students enrolled | |
a message saying the class needs to be canceled | |
If the count is greater than or equal to 7 and less than or equal to 15 |
This file contains hidden or 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
CREATE TABLE FULL_NAME ( | |
full_name_char VARCHAR2(50), birthdate DATE | |
); | |
INSERT INTO FULL_NAME (full_name_char,birthdate) VALUES('ROBERT/MOORE','03-SEP-1983'); | |
DECLARE | |
splitPosition NUMBER(2) := NULL; | |
full_name_char VARCHAR2(50) := NULL; |
This file contains hidden or 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
#!/bin/sh | |
#------------------------------------------------------------------------------ | |
# Install Learning Locker Undocumented Dependencies | |
#------------------------------------------------------------------------------ | |
#Modified from Multiple Sources including https://gist.github.com/davidpesce/7d6e1b81594ecbc72311 | |
#converted to bash install | |
# - Last revision Robert Moore 4/14/2019 | |
# -----Command to Run from any shell---- | |
# yum -y update ; yum -y install wget ; wget -qO configure.sh https://gist.githubusercontent.com/bobby5892/4b0d0840f5fd652dd72461c44d0d7412/raw/dd9401438d77127146cbc00425475ca81bf5c1d0/configure.sh && bash configure.sh | |
# |
This file contains hidden or 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
/* Inclass Question Wk 1 */ | |
set serveroutput on; | |
DECLARE | |
firstName varchar2(50) := 'Robert'; | |
lastName varchar2(50) := 'Moore'; | |
output varchar2(100) := NULL; | |
BEGIN | |
output := firstName || lastName; | |
DBMS_OUTPUT.PUT_LINE(output); | |
This file contains hidden or 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
--To avoid errors, drop tables if they exist. | |
DROP TABLE line_item cascade constraints; | |
DROP TABLE customer_order cascacde constraints; | |
DROP TABLE customer cascade constraints; | |
DROP TABLE item cascade constraints; | |
CREATE TABLE customer( | |
customer_ID DECIMAL(10) NOT NULL, | |
customer_first VARCHAR(30), |
This file contains hidden or 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
https://drive.google.com/file/d/1q8SUzJT4GP13AfmB9dDIEoi4MLFmiF68/view?usp=sharing |
This file contains hidden or 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
/* Term Project SQL - Greg Swaim & Robert Moore*/ | |
DROP TABLE PAYROLL_ITEM CASCADE CONSTRAINTS; | |
DROP TABLE PAYROLL_PAYMENT CASCADE CONSTRAINTS; | |
DROP TABLE PAYROLL CASCADE CONSTRAINTS; | |
DROP TABLE EMPLOYEE_SCHEDULE CASCADE CONSTRAINTS; | |
DROP TABLE EMPLOYEE_TYPE CASCADE CONSTRAINTS; | |
DROP TABLE EMPLOYEE CASCADE CONSTRAINTS; | |
DROP TABLE VENDOR CASCADE CONSTRAINTS; | |
DROP TABLE PURCHASE_ORDER CASCADE CONSTRAINTS; | |
DROP TABLE PURCHASE_ORDER_ITEM CASCADE CONSTRAINTS; |