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
/* NOTE TO FUTURE SELF | |
ADD CONSTRAINTS FOR TABLES THAT HAVE NULLABLE VALUES | |
CUSTOMER ORDER | |
ADJUST_STOCK | |
EXAMPLE*/ | |
/* Clean the slate */ | |
DROP TABLE PAYROLL_ITEM CASCADE CONSTRAINTS; | |
DROP TABLE PAYROLL_PAYMENT CASCADE CONSTRAINTS; | |
DROP TABLE PAYROLL CASCADE CONSTRAINTS; |
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
/* Clean the slate */ | |
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; |
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; |
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
--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
/* 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
#!/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
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
/*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
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 |